我最近关注了Google Cloud SQL和GWT的本教程:http://code.google.com/apis/sql/docs/developers_guide_java.html
我必须创建一个GuestbookExample.gwt.xml文件后,将此应用程序部署到我的google云sql server。我想我是正确创造的:
<!-- Inherit the default GWT style sheet. You can change -->
<!-- the theme of your GWT application by uncommenting -->
<!-- any one of the following lines. -->
<inherits name='com.google.gwt.user.theme.clean.Clean'/>
<!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
<!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
<!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
<!-- Other module inherits -->
<!-- Specify the app entry point class. -->
<!-- Specify the paths for translatable code -->
<source path='guestbook'/>
</module>
它能够部署到服务器,没有从GWT编译器编译的问题。
当我尝试访问链接到我的项目的appspot站点时,我收到HTTP错误:
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.
我认为这很奇怪所以我检查了Google Cloud SQL数据库的日志,我看到错误如下:
[02/Dec/2011:11:25:36 -0800] "GET / HTTP/1.1" 500 0 - "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0" "cst433t1proj.appspot.com" ms=109 cpu_ms=175 api_cpu_ms=0 cpm_usd=0.004894 instance=00c61b117cb6def6096f8754a01131e49502
C 2011-12-02 11:25:36.913
Uncaught exception from servlet
java.lang.UnsupportedClassVersionError: guestbook/GuestbookServlet : Unsupported major.minor version 51.0
at com.google.appengine.runtime.Request.process-0000000000000000(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)
我该怎么做才能解决此错误?我是这个数据库的新东西。我刚刚学习GWT以协助创建最终项目。任何帮助将不胜感激。
答案 0 :(得分:3)
您可能正在使用Java 7? GAE支持特定版本的Java check http://code.google.com/appengine/docs/java/overview.html,并查看您是否使用了不受支持的版本。