本文介绍了java.lang.VerifyError:期望一个堆栈图框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 有没有办法将自定义HttpServlet加载到GAE?我上传了一个在.server包中包含一个HttpServlet的项目,并将其添加到web.xml ... 的servlet> < servlet-name> testServlet< / servlet-name> < servlet-class> gwtone.server.TestServlet< / servlet-class> < / servlet> < servlet-mapping> < servlet-name> testServlet< / servlet-name> < url-pattern> / tester / greet< / url-pattern> < / servlet-mapping> 有没有其他的东西我失踪了,还是不可能? --------编辑-------- 当我启动我的服务器时出现的一些事情,哪个不习惯看... 2012年1月22日上午4:23:44 com.google.apphosting.utils .jetty.JettyLogger信息信息:通过com.google.apphosting.utils.jetty.JettyLogger记录到JettyLogger(null) 2012年1月22日上午4:23:44 com.google.apphosting.utils .config.AppEngineWebXmlReader readAppEngineWebXml INFO:成功处理E:\Program Files\eclipse-SDK-3.7.1-win32-x86_64\Workspace\gwtone\war\WEB-INF / appengine-web .xml 2012年1月22日上午4:23:44 com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXml INFO:成功处理E:\Program Files\eclipse-SDK-3.7。 1-win32-x86_64\Workspace\gwtone\war\WEB-INF / web.xml 2012年1月21日10:23:44 com.google.appengine.tools.devel opment.DevAppServerImpl start INFO:服务器运行在http:// localhost:8888 / 2012年1月21日10:23:44 com.google.appengine.tools.development.DevAppServerImpl start 信息:管理控制台运行在http:// localhost:8888 / _ah / admin 这里是什么显示什么时候崩溃.. 警告:错误/ tester / greet java.lang .VerifyError:在方法gwtone.server.TestServlet.doGet(Ljavax / servlet / http / HttpServletRequest; Ljavax / servlet / http / HttpServletResponse;)中的分支目标14处的堆栈映射帧V在偏移量0 在java.lang .Class.getDeclaredConstructors0(Native Method)在java.lang.Class.privateGetDeclaredConstructors(未知来源)在java.lang.Class.getConstructor0(未知源)在java.lang.Class .newInstance0(Unknown Source)在java.lang.Class.newInstance(未知来源)在org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153)在org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:428)在org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339)在org.mortbay .jetty.servlet.ServletHolder.handle(ServletHolder.java:487)在org.mortbay.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1166) com.google.appengine .tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:35)在org.mortbay.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1157)在com.google.appengine .api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:60)在org.mortbay.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1157)在com.google .apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)在org.mortbay.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1157) at co m.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122)在org.mortbay.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1157)在com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:97)在org.mortbay.jetty.servlet.ServletHandler $ CachedChain.doFilter(ServletHandler.java:1157)在org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)在org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)在org.mortbay。 jetty.servlet.SessionHandler.handle(SessionHandler.java:182)在org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)在org.mortbay.jetty.webapp。 WebAppContext.handle(WebAppContext.java:418)在com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:78)在org.mortbay.jetty.handler.HandlerWrapper。哈ndle(HandlerWrapper.java:152) com.google.appengine.tools.development.JettyContainerService $ ApiProxyHandler.handle(JettyContainerService.java:362)在org.mortbay.jetty.handler.HandlerWrapper。 handle(HandlerWrapper.java:152)在org.mortbay.jetty.Server.handle(Server.java:326)在org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) 在org.mortbay.jetty.HttpConnection $ RequestHandler.headerComplete(HttpConnection.java:923)在org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)在org .mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)在org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)在org.mortbay.io.nio.SelectChannelEndPoint .run(SelectChannelEndPoint.java:409)在org.mortbay.thread.QueuedThreadPool $ PoolThread.run(QueuedThreadPool.java:582) 编辑#2 package gwtone.server; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class TestServlet extends HttpServlet { public TestServlet(){} @Override public void doGet(HttpServletRequest req,HttpServletResponse resp) throws ServletException,IOException { System.out.println(0); try { System.out.println(1); resp.getWriter()。println(IT WORKED); resp.getWriter()。flush(); System.out.println(2); } catch(IOException e){ e.printStackTrace(); } System.out.println(3); } } 解决方案使用Java 1.6,但是您已经使用Java 1.7编译了代码。您需要重新编译Java 1.6。根据评论,你使用的是Eclipse;您可以在项目属性的 Java>编译器部分中设置Java编译器级别。 Is there a way to load a custom HttpServlet to GAE? I uploaded a project that included an HttpServlet in the .server package and added it to the web.xml...<servlet> <servlet-name>testServlet</servlet-name> <servlet-class>gwtone.server.TestServlet</servlet-class></servlet><servlet-mapping> <servlet-name>testServlet</servlet-name> <url-pattern>/tester/greet</url-pattern></servlet-mapping>Is there something else I am missing, or is it not possible?--------EDIT--------some things that appear when i init my server, which im not used to seeing...Jan 22, 2012 4:23:44 AM com.google.apphosting.utils.jetty.JettyLogger infoINFO: Logging to JettyLogger(null) via com.google.apphosting.utils.jetty.JettyLoggerJan 22, 2012 4:23:44 AM com.google.apphosting.utils.config.AppEngineWebXmlReader readAppEngineWebXmlINFO: Successfully processed E:\Program Files\eclipse-SDK-3.7.1-win32-x86_64\Workspace\gwtone\war\WEB-INF/appengine-web.xmlJan 22, 2012 4:23:44 AM com.google.apphosting.utils.config.AbstractConfigXmlReader readConfigXmlINFO: Successfully processed E:\Program Files\eclipse-SDK-3.7.1-win32-x86_64\Workspace\gwtone\war\WEB-INF/web.xmlJan 21, 2012 10:23:44 PM com.google.appengine.tools.development.DevAppServerImpl startINFO: The server is running at http://localhost:8888/Jan 21, 2012 10:23:44 PM com.google.appengine.tools.development.DevAppServerImpl startINFO: The admin console is running at http://localhost:8888/_ah/adminand here is what shows when it crashes..WARNING: Error for /tester/greetjava.lang.VerifyError: Expecting a stackmap frame at branch target 14 in method gwtone.server.TestServlet.doGet(Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResponse;)V at offset 0 at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) at java.lang.Class.getConstructor0(Unknown Source) at java.lang.Class.newInstance0(Unknown Source) at java.lang.Class.newInstance(Unknown Source) at org.mortbay.jetty.servlet.Holder.newInstance(Holder.java:153) at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:428) at org.mortbay.jetty.servlet.ServletHolder.getServlet(ServletHolder.java:339) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) at com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(HeaderVerificationFilter.java:35) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:60) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:122) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.google.appengine.tools.development.BackendServersFilter.doFilter(BackendServersFilter.java:97) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at com.google.appengine.tools.development.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:78) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at com.google.appengine.tools.development.JettyContainerService$ApiProxyHandler.handle(JettyContainerService.java:362) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)EDIT #2package gwtone.server;import java.io.IOException;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;public class TestServlet extends HttpServlet {public TestServlet(){}@Overridepublic void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { System.out.println("0"); try { System.out.println("1"); resp.getWriter().println("IT WORKED"); resp.getWriter().flush(); System.out.println("2"); } catch (IOException e) { e.printStackTrace(); } System.out.println("3");}} 解决方案 GAE uses Java 1.6, but you've compiled the code with Java 1.7. You need to recompile with Java 1.6. As per the comments, you're using Eclipse; you can set the Java compiler level in Java > Compiler section of project's properties. 这篇关于java.lang.VerifyError:期望一个堆栈图框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-06 01:35