2 Replies Latest reply on Sep 6, 2013 3:02 AM by Vadivel Elayaperumal

    Issue while trying to Look-up datasource JNDI... using hibernate 3

    Vadivel Elayaperumal Newbie

      While trying to Migrate our application from jBoss AS 5 to EAP 6.0.1,

      The application implemented on hibernate-3

      It includes a EAR file and a war file deployed individually.

      The WAR hits an EJB in the EAR which inturn looksup for a XA-datasource created by jBoss EAP-6

      getting the below error while the app tries to look-up a XA-datasource using it's JNDI name.

       

      Caused by: com.velco.exception.velcoRuntimeException: Internal System Exception. Failied to load Configuration. Please see logs for more details Unable to initialize group definition. Group resource name [classpath*:beanRefContext.xml], factory key [null]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name factoryKey defined in URL [vfs:/D:/VEL/ProgramFiles/JavaAppServers/jboss-eap-6.0/bin/content/velcoETL_ee.ear/lib/spring-configuration-27.0.0.0-SNAPSHOT.jar/beanRefContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.context.support.ClassPathXmlApplicationContext]: Constructor threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name velcoETLSessionFactory defined in class path resource [applicationContext-velcoETL-dao.xml]: Cannot resolve reference to bean velcoETLDataSource while setting bean property dataSource; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name velcoETLDataSource: Post-processing of the FactoryBeans object failed; nested exception is org.aspectj.weaver.reflect.ReflectionWorld$ReflectionWorldException: warning cant determine superclass of missing type org.jboss.jca.adapters.jdbc.WrapperDataSource

      [Xlint:cantFindType]

        at com.velco.configuration.service.interceptor.SpringConfigurationInterceptor.autowireBean(SpringConfigurationInterceptor.java:60) [common-configuration-27.1.3-SNAPSHOT.jar:]

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_38]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_38]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_38]

        at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_38]

        at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:118) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [jboss-as-ejb3-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

        at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61) [jboss-invocation-1.1.1.Final-redhat-2.jar:1.1.1.Final-redhat-2]

        at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161) [jboss-as-ee-7.1.3.Final-redhat-4.jar:7.1.3.Final-redhat-4]

        ... 104 more

       

      The XA-datasource is configured in standalone-full.xml as below

       

                      <xa-datasource jndi-name="java:/velcoETLDS" pool-name="velcoETLDS" enabled="true">

                          <xa-datasource-property name="URL">

                              jdbc:oracle:thin:@localhost:1521:XE

                          </xa-datasource-property>

                          <driver>oracle</driver>

                          <xa-pool>

                              <min-pool-size>5</min-pool-size>

                              <max-pool-size>60</max-pool-size>

                              <is-same-rm-override>false</is-same-rm-override>

                              <no-tx-separate-pools>true</no-tx-separate-pools>

                          </xa-pool>

                          <security>

                              <user-name>VETL_ETL_USER</user-name>

                              <password>VETL_ETL_USER</password>

                          </security>

                          <validation>

                              <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>

                              <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"/>

                              <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>

                          </validation>

                      </xa-datasource>

                      <xa-datasource jndi-name="java:/reportDS" pool-name="aesDS" enabled="true">

                          <xa-datasource-property name="URL">

                              jdbc:oracle:thin:@localhost:1521:XE

                          </xa-datasource-property>

                          <driver>oracle</driver>

                          <xa-pool>

                              <min-pool-size>5</min-pool-size>

                              <max-pool-size>60</max-pool-size>

                              <is-same-rm-override>false</is-same-rm-override>

                              <no-tx-separate-pools>true</no-tx-separate-pools>

                          </xa-pool>

                          <security>

                              <user-name>VETL_RPT_USER</user-name>

                              <password>VETL_RPT_USER</password>

                          </security>

                          <validation>

                              <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleValidConnectionChecker"/>

                              <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleStaleConnectionChecker"/>

                              <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.oracle.OracleExceptionSorter"/>

                          </validation>

                      </xa-datasource>

       

      in Both the WAR and the EAR files... the jboss-deployment-structure.xml looks like below

       

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

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

        <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

        <deployment>

             <exclusions>

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

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

             </exclusions>

             <dependencies>

               <module name="org.jboss.ironjacamar.jdbcadapters"/>

               <module name="org.hibernate" slot="3"/>

             </dependencies>

        </deployment>

      </jboss-deployment-structure>

       

      The look-up code in applicationContext-velcoETL-dao.xml is as below

       

        <bean id="velcoETLSessionFactory"

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

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

             <property name="configLocation" value="classpath:hibernate.cfg.velcoETL.xml" />

             <property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration" />

             <property name="hibernateProperties" ref="velcoETLHibernateProperties" />

             <property name="exposeTransactionAwareSessionFactory" value="false"/>

        </bean>

       

          <jee:jndi-lookup id="velcoETLDataSource" jndi-name="java:/velcoETLDS" />

       

      Need some help/advice in resolving this error.