4 Replies Latest reply on Sep 29, 2012 4:44 PM by poor thing

    Spring module.xml

    poor thing Newbie

      Hello i have a problem deploying web app with spring to jboss 7.1.1

      modules\org\springframework\3.1.1\module.xml

      <?xml version="1.0" encoding="UTF-8"?>

      <module xmlns="urn:jboss:module:1.0" name="org.springframework" slot="3.1.1">

          <resources>

              <resource-root path="org.springframework.aop-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.asm-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.aspects-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.beans-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.context-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.context.support-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.core-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.expression-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.instrument-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.instrument.tomcat-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.jdbc-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.jms-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.orm-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.oxm-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.test-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.transaction-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.web-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.web.portlet-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.web.servlet-3.1.1.RELEASE.jar"/>

              <resource-root path="org.springframework.web.struts-3.1.1.RELEASE.jar"/>

          </resources>

       

       

          <dependencies>

              <module name="sun.jdk"/>

              <module name="org.apache.commons.logging"/>

              <module name="org.hibernate" slot="main" export="true"/>

          </dependencies>

      </module>

       

       

      in web.xml i have

      <context-param>

                          <param-name>contextConfigLocation</param-name>

                          <param-value>

                                    /WEB-INF/applicationContext.xml

                          </param-value>

                </context-param>

       

                <!-- The Bootstrap listener to start up and shut down Spring's root WebApplicationContext.

                          It is registered to Servlet Container -->

                <listener>

                          <listener-class>

                                    org.springframework.web.context.ContextLoaderListener

                          </listener-class>

                </listener>

                <listener>

                          <listener-class>

                                    org.springframework.web.context.request.RequestContextListener

                          </listener-class>

                </listener>

       

      jboss-deployment-structure.xml

       

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">

          <deployment>

                    <exclusions>

                  <module name="org.apache.log4j" />

              </exclusions>

              <dependencies>

                  <module name="org.apache.log4j" slot="standalone"/>

                                    <module name="org.apache.commons.codec"/>

                  <module name="org.springframework" slot="3.1.1">

                      <imports>

                          <include path="META-INF**"/>

                          <include path="org**"/>

                      </imports>

                  </module>

              </dependencies>

                </deployment>

      </jboss-deployment-structure>

       

       

      when i put my war to deployments:

       

      [org.jboss.modules] (MSC service thread 1-3) Failed to define class org.springframework.web.context.ContextLoaderListener in Module "org.springframework:3.1.1" from local module loader @3449a8 (roots: D:\jboss-as-7.1.1.Final\modules): java.lang.LinkageError: Failed to link org/springframework/web/context/ContextLoaderListener (Module "org.springframework:3.1.1" from local module loader @3449a8 (roots: D:\jboss-as-7.1.1.Final\modules))

                at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)

                at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

                at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

                at org.jboss.modules.Module.loadModuleClass(Module.java:517)

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_03]

                at java.lang.Class.forName(Unknown Source) [rt.jar:1.7.0_03]

                at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54)

                at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:63) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_03]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_03]

                at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_03]

      Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener

                at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_03]

                at java.lang.ClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0_03]

                at java.security.SecureClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0_03]

                at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

                at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

                ... 19 more

      Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContextListener from [Module "org.springframework:3.1.1" from local module loader @3449a8 (roots: D:\jboss-as-7.1.1.Final\modules)]

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                ... 24 more

       

       

      21:52:14,343 WARN  [org.jboss.modules] (MSC service thread 1-3) Failed to define class org.springframework.web.context.request.RequestContextListener in Module "org.springframework:3.1.1" from local module loader @3449a8 (roots: D:\jboss-as-7.1.1.Final\modules): java.lang.LinkageError: Failed to link org/springframework/web/context/request/RequestContextListener (Module "org.springframework:3.1.1" from local module loader @3449a8 (roots: D:\jboss-as-7.1.1.Final\modules))

                at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)

                at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

                at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

                at org.jboss.modules.Module.loadModuleClass(Module.java:517)

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_03]

                at java.lang.Class.forName(Unknown Source) [rt.jar:1.7.0_03]

                at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54)

                at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:63) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55) [jboss-as-ee-7.1.1.Final.jar:7.1.1.Final]

                at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_03]

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_03]

                at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_03]

      Caused by: java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener

                at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.7.0_03]

                at java.lang.ClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0_03]

                at java.security.SecureClassLoader.defineClass(Unknown Source) [rt.jar:1.7.0_03]

                at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

                at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

                ... 19 more

      Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletRequestListener from [Module "org.springframework:3.1.1" from local module loader @3449a8 (roots: D:\jboss-as-7.1.1.Final\modules)]

                at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                ... 24 more

       

      Could anyone please help me

        • 1. Re: Spring module.xml
          Tomaz Cerar Master

          Hi,

           

          you are missing few dependancies in your spring module.

           

          <module name="javax.api"/>

          <module name="javax.enterprise.api" />

           

           

          --

          tomaz

          • 2. Re: Spring module.xml
            poor thing Newbie

            Did nothing unfortunately

             

            java.lang.NoClassDefFoundError: javax/servlet/ServletRequestListener

            • 3. Re: Spring module.xml
              Tomaz Cerar Master

              then also add javax.servlet.api, javax.servlet.jsp.api, javax.servlet.jstl.api

              1 of 1 people found this helpful
              • 4. Re: Spring module.xml
                poor thing Newbie

                Thank you, Tomaz, javax.servlet.api moved me a little bit further, but now i got problem with c3p0 dependency.

                modules\com\c3p0\main

                 

                <?xml version="1.0" encoding="UTF-8"?>

                <module xmlns="urn:jboss:module:1.1" name="com.c3p0">

                    <resources>

                        <resource-root path="c3p0-0.9.1.2.jar"/>

                    </resources>

                </module>

                 

                 

                jboss deployment xml:

                 

                <module name="com.c3p0" >

                                <imports>

                                    <include path="META-INF**" />

                                    <include path="com**" />

                                </imports>

                </module>

                 

                java.lang.ClassNotFoundException: com.mchange.v2.c3p0.ComboPooledDataSource from [Module "deployment.net.mycompany.myproject.war:main" from Service Module Loader]

                 

                Could you, please, help me to solve this issue, if not much to ask.