0

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?``

Cœur
  • 37,241
  • 25
  • 195
  • 267
filipbe
  • 165
  • 15

1 Answers1

1

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

user1258245
  • 3,639
  • 2
  • 18
  • 23
  • ok, got it! I've edited my question. Do you know how it works with transferring data between server and client side? Do a real client has to download this data, or everything is in Google cloud? (I've edited my basic question). – filipbe Jun 19 '12 at 10:50
  • Well in that case, I would think your client would make a request to AE, and AE would get the file from the other server and return it to the client. The client has a SOP and can't make calls to other than the server it originate from (unless it's calling a web service in which case there is a work around to call directly). There an api for that https://developers.google.com/appengine/docs/java/urlfetch – user1258245 Jun 19 '12 at 11:01
  • I may use `RequestBouilder` to get the file from external server on client side, but it is not what I mean. I want to make a request to a AE to get uncompressed content of a file. My question is where the code is actually running? Server-side is on AE. Client-side is on clients computer? In this case compressing file doesn't have any sense, because the client must get uncompressed content and still download few MB's. – filipbe Jun 19 '12 at 11:08
  • I'm not sure I understand but yeah client side code is on the clients computer and if you are using GWT, it's running there in javascript. Anyway, see this ... https://developers.google.com/web-toolkit/doc/2.0/FAQ_Server#What_is_the_Same_Origin_Policy,_and_how_does_it_affect_GWT? I am not sure you can get the file from an external server via RequestBuilder. – user1258245 Jun 19 '12 at 11:11