java.lang.VerifyError:操作数堆栈上的错误类型

时间:2014-06-14 18:42:26

标签: java google-app-engine rest restlet

我不完全确定这个Restlet错误是什么:

[INFO] java.lang.VerifyError: Bad type on operand stack
[INFO] Exception Details:
[INFO]   Location:
[INFO]     org/restlet/ext/servlet/internal/ServletWarClient.<init>(Lorg/restlet/Context;Ljavax/servlet/ServletContext;)V @95: putfield
[INFO]   Reason:
[INFO]     Type 'org/restlet/ext/servlet/internal/ServletWarClientHelper' (current frame, stack[1]) is not assignable to 'org/restlet/engine/ClientHelper'
[INFO]   Current Frame:
[INFO]     bci: @95
[INFO]     flags: { }
[INFO]     locals: { 'org/restlet/ext/servlet/internal/ServletWarClient', 'org/restlet/Context', 'javax/servlet/ServletContext' }
[INFO]     stack: { 'org/restlet/ext/servlet/internal/ServletWarClient', 'org/restlet/ext/servlet/internal/ServletWarClientHelper' }
[INFO]   Bytecode:
[INFO]     0000000: 2a2b 0312 0b12 0d12 0fb8 0015 b600 1b01
[INFO]     0000010: c000 1d03 121f 120d 120f b800 15b7 0022
[INFO]     0000020: 2a03 120d 120d 120f b800 15b6 0026 0312
[INFO]     0000030: 2812 0d12 0fb8 0015 b200 2e03 1230 120d
[INFO]     0000040: 120f b800 15b9 0034 0200 572a bb00 3659
[INFO]     0000050: 2a2c 0312 3812 0d12 0fb8 0015 b700 3bb5
[INFO]     0000060: 003d b1                                
[INFO] 
[INFO]  at org.restlet.ext.servlet.ServerServlet.createWarClient(ServerServlet.java:756)
[INFO]  at org.restlet.ext.servlet.ServerServlet.createComponent(ServerServlet.java:429)
[INFO]  at org.restlet.ext.servlet.ServerServlet.getComponent(ServerServlet.java:840)
[INFO]  at org.restlet.ext.servlet.ServerServlet.createServer(ServerServlet.java:521)
[INFO]  at org.restlet.ext.servlet.ServerServlet.getServer(ServerServlet.java:943)
[INFO]  at org.restlet.ext.servlet.ServerServlet.service(ServerServlet.java:1112)
[INFO]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
[INFO]  at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
[INFO]  at com.google.appengine.api.socket.dev.DevSocketFilter.doFilter(DevSocketFilter.java:74)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO]  at com.google.appengine.tools.development.ResponseRewriterFilter.doFilter(ResponseRewriterFilter.java:123)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO]  at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:34)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO]  at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:63)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO]  at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO]  at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:125)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO]  at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectRequest(DevAppServerModulesFilter.java:368)
[INFO]  at com.google.appengine.tools.development.DevAppServerModulesFilter.doDirectModuleRequest(DevAppServerModulesFilter.java:351)
[INFO]  at com.google.appengine.tools.development.DevAppServerModulesFilter.doFilter(DevAppServerModulesFilter.java:116)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
[INFO]  at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
[INFO]  at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
[INFO]  at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
[INFO]  at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
[INFO]  at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
[INFO]  at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:97)
[INFO]  at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
[INFO]  at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:485)
[INFO]  at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
[INFO]  at org.mortbay.jetty.Server.handle(Server.java:326)
[INFO]  at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
[INFO]  at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
[INFO]  at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
[INFO]  at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
[INFO]  at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
[INFO]  at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
[INFO]  at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
[INFO] 

我刚刚复制的完整来源:https://github.com/xylo04/HelloGaeRestletGradle

2 个答案:

答案 0 :(得分:0)

解决方案是使用org.restlet.gae

    <dependency>
        <groupId>org.restlet.gae</groupId>
        <artifactId>org.restlet</artifactId>
        <version>2.2.1</version>
    </dependency>
    <dependency>
        <groupId>org.restlet.gae</groupId>
        <artifactId>org.restlet.ext.servlet</artifactId>
        <version>2.2.1</version>
    </dependency>
    <dependency>
        <groupId>org.restlet.gae</groupId>
        <artifactId>org.restlet.ext.jackson</artifactId>
        <version>2.2.0</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.5</version>
    </dependency>

答案 1 :(得分:0)

我遇到了同样的错误,第一个解决方案对我没有帮助。

我的项目中的问题是还有另一个maven依赖项,它也使用了一个reslet依赖项,只使用了不同的版本(这就是为什么你得到错误&#34; java.lang.VerifyError:操作数堆栈上的错误类型& #34)。

解决方案是让他们同意这种依赖关系(我的情况很容易,其他依赖关系并没有被使用,只是让我的生命伤心了半天)。

如果确实需要该依赖项,请尝试使用与依赖项所使用的相同的restlet版本。