0

I am creation project for Routing Data Source by using Abstract Routing Data Source . While deploying in wildfly jboss , Getting Following error , My bean is not crating , showing exception while crating Session Factory .

"{\"JBAS014671: Failed services\" => {\"jboss.undertow.deployment.default-server.default-host./Final_login_details\" => \"org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./Final_login_details: Failed to start service Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.StackOverflowError Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.StackOverflowError Caused by: java.lang.StackOverflowError\"}}"

configuration file :-

<bean id="propertyConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
          p:location="/WEB-INF/jdbc.properties"/>

    <bean id="dataSource" class="com.rss.setting.RoutingDataSource">  
 <property name="targetDataSources">
   <map key-type="com.rss.setting.DbType">
     <entry key="MASTERS" value-ref="dataSourceMaster"/>
     <entry key="TARIFF" value-ref="dataSourceTariff"/>     
     <entry key="SETTING" value-ref="dataSourceSetting"/>
   </map>
 </property>
 <property name="defaultTargetDataSource" ref="dataSourceMaster"/>
</bean>

<bean id="dataSourceMaster" class="org.apache.commons.dbcp.BasicDataSource">  
    <property name="url" value="${jdbc.url}" /> 
    <property name="username" value="${jdbc.username}"/> 
    <property name="password" value="${jdbc.password}"/>   
</bean> 
<bean id="dataSourceTariff" class="org.apache.commons.dbcp.BasicDataSource">  
    <property name="url" value="${jdbc.url}" /> 
    <property name="username" value="${jdbc.usernameTarif}"/> 
    <property name="password" value="${jdbc.passwordTarif}"/>    
</bean> 

<bean id="dataSourceSetting" class="org.apache.commons.dbcp.BasicDataSource">  
    <property name="url" value="${jdbc.url}" /> 
    <property name="username" value="${jdbc.usernameSetting}"/> 
    <property name="password" value="${jdbc.passwordSetting}"/>     
</bean> 

 <context:property-placeholder location="/WEB-INF/jdbc.properties"/>

    <bean id="sessionFactory"
     class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">

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



    <property name="hibernateProperties">
       <props>
         <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop>
           <prop key="hibernate.show_sql">false</prop>
       <prop key="hibernate.hbm2ddl.auto">update</prop> 
            <prop key="format_sql">true</prop>

       </props>
    </property>
    </bean>

Please assist me , my bean is not able to create . I am not able to trace the error . Thanks Rohit

1
  • Welcome to stack overflow please read stackoverflow.com/help/how-to-ask and then improve your question. For starters add the full stack trace instead of a snippet. Commented Apr 7, 2016 at 18:05

1 Answer 1

0

Bean Crated Success fully . It was coming because my bean was referring null value "com.rss.setting.RoutingDataSource" in this class

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.