I'm trying to parse a date using LocalDate on the server. I get a "LocalDate is not supported by Google App Engine's JRE" error. I thought it was only client side code that limited classes available in the GWT JRE. Why am I seeing this on the server side (i.e. on straight Java code)?
Asked
Active
Viewed 1,712 times
2 Answers
4
java.time.LocalDate
was introduced in Java 8, which is not yet supported by Google App Engine. You can see exactly what classes are available to the server side of your application on Google Cloud Platform's JRE Class White List. GWT compatibility is not relevant.
-
I understand that applies to client side, but I'm talking about the server side. It was my understanding that that uses pure Java. – Todd Dec 28 '15 at 15:19
-
Pure in the sense that every single thing available to you in your local JDK will be available to you in the App Engine, no. To get that you'll have to get your own Linux VM through [Google Compute Engine](https://cloud.google.com/compute/docs/) and install your own JRE on it. Otherwise, see the JRE Class White List to get an idea of what's available. – heenenee Dec 28 '15 at 15:34
-
So to clarify, that means GWT isn't using my installed Java 8 JDK (for either the client OR the server side), it is using a modified Google version of the JDK? – Todd Dec 28 '15 at 15:39
-
1There are three different items that you're blending together: 1) Your local GWT installation, which compiles your client-side Java code into JavaScript 2) Your local JDK, which compiles your server-side Java code into bytecode 3) The Google App Engine, which has a JRE that runs your bytecode. Whenever you build your project on your local machine, you are using your installed JDK to compile your server side code. When you deploy to Google App Engine, GAE's JRE is being used to run your already-compiled bytecode. – heenenee Dec 28 '15 at 15:48
-
3And to further clarify, just because you can compile server-side code with your locally installed JDK, doesn't mean that code will necessarily work in Google App Engine's JRE. – heenenee Dec 28 '15 at 15:52
-
Thanks for the reply and patience! I am not using GAE though, I'm only running locally on my own machine. My problem (afaik) is code not running via item #2 from your reply. Does #3 even apply if I run locally only? – Todd Dec 28 '15 at 19:50
-
1If you're only running locally, #3 does not apply. – heenenee Dec 28 '15 at 20:24
-
I guess we've come full circle then :-). Why, given that I'm running locally, does an exception get thrown when I try parsing LocalDate on server side code? – Todd Dec 28 '15 at 21:28
-
You need to give a lot more details in your question about your server. As it's currently written, it reads as if you're running it in Google App Engine. What JDK do you have installed? What is this server and how are you running it, e.g., `ant devmode`, `mvn appengine:devserver`, a standalone Tomcat you're deploying to... add enough description of your environment to the question in order for people to be able to reproduce the problem. – heenenee Dec 28 '15 at 21:35
-
2The local server (dev_appserver etc) does its best to emulate the restriction the production sandbox imposes, to help you diagnose your errors (based on using features removed by the sandbox) as early as feasible. It doesn't do a perfect job in all cases, but, in this cases, it seems to be spot-on. – Alex Martelli Dec 28 '15 at 22:54
-
Alex, that may very well be the problem then. I'm running the basic GWT generated app, modified slightly, then run it on GWT Super Dev Mode thru Eclipse. Does that sound right? – Todd Dec 29 '15 at 01:24
-
I tried using Joda Time instead of Java 8's Date routines and everything now works fine. – Todd Dec 29 '15 at 02:50
0
Please check whether your used class in coming under this list or not:
http://www.gwtproject.org/doc/latest/RefJreEmulation.html
If not then you will not be able to use that class and the method.

Rajnikant Patel
- 561
- 3
- 19