2013-02-08 25 views
0
I am working on GWT-Ext 2.0.4 . 
I have just changed panel class and compiled it and it din't threw any error. 
But when i ran the application in Hosted mode i got the following error 
 
[WARN] Exception thrown into JavaScript 
java.lang.Error: Unresolved compilation problem: The constructor GrdRowListener() is undefined 
 

GrdRowListener compiled successfully and there were no compilation errors in the whole project . Also i cleaned the project and build it again but no luck. 

Strangely this code works in WEB-MODE and not in hosted mode. 

Appreciate your help if you have come across this situation. 

回答

1

有托管模式和Web模式之间的差异中没有编译错误。 基本上,在托管模式下执行实际的Java代码,在Web模式下只执行编译后的Javascript代码。 Here's an explanation

现在为您的问题的(可能)原因: 您的GrdRowListener是否包含空的构造函数?如果不是 - 它是否包含任何非空的构造函数,以便默认(空)构造函数不可用?对象初始化有时需要空的构造器,例如反序列化/创建bean。如果没有这样的构造函数,纯Javascript应该可以正常工作,但是Java代码不会,这可能是问题的根源。将空的构造函数添加到您的类并测试它是否工作。

相关问题