2011-12-19 84 views
1

我是JAVA和AppEngine的新手。我已经安装了JDK-1.6,但仍然发生该异常。项目文件部署在服务器上没有任何错误,但是当打开链接时,它会给出错误。在我的应用程序日志中,它只显示一个“unsupportefclassversionerror”异常。我已经安装了JDK-1.6,但它不工作。我也安装了JDK-1.5,但是在部署阶段它给出了“所有排列未编译”的错误。我的项目XML文件是低于java.lang.UnsupportedClassVersionError:com/google/mystorage/server/GreetingServiceImpl:不支持的major.minor版本51.0

XML文件

的web.xml

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
       http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" 
     version="2.5" 
     xmlns="http://java.sun.com/xml/ns/javaee"> 

    <!-- Servlets --> 
    <servlet> 
    <servlet-name>greetServlet</servlet-name> 
    <servlet-class>com.google.mystorage.server.GreetingServiceImpl</servlet-class> 
    </servlet> 

    <servlet-mapping> 
    <servlet-name>greetServlet</servlet-name> 
    <url-pattern>/mystorage/greet</url-pattern> 
    </servlet-mapping> 

    <!-- Default page to serve --> 
    <welcome-file-list> 
    <welcome-file>index.jsp</welcome-file> 
    </welcome-file-list> 

</web-app> 



的AppEngine-web.xml中

<?xml version="1.0" encoding="utf-8"?> 
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> 
    <application>cloudisapp</application> 
    <version>2</version> 

    <!-- 
    By default, App Engine sends requests serially to a given web server. 
    To allow App Engine to send multiple requests in parallel specify: 

     <threadsafe>true</threadsafe> 
    --> 

    <!-- Configure serving/caching of GWT files --> 
    <static-files> 
    <include path="**" /> 
    <include path="favicon.ico"/> 
    <!-- The following line requires App Engine 1.3.2 SDK --> 
    <include path="**.nocache.*" expiration="0s" /> 

    <include path="**.cache.*" expiration="365d" /> 
    <exclude path="**.gwt.rpc" /> 
    </static-files> 

    <!-- Configure java.util.logging --> 
    <system-properties> 
    <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/> 
    </system-properties> 
    <sessions-enabled>true</sessions-enabled> 
</appengine-web-app> 



数据存储-indexes.xml

<?xml version="1.0" encoding="UTF-8"?> 
<datastore-indexes autoGenerate="true"> 
</datastore-indexes> 

请帮我

+1

难道你没有问过这个:http://stackoverflow.com/questions/8563817/the-server-encountered-an-error-and-could-not-complete-your-request-on-appengi – RichW 2011-12-19 21:58:12

+1

@RichW呃,不,他没有。阅读问题。只是因为同一个人张贴2“我是新来的Java”介绍并不意味着他们是同一个问题。 – 2011-12-19 22:03:05

+0

我不知道,谷歌正在做什么与我的项目。生病的例外 – gr8sniper 2011-12-19 22:06:04

回答

3

你编译为Java 7的Java 6无法理解。

用Java 6 javac重新编译。

+0

无法在Java上工作6 – gr8sniper 2011-12-19 22:07:18

+1

“不工作”很模糊 – 2011-12-19 22:26:13

+1

或者用-target 1.6重新编译并确保不使用任何Java 7功能。 – EJP 2011-12-19 23:17:52

1

我对共享项目有同样的问题。尝试删除所有已编译的类(war/WEB-INF/classes目录下的所有内容,看起来像编译版本的源代码)。

相关问题