我有一个问题,我不知道该怎么办。所以,我使用 Java(JSP-Servlet) 和 App Engine API 创建了一个小 Web 应用程序它在语言环境中工作,但是当我部署它时,它给了我这个错误:
Error: Server Error
The server encountered an error and could not complete your request.
If the problem persists, please report your problem and mention this error message and the query that caused it.
并且,在管理页面的日志中
java.lang.UnsupportedClassVersionError: persiste/EmployeServlet : Unsupported major.minor version 51.0
at com.google.appengine.runtime.Request.process-50f1863c6e652dbb(Request.java)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
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:449)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
at java.lang.Thread.run(Thread.java:679)
当我更改 java ( 从 java 7 到 java 6 ) 并执行应用程序时,我得到这个错误:
7 août 2012 13:02:52 com.google.apphosting.utils.jetty.JettyLogger 警告注意:Testv2 失败:java.lang.UnsupportedClassVersionError:test/Testv2Servlet:不支持的major.minor 版本51.0
7 août 2012 13:02:52 com.google.apphosting.utils.jetty.JettyLogger 警告注意:com.google.appengine.tools.development.DevAppEngineWebAppContext@1522de2 失败,D:\Etudes\Stage Dirham Express\workspace\ testv2\war}:java.lang.UnsupportedClassVersionError:test/Testv2Servlet:不支持的major.minor 51.0版
7 août 2012 13:02:52 com.google.apphosting.utils.jetty.JettyLogger 警告注意:JettyContainerService$ApiProxyHandler@15f4a7f 失败:java.lang.UnsupportedClassVersionError:test/Testv2Servlet:不支持的 major.minor 版本 51.0
7 août 2012 13:02:52 com.google.apphosting.utils.jetty.JettyLogger 警告注意:异常 java.lang.UnsupportedClassVersionError:test/Testv2Servlet:不支持的 major.minor 版本 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at com.google.appengine.tools.development.IsolatedAppClassLoader.loadClass(IsolatedAppClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
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 org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at
com.google.appengine.tools.development.JettyContainerService.reloadWebApp(JettyContainerService.java:315)
at com.google.appengine.tools.development.JettyContainerService$ScannerListener.fileChanged(JettyContainerService.java:259)
at org.mortbay.util.Scanner.reportChange(Scanner.java:464)
at org.mortbay.util.Scanner.reportDifferences(Scanner.java:330)
at org.mortbay.util.Scanner.scan(Scanner.java:280)
at org.mortbay.util.Scanner$1.run(Scanner.java:232)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
7 août 2012 13:02:52 com.google.apphosting.utils.jetty.JettyLogger 警告注意:com.google.appengine.tools.development.JettyContainerService$ScannerListener@113e9fd 在 'D:\Etudes\Stage Dirham Express\workspace 上失败\testv2\war\WEB-INF\appengine-web.xml