2 Replies Latest reply on Nov 21, 2011 10:46 PM by mlw5415

    JBoss AS 7 - trouble with Spring application deploying

    sigthor

      I try to deploy Spring application on JBoss AS 7, but unfortunately this error occures while deploying:

       

      ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/pasmatri]] (MSC service thread 1-3) Servlet /pasmatri threw load() exception: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/jee]

      Spring jars are placed in module directory under org/springframework/main slot. The content of module.xml:

       

       

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

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

       

          <resources>

              <resource-root path="aopalliance-1.0.jar"/>

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

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

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

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

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

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

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

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

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

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

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

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

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

          </resources>

         

          <dependencies>

              <module name="javax.api"/>

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

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

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

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

          </dependencies>

      </module>

      Within WAR that external dependency is defined in MANIFEST.MF:

       

       

      Manifest-Version: 1.0

      Dependencies: org.jdom, org.apache.log4j, org.apache.commons.logging, org.hibernate, org.springframework

       

      In case of placing spring jars into WEB-INF/lib all works ok, but as jboss module it doesn't work.

       

      The content of spring-context.xml

       

       

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

      <beans xmlns="http://www.springframework.org/schema/beans"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xmlns:aop="http://www.springframework.org/schema/aop"

          xmlns:tx="http://www.springframework.org/schema/tx"

          xmlns:jee="http://www.springframework.org/schema/jee"

          xsi:schemaLocation="

             http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

             http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd

             http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd

             http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">

         

       

       

       

       

          <jee:jndi-lookup id="domDataSource" jndi-name="java:PasmatriDS"/>

        

       

          <bean id="domSessionFactory"

              class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">

              <property name="dataSource" ref="domDataSource" />

              <property name="mappingResources">

                  <list>

                      <value>com/turkevych/pasmatri/gwt/server/resources/Dom.hbm.xml</value>

                  </list>

              </property>

              <property name="hibernateProperties">

                  <props>

                      <prop key="hibernate.dialect">

                          org.hibernate.dialect.MySQLInnoDBDialect

                      </prop>

                      <prop key="hibernate.cache.use_second_level_cache">

                          true

                      </prop>

                      <prop key="hibernate.show_sql">false</prop>

                      <prop key="hibernate.connection.autocommit">false</prop>

                      <prop key="hibernate.hbm2ddl.auto">update</prop>

                  </props>

              </property>

          </bean>

         

         

       

         

       

          <bean id="domTransactionManager"

              class="org.springframework.orm.hibernate3.HibernateTransactionManager">

              <property name="sessionFactory" ref="domSessionFactory" />

          </bean>

         

         

         

         

         

         

      </beans>