我正在Wildfly 9上部署我的war文件
我得到了异常,这很奇怪。
17:40:27,952 ERROR [io.undertow.request](默认任务-7)UT005023: 对/DirectRegistry/index.htm的异常处理请求: org.springframework.web.util.NestedServletException:处理程序 加工辉;嵌套异常是 java.lang.NoClassDefFoundError:javax / servlet / ServletInputStream 在org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:860) 在org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:755) 在org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:396) 在org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:350) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:687) 在javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86) 在io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51) at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56) at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:72) at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50) at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) 在org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:282) at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:261) at io.undertow.servlet.handlers.ServletInitialHandler.access $ 000(ServletInitialHandler.java:80) at io.undertow.servlet.handlers.ServletInitialHandler $ 1.handleRequest(ServletInitialHandler.java:172) at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199) 在io.undertow.server.HttpServerExchange $ 1.run(HttpServerExchange.java:774) 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:722)引起:java.lang.NoClassDefFoundError:javax / servlet / ServletInputStream 在org.springframework.web.multipart.commons.CommonsMultipartResolver.isMultipart(CommonsMultipartResolver.java:110) 在org.springframework.web.servlet.DispatcherServlet.checkMultipart(DispatcherServlet.java:937) 在org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:797) ......还有34个
引起:java.lang.ClassNotFoundException:来自[Module]的javax.servlet.ServletInputStream> " org.apache.commons-文件上传:主"来自本地模块加载器 @ 6c3a6465(finder:本地模块查找器@ 6d955a6 5(根: C:\ JAVA \ WF9 \ wildfly-9.0.0.Final \模块,C:\ JAVA \ WF9 \ wildfly-9.0.0.Final \模块\ SYSTEM \层\基))] 在org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:205) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:455) 在org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:404) 在org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:385) 在org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:130) ......还有37个
我的jboss部署结构:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<!--
we want to use the saaj module provided by JBoss
it looks like we can't use the implementation provided by the JDK - JBoss somehow does not seem to allow it
-->
<module name="com.sun.xml.messaging.saaj" />
<module name="javax.servlet.api"/>
<module name="com.gbst.directregistry.configuration" />
<module name="com.gbst.directregistry.hypersonic" />
<module name="org.apache.commons-fileupload"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
service / layers / ...中的javax.servlet.api就在它所在的位置,我看到该类位于那里。
org.apache.commons-fileupload是我自己包含一个类来解决问题的时候我有这个:
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
似乎这个CommonsMultipartResolver使用:org.apache.commons.fileupload.FileUpload,它在system / layer / .. libs中找不到,所以我在module \ org \ apache \ commons-fileupload中添加了我自己的lib。每当我尝试调用我的网址时,它会抛出上面的错误。为什么WF尝试在org.apache.commons-fileupload中找到ServletInputStream,即使它已经存在于WF System / layers / libs中,即使它位于javax.servlet.api中。这是WF的基础库,所以这些应该优先 至于commons-fileupload.jar,它没有任何Javax包。所以我不确定为什么要调查这个罐子。
欣赏任何见解。