2 Replies Latest reply on Apr 21, 2015 2:25 AM by Philippe Marschall

    Migration from websphere to jboss wildfy 8.0

    massamba mass Newbie

      Need help jboss with spring: a folder(services) under web-inf with files.xml (resources.xml,applicationContext.xml,services.xml).

      In resources.xml i have:

       

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

       

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

       

      xsi:schemaLocation="http://www.springframework.org/schema/beans

       

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

       

      <!-- TRANSACTIONS ATTIVE -->

       

      <bean id="TXMgrRef"

       

      class="org.springframework.transaction.jta.JtaTransactionManager" />

       

      <!-- ORACLE -->

       

       

       

      </bean>

       

      </beans>

       

       

      I got this error

       

      ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./Essai: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./Essai: Failed to start service

       

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]

       

      Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 's2mc' defined in ServletContext resource [/WEB-INF/config/services/Resource.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'jndiName' is required

       

      at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:216)

       

      at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:86)

       

      at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:71)

       

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]

       

      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]

       

      Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 's2mc' defined in ServletContext resource [/WEB-INF/config/services/Resource.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'jndiName' is required

       

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)

       

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)

       

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)

       

      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)

       

      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)

       

      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)

       

      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)

       

      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)

       

      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)

        • 1. Re: Migration from websphere to jboss wildfy 8.0
          massamba mass Newbie

          here is the file resource.xml

           

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

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

            xsi:schemaLocation="http://www.springframework.org/schema/beans

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

           

           

            <!-- TRANSACTIONS ATTIVE -->

            <bean id="TXMgrRef"

            class="org.springframework.transaction.jta.JtaTransactionManager" />

           

           

            <!-- ORACLE -->

            <bean class="org.springframework.jndi.JndiObjectFactoryBean" id="s2mc">

            <property name="jndiName" value="${jdbc.s2mc}" />

            </bean>

           

           

            <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">

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

            <property name="typeAliasesPackage" value="it.s2mc.be.mybatis.model" />

            <property name="configLocation" value="WEB-INF/mybatis-config.xml" />

            </bean>

           

           

            <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">

            <property name="basePackage"

            value="it.s2mc.be.mybatis.dao; it.s2mc.be.dao.custom" />

            <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory" />

            </bean>

           

            <!-- ORACLE ALEF-->

            <bean class="org.springframework.jndi.JndiObjectFactoryBean" id="alef">

            <property name="jndiName" value="${jdbc.alef}" />

            </bean>

           

           

            <bean id="sqlSessionFactory3" class="org.mybatis.spring.SqlSessionFactoryBean">

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

            <property name="typeAliasesPackage" value="it.s2mc.be.mybatis.alef.model" />

            <property name="configLocation" value="WEB-INF/mybatis-config.xml" />

            </bean>

           

           

            <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">

            <property name="basePackage"

            value="it.s2mc.be.mybatis.alef.dao; it.s2mc.be.dao.alef.custom" />

            <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory3" />

            </bean>

           

           

            <!-- ZUL -->

            <bean class="org.springframework.jndi.JndiObjectFactoryBean" id="dfr">

            <property name="jndiName" value="${jdbc.dfr}" />

            </bean>

           

           

            <bean id="sqlSessionFactory2" class="org.mybatis.spring.SqlSessionFactoryBean">

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

            <property name="typeAliasesPackage" value="it.dfr.be.mybatis.model" />

            <property name="configLocation" value="WEB-INF/mybatis-config.xml" />

            </bean>

           

           

            <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">

            <property name="basePackage" value="it.zul.dfr.be.mybatis.dao; it.zul.dfr.be.dao.custom" />

            <property name="sqlSessionFactoryBeanName" value="sqlSessionFactory2" />

            </bean>

           

           

          </beans>

          • 2. Re: Migration from websphere to jboss wildfy 8.0
            Philippe Marschall Expert

            Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 's2mc' defined in ServletContext resource [/WEB-INF/config/services/Resource.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'jndiName' is required

             

            Can it be that ${jdbc.s2mc} is null? Probably because to don't have a bean with the name "jdbc".