1

I have an app engine project in Eclipse. I have kept a JSP file in WAR folder. I have given the path in the installed jre as JDK1.8. Now when I run the project in local the JSP file successfully loads after clicking on a hyperlink. The same project after deployed to Google App Engine fails to load. It shows server error.

What I thought as the possible cause: I read some where that Google AppEngine now supports JAVA 7. So when I compile the JSP file in JDK1.8 in local it worked fine. But the problem occurred when I deployed the project in cloud. I think, it could not compile JSP files.

Please suggest me what you think ? Is it because of same cause ?

Hari Das
  • 10,145
  • 7
  • 62
  • 59
  • *"Please suggest me what you think ?"* I think Google would be extremely foolish to use a JRE version that is anything above the latest version intended for public release. So I would be **astonished** if they supported Java 8. – Andrew Thompson Nov 29 '13 at 05:18
  • I would say YES, because of JDK1.8 only. As documentation already says Google AppEngine now supports only JAVA 7. – Jayasagar Nov 29 '13 at 05:55
  • I am extremely astonished to say that why people have down voted my question, while it is a very important for this community. Anyway thanks for your answer. Can you tell me for which JDK version it will work fine ? – Hari Das Nov 29 '13 at 06:03
  • Read the first line under "Introduction" @ https://developers.google.com/appengine/docs/java/ – Harsha R Nov 29 '13 at 11:25

2 Answers2

4

As per the documentation available, "App Engine runs your Java web application using a Java 7 JVM in a safe "sandboxed" environment.". So that is as far as the runtime is concerned. It does have a backward compatibility for Java 6 applications for now.

However, keep in mind that the App Engine SDK now supports only Java 7. And ideally I would not go with JDK 8, where things are still in the works.

Behind the scenes, when you upload your application to App Engine, they know which Java runtime to use based on the SDK JAR that you have linked. So ideally, that is taken care of for you.

So, I still believe that though you have provided JDK 1.8 locally, the App Engine version JAR will be enough for Google to deploy your application in an appropriate Java 7 JVM and things should have worked if it is just a simple JSP that you are trying to link up.

Since you have not given details on what the JSP does, it would be good to know that since that could give some pointers. Additionally, I suggest that you allow for DEBUG logs and visit the Admin Console logs to understand what is going wrong. That will give you more details.

Romin
  • 8,708
  • 2
  • 24
  • 28
  • The log shows 2013-11-28 11:00:39.448 EXCEPTION java.lang.IllegalArgumentException at com.google.appengine.runtime.Request.process(Request.java) at java.lang.ClassLoade E 2013-11-28 11:00:39.449 javax.servlet.ServletContext log: unavailable javax.servlet.UnavailableException at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:79) at org. W 2013-11-28 11:00:39.450 Failed startup of context 2013-11-28 11:00:39.452 Uncaught exception from servlet javax.servlet.UnavailableException: Initialization failed. at com.google.apphosting.runtime.jetty.AppVersionHandlerMa – Hari Das Nov 29 '13 at 06:08
  • About JSP I would say it is a simple file with a HTML form only. No scriptlet or any server side code. – Hari Das Nov 29 '13 at 06:10
  • Are you using any other 3rd party libraries (JARs) in your application as part of your overall functionality. It seems like some kind of incompatibility between some JARs, the AppEngine SDK Version and the runtime. Though I can't really pinpoint what the exact problem could be. Maybe, how about you put just a simple hello world generated by the Wizard and deploy that as is with a simple JSP. Does that work or does that fail too? I am just trying to eliminate things here. – Romin Nov 29 '13 at 09:59
1

I had exactly this problem; including even one JSP file, even with no Java code or any content at all, would prevent my appengine instance from starting.

The solution was to make sure you start Eclipse using the 1.7 VM, even if you're developing against the 1.8 JDK. Because my Eclipse instance was running in the 1.8 VM, the generated JSP files were incompatible with AppEngine.

You change the host VM in the eclipse.ini as shown here: Google App Engine JSP can't deploy: java.lang.RuntimeException: Cannot get the System Java Compiler. Please use a JDK, not a JRE

Community
  • 1
  • 1