最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - GWT client - Uncaught TypeError: Cannot read property 'clear_31_g$' of undefined - Stack Overflow

programmeradmin127浏览0评论

I am new to GWT and trying to create a small application. I am currently assembling a small framework for the app, a generic layout handler, etc. This may not be the last problem I will bump into, but I just cannot find any solution to this on google.

So I have a class type, which return me Composites. Also, I have another one, which stores these kind of classes in Stack (I also tried Vector, I thought maybe GWT has issues with it). It didn't matter. If I call the .clear method on the Stack, I have the aforementioned error in the inspection menu of Chrome: Uncaught TypeError: Cannot read property 'clear_31_g$' of undefined

Like if GWT does not know, how to convert this method to javascript or what? Do you know what is the problem here?

eclipse neon, Java 7 setting on Java SDK 1.8 (maybe this?), GWT 2.7.0 and App Engine 1.9.34

Thanks!

edit1: I also found the page, which contains the emulated JRE classes' list (.html) with all supported methods. Now I see, that clear is not on that list for Stack, but empty does and that gives me the same error. :-/

I am new to GWT and trying to create a small application. I am currently assembling a small framework for the app, a generic layout handler, etc. This may not be the last problem I will bump into, but I just cannot find any solution to this on google.

So I have a class type, which return me Composites. Also, I have another one, which stores these kind of classes in Stack (I also tried Vector, I thought maybe GWT has issues with it). It didn't matter. If I call the .clear method on the Stack, I have the aforementioned error in the inspection menu of Chrome: Uncaught TypeError: Cannot read property 'clear_31_g$' of undefined

Like if GWT does not know, how to convert this method to javascript or what? Do you know what is the problem here?

eclipse neon, Java 7 setting on Java SDK 1.8 (maybe this?), GWT 2.7.0 and App Engine 1.9.34

Thanks!

edit1: I also found the page, which contains the emulated JRE classes' list (http://www.gwtproject/doc/latest/RefJreEmulation.html) with all supported methods. Now I see, that clear is not on that list for Stack, but empty does and that gives me the same error. :-/

Share Improve this question edited Jul 27, 2016 at 22:30 newhouse asked Jul 27, 2016 at 22:05 newhousenewhouse 1,2811 gold badge12 silver badges30 bronze badges 3
  • 3 You call clear method on null. – Adam Commented Jul 27, 2016 at 23:35
  • Ah jeez, that was it. Even the error message is descriptful but I just couldn't see through it. Thanks! p.s. maybe you should write it into the answer sheet and I could push an accept it. – newhouse Commented Jul 28, 2016 at 6:45
  • OK, I've posted an answer. I hope it will help others too. – Adam Commented Jul 28, 2016 at 8:06
Add a ment  | 

1 Answer 1

Reset to default 6

This error simply means that you try to call the clear() method on a null object (the object is undefined).

The error message itself is not as clear as it could be. First, it's not always about reading a property but also about calling a method. Second, remember that you run a piled to javascript code and the property (or method) name may differ from the original one - it has something like _31_g$ added in the runtime.

发布评论

评论列表(0)

  1. 暂无评论