GWT and getClass (). GetPackage ()

I get this error at runtime when I try to use getClass.getPackage (). getImplementationVersion () in my FooterViewImpl class to show the version number of my project (from the pom.xml file) on the web page. I think the error is related to the gwt java-to-javascript compiler.

[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?)

Should I expect this to work?

+3
source share
1 answer

No.

getPackage()not emulated by GWT: https://developers.google.com/web-toolkit/doc/latest/RefJreEmulation . The motto of GWT is to do the maximum at compile time, and not at run time.

+2
source

All Articles