2012-04-21 7 views
3

私のFooterViewImplクラスのgetClass.getPackage()。getImplementationVersion()を使用して、プロジェクトのバージョン番号を表示すると、実行時にこのエラーが発生します。 .xmlファイル)をWebページに表示します。私は、エラーは、gwt java-to-javascriptコンパイラからだと思う。GWTとgetClass()。getPackage()

[ERROR] [OnlineGlom] - Line 52: The method getPackage() is undefined for the type Class<capture#1-of ? extends FooterViewImpl> 

java.lang.RuntimeException: Deferred binding failed for 'org.glom.web.client.ClientFactory' (did you forget to inherit a required module?) 

この機能が動作するとはいいですか? https://developers.google.com/web-toolkit/doc/latest/RefJreEmulation

答えて

2

getPackage()はGWTによってエミュレートされていません。 GWTのモットーは、実行時ではなくコンパイル時に最大限にすることです。

+0

ありがとうございました。コンパイル時にpom.xmlファイルからその情報を取得する方法について提案はありますか? – murrayc

+2

[GWT generator](https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsDeferred#generators)からgetImplementationVersionを呼び出しますか? –