Hibernate:org.glassfish.jersey.server.ContainerException:java.lang.NoSuchFieldError:NONE

时间:2014-09-10 03:42:17

标签: java hibernate google-app-engine jpa

我在Google App Engine上部署了REST服务(Jersey)。我使用Hibernate 4.2.0作为JPA和MySQL数据库。当我在本地系统上运行它时,我的应用程序运行得很好。但如果我部署它并在Google App Engine上运行,则会出现以下错误:

org.glassfish.jersey.server.ContainerException: java.lang.NoSuchFieldError: NONE
    at org.glassfish.jersey.servlet.internal.ResponseWriter.rethrow(ResponseWriter.java:256)
    at org.glassfish.jersey.servlet.internal.ResponseWriter.failure(ResponseWriter.java:238)
    at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:439)
    at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:277)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
    at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
    at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:297)
    at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:254)
    at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1028)
    at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:372)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:381)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:344)
    at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:221)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
    at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)

这些是构建路径的一部分:

enter image description here

我的lib文件夹中的jar: enter image description here

1 个答案:

答案 0 :(得分:0)

由于'{1}}中的'NONE'是新的,我怀疑你的JPA2某个地方也有JPA1。查找并删除它。

现在classpath支持JPA 1.0JPA 2.0

请查看配置GAE herehere