Search code examples
javagoogle-app-enginegoogle-glassgoogle-mirror-api

How to deploy glass-java-starter


I have built the Glass Java starter project and have it running locally and it works fine. I'd now like to deploy it to Google App Engine (hence then able to reach it using appName.appspot.com) but I keep running into problems related to "major/minor version" errors in the logs on GAE.

I've reviewed all the material I can find and have set everything in the project (Eclipse using Maven as downloaded from the github starter project provided by Google) for Java 7. I'm running Chrome on Mac OS X Mavericks and have also verified the Java control panel on my machine shows I'm running Java 8 (which should be fine right?).

Why am I getting this error and how do I correct it?

76.241.53.119 - - [29/May/2014:04:39:03 -0700] "GET / HTTP/1.1" 500 0 - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36" "1-dot-top-of-mind.appspot.com" ms=3432 cpu_ms=1120 loading_request=1 instance=00c61b117c44830d108681e02a1009c3b00be4dc app_engine_release=1.9.5
   F 06:39:03.854 Uncaught exception from servlet
java.lang.UnsupportedClassVersionError: org/apache/jsp/index_jsp : Unsupported major.minor version 52.0
    at com.google.appengine.runtime.Request.process-20c8e6fa8e5dfca4(Request.java)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:795)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:360)
    at org.mortbay.util.Loader.loadClass(Loader.java:91)
    at org.mortbay.util.Loader.loadClass(Loader.java:71)
    at org.mortbay.jetty.servlet.Holder.doStart(Holder.java:73)
    at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:242)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:437)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
    at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:188)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)
    at java.lang.Thread.run(Thread.java:724)

Solution

  • Unfortunately, no. It isn't fine.

    Bytecode generated under 1.8 isn't compatible with 1.7. So the code you are generating doesn't work when uploaded to GAE.

    See Does JSP in Google AppEngine support JDK1.8 for some more information.

    You will probably, at a minimum, need to specify -target 1.7 for the compiler. See http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javac.html#BHCIJIEG for further details or other options you may need.