引起:java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener?

问题描述 投票:0回答:1

我已经为春季罐子创建了模块并将我的所有罐子放入其中。但我得到:引起:java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener

如果我在/ WEB-INF / lib中添加所有弹簧罐,那么一切正常。我的module.xml:

<module xmlns="urn:jboss:module:1.3" name="org.springframework.spring">
<resources>
    <resource-root path="spring-aop-3.0.3.RELEASE.jar"/>
    <resource-root path="org.springframework.expression-3.0.3.RELEASE.jar"/>
    <resource-root path="org.springframework.instrument-3.0.3.release.jar"/>
    <resource-root path="org.springframework.web.servlet-3.0.3.RELEASE.jar"/>
    <resource-root path="spring-asm-3.0.3.RELEASE.jar"/>
    <resource-root path="spring-aspects-3.0.3.RELEASE.jar"/>
    <resource-root path="spring-beans-3.0.3.RELEASE.jar"/>
    <resource-root path="spring-context-3.0.3.RELEASE.jar"/>
    <resource-root path="spring-context-support-3.0.3.RELEASE.jar"/>
    <resource-root path="spring-core-3.0.3.RELEASE.jar"/>
    <resource-root path="spring-jdbc-3.0.3.RELEASE.jar"/>
    <resource-root path="spring-tx-3.0.3.RELEASE.jar"/>
    <resource-root path="spring-web-3.0.3.RELEASE.jar"/>
    <resource-root path="spring-webmvc-3.0.3.RELEASE.jar"/>
    <resource-root path="spring-webmvc-portlet-3.0.3.RELEASE.jar"/>
    <resource-root path="spring-jms-3.0.3.RELEASE.jar"/>
    <resource-root path="spring-oxm-3.0.3.RELEASE.jar"/>
    <resource-root path="spring-orm-3.0.3.RELEASE.jar"/>
</resources>
<dependencies>
    <module name="org.apache.commons.logging"/>
    <module name="javax.api" export="true"/>
    <module name="org.jboss.vfs"/> 
  </dependencies>
</module>

堆栈跟踪:

20:30:55,656 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 60) AMQ221007: Server is now live
20:30:55,656 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 60) AMQ221001: Apache ActiveMQ Artemis Message Broker version 1.1.0.SP16-redhat-1 [nodeID=f4c08abc-c9d7-11e7-bff9-9555d5330950] 
20:30:55,679 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."CAWMobileAPI.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."CAWMobileAPI.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "CAWMobileAPI.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module "deployment.CAWMobileAPI.war:main" from Service Module Loader]
    at org.jboss.as.jaxrs.deployment.JaxrsComponentDeployer.deploy(JaxrsComponentDeployer.java:89)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
    ... 5 more
Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module "deployment.CAWMobileAPI.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
    at org.jboss.as.jaxrs.deployment.JaxrsComponentDeployer.deploy(JaxrsComponentDeployer.java:87)
    ... 6 more

20:30:55,717 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 60) AMQ221003: trying to deploy queue jms.queue.queue/emailQueue
20:30:55,845 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 69) AMQ221003: trying to deploy queue jms.queue.queue/orderTransitQueue
20:30:55,855 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-4) WFLYJCA0007: Registered connection factory java:/JmsXA
20:30:55,882 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 68) AMQ221003: trying to deploy queue jms.queue.DLQ
20:30:55,941 INFO  [org.wildfly.extension.messaging-activemq] (ServerService Thread Pool -- 67) WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
20:30:56,000 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 70) AMQ221003: trying to deploy queue jms.queue.queue/pendingOrderQueue
20:30:56,001 INFO  [org.apache.activemq.artemis.ra] (MSC service thread 1-4) Resource adaptor started
20:30:56,001 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 64) AMQ221003: trying to deploy queue jms.queue.queue/orderQueue
20:30:56,002 INFO  [org.jboss.as.connector.services.resourceadapters.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-4) IJ020002: Deployed: file://RaActivatoractivemq-ra
20:30:56,015 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-4) WFLYJCA0002: Bound JCA ConnectionFactory [java:/JmsXA]
20:30:56,016 INFO  [org.wildfly.extension.messaging-activemq] (MSC service thread 1-4) WFLYMSGAMQ0002: Bound messaging object to jndi name java:jboss/DefaultJMSConnectionFactory
20:30:56,017 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 66) AMQ221003: trying to deploy queue jms.queue.queue/faxQueue
20:30:56,018 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 62) AMQ221003: trying to deploy queue jms.queue.queue/customerForgetPwdQueue
20:30:56,023 INFO  [org.wildfly.extension.messaging-activemq] (ServerService Thread Pool -- 63) WFLYMSGAMQ0002: Bound messaging object to jndi name java:/ConnectionFactory
20:30:56,024 INFO  [org.apache.activemq.artemis.core.server] (ServerService Thread Pool -- 65) AMQ221003: trying to deploy queue jms.queue.ExpiryQueue
20:30:56,257 INFO  [org.wildfly.extension.undertow] (ServerService Thread Pool -- 61) WFLYUT0021: Registered web context: /blazeds
20:30:56,263 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "CAWMobileAPI.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"CAWMobileAPI.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"CAWMobileAPI.war\".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"CAWMobileAPI.war\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module \"deployment.CAWMobileAPI.war:main\" from Service Module Loader]
    Caused by: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener from [Module \"deployment.CAWMobileAPI.war:main\" from Service Module Loader]"}}
20:30:56,330 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 36) WFLYSRV0010: Deployed "CAWMobileAPI.war" (runtime-name : "CAWMobileAPI.war")
20:30:56,330 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 36) WFLYSRV0010: Deployed "blazeds.war" (runtime-name : "blazeds.war")
20:30:56,378 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."CAWMobileAPI.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."CAWMobileAPI.war".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment "CAWMobileAPI.war"

20:30:56,542 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
20:30:56,543 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
20:30:56,543 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: JBoss EAP 7.0.0.GA (WildFly Core 2.1.2.Final-redhat-1) started (with errors) in 9682ms - Started 395 of 687 services (1 services failed or missing dependencies, 409 services are lazy, passive or on-demand)
20:30:56,626 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) WFLYSRV0028: Stopped deployment CAWMobileAPI.war (runtime-name: CAWMobileAPI.war) in 47ms
20:30:56,702 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 1) WFLYSRV0009: Undeployed "CAWMobileAPI.war" (runtime-name: "CAWMobileAPI.war")
20:30:56,704 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.unit."CAWMobileAPI.war".POST_MODULE

20:31:01,560 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) WFLYDS0004: Found CAWMobileAPI.war in deployment directory. To trigger deployment create a file called CAWMobileAPI.war.dodeploy

提前致谢

jboss jboss7.x spring-3
1个回答
0
投票

确保war文件中没有不同版本的重复jar文件。展开war文件并查看。

© www.soinside.com 2019 - 2024. All rights reserved.