2013-02-08 48 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代碼不會,這可能是問題的根源。將空的構造函數添加到您的類並測試它是否工作。

相關問題