I’m writing an app with GWT, which I want to deploy to Google App Engine. I want to use some classes from JRE, like java.io.BufferedReader; java.net.URL javax.crypto.Cipher java.util.zip.InflaterInputStream, which are listed on JRE Class White List – https://developers.google.com/appengine/docs/java/jrewhitelist
I’m using eclipse and when I’m trying to run my app locally compiler throws me errors like [ERROR] [gwtlist] - Line 46: No source code is available for type java.net.URL; did you forget to inherit a required module?.
In Google App Engine General Questions – https://developers.google.com/appengine/kb/general#language it’s said:
...Also, Java-based applications may only use the JRE classes in the JRE class white list.
My question is if am I thinking wright or wrong? Is this JRE Class White List can be used on client side, or maybe it is only useful for server side code? In this case I don’t need to use Google App Engine, ’cause all the client code has to be written only in pure GWT with some java classes from JRE Emulation Reference – https://developers.google.com/web-toolkit/doc/latest/RefJreEmulation?hl=es-419#Package_java_io. In this case what is the goal of Google App Engine? Is it only to emulate server?
Edit: In case when Google App Engine can only emulate JRE classes on server side, could you tell me where exactly app is running. I mean situation as:
App is deployed on Google App Engine.
Client runs app and loggs in.
Server side code opens external file on other server, decompress it and sends the result to a client side.
My question is how the transfer is working? Is it everything inside Google cloud, or do client has to download e.g. this uncompressed file?“
Appengine code is server side only.
You can use classes not whitelisted on AE in GWT if it is client side code. It gets compiled to javascript anyway. However, any server side code that you use for say an rpc call from a client via GWT needs to be in the AE whitelist since it’s running there.
The error “No source code is available for type java.net.URL” is stemming from GWT. Basically it’s looking for the src in order to compile into javascript. GWT has a whitelist too of stuff that will compile, and beyond that you need the src unless you inherit it as a GWT module in your *.gwt.xml file. See https://developers.google.com/web-toolkit/doc/latest/RefJreEmulation