我有一个使用Restlet EE 2.2的应用程序,它在Tomcat 7中运行良好但在JBOSS 6.2中失败(参见下面的堆栈跟踪)。我从跟踪中发现它没有找到HTTP堆栈类,但我对JBOSS很少熟悉。
今天有一个类似的question被问到,虽然不是关于JBOSS。 提前谢谢!
09:45:13,041 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/rest].[greeting]] (http-/127.0.0.1:8080-1) JBWEB000235: Allocate exception for servlet greeting: java.lang.ClassNotFoundException: com.sun.net.httpserver.HttpHandler from [Module "deployment.rest.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118) [jboss-modules.jar:1.3.0.Final-redhat-2]
at org.restlet.engine.Engine.registerDefaultConnectors(Engine.java:734) [org.restlet.jar:]
at org.restlet.engine.Engine.discoverConnectors(Engine.java:553) [org.restlet.jar:]
at org.restlet.engine.Engine.<init>(Engine.java:386) [org.restlet.jar:]
at org.restlet.engine.Engine.register(Engine.java:308) [org.restlet.jar:]
at org.restlet.engine.Engine.register(Engine.java:297) [org.restlet.jar:]
at org.restlet.engine.Engine.getInstance(Engine.java:206) [org.restlet.jar:]
at org.restlet.engine.Engine.getLogger(Engine.java:262) [org.restlet.jar:]
at org.restlet.Context.<init>(Context.java:167) [org.restlet.jar:]
at org.restlet.Context.<init>(Context.java:139) [org.restlet.jar:]
at org.restlet.ext.servlet.ServerServlet.createComponent(ServerServlet.java:429) [org.restlet.ext.servlet.jar:]
at org.restlet.ext.servlet.ServerServlet.getComponent(ServerServlet.java:843) [org.restlet.ext.servlet.jar:]
at org.restlet.ext.servlet.ServerServlet.init(ServerServlet.java:961) [org.restlet.ext.servlet.jar:]
at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.2.Final-redhat-1.jar:1.0.2.Final-redhat-1]
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1194) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:950) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:151) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:145) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:336) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:920) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
答案 0 :(得分:2)
根据this jira页面,您需要更新module.xml文件。
添加以下
<path name="com/sun/net/httpserver"/>
发现于:
中的module.xml文件modules\system\layers\base\sun\jdk\main
答案 1 :(得分:0)
使用JBoss7.1.1最后将<path name="com/sun/net/httpserver"/>
添加到modules \ sun \ jdk \ main解决了这个问题。