5 Replies Latest reply on Jun 12, 2012 12:39 AM by jaikiran

    How to find missing classes in JBoss 7.1.1?

    nauvil

      When running my application i get the following error:

       

       

      Could not initialize JBossNativeJdbcExtractor because JBoss API classes are not available: java.lang.ClassNotFoundException: org.jboss.resource.adapter.jdbc.WrappedConnection
      
      

       

      How is the JBoss API not available to my application when i am deployed in JBoss?  Not sure what i did to remove the containers classes or how it is even running if there are no classes on the classpath

        • 1. Re: How to find missing classes in JBoss 7.1.1?
          jaysensharma

          Hi,

           

             Looks like you are deploying some application which contains OLD JBoss5/4  jars inside it ...because the Class mentioned above "org.jboss.resource.adapter.jdbc.WrappedConnection" is not present in JBoss AS 7.1.1

              Because JBossAS7.1.1 uses ironjacamar for JDBC implementation which has it's own "WrappedConnection" class as following

           

          Class: org.jboss.jca.adapters.jdbc.WrappedConnection      Present inside: /home/userone/jboss-as-7.1.1.Final/modules/org/jboss/ironjacamar/jdbcadapters/main/ironjacamar-jdbc-1.0.9.Final.jar

           

           

             So let us know what exactly you are trying to do ? 

          1 of 1 people found this helpful
          • 2. Re: How to find missing classes in JBoss 7.1.1?
            nauvil

            Thanks for the reply Jay. I am using Spring 3.0.7 with JBoss 7.1.1 and trying to insert a CLOB into Oracle.

             

             

            ...
            <!-- NativeJdbcExtractor -->
            <bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.JBossNativeJdbcExtractor" lazy-init="true" scope="prototype"/>           
                
            <!-- LobHandler for Oracle JDBC drivers -->
            <bean id="lobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler" lazy-init="true" scope="prototype">
            <property name="nativeJdbcExtractor"><ref local="nativeJdbcExtractor"/></property>
            </bean> 
              
            <!-- LobHandler is not thread-safe so this class needs prototype scope -->
            <bean id="updateDao" class="com.mycompany.service.soap.data.UpdateDaoJdbc" scope="prototype">
            <property name="dataSource" ref="dataSourceXA" />
            <property name="lobHandler" ref="lobHandler" />
            </bean>
            ...
            

             

            My unit tests outside of JBoss work; i am using DBCP witht he nativeJdbcExtractor of: <bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.CommonsDbcpNativeJdbcExtractor" lazy-init="true" scope="prototype"/>. So i believe my code is working. Just having an issue when i run in Jboss.

            • 3. Re: How to find missing classes in JBoss 7.1.1?
              nauvil

              looking at the Spring source, even the latest 3.1.1.FINAL...

               

              ...
              
              public class JBossNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
              
                   private static final String WRAPPED_CONNECTION_NAME = "org.jboss.resource.adapter.jdbc.WrappedConnection";
                   private static final String WRAPPED_STATEMENT_NAME = "org.jboss.resource.adapter.jdbc.WrappedStatement"; 
                   private static final String WRAPPED_RESULT_SET_NAME = "org.jboss.resource.adapter.jdbc.WrappedResultSet";
              ...
              
              

               

              (Attached Spring 3.1.1.FINAL source for reference)

               

              looks like they need to update their code.  In the mean time i suppose i could implement my own JBoss7NativeJdbcExtractor.  Which i did, but now it is telling me:

               

               

              Could not initialize JBossNativeJdbcExtractor because JBoss API classes are not available: java.lang.ClassNotFoundException: org.jboss.jca.adapters.jdbc.WrappedConnection
              
              
              • 4. Re: How to find missing classes in JBoss 7.1.1?
                nauvil

                i got it working!  I cut and pasted the Spring 3.1.1 code and simply replaced the constants with the new packages as in...

                 

                 

                ...
                private static final String WRAPPED_CONNECTION_NAME = "org.jboss.jca.adapters.jdbc.WrappedConnection";
                private static final String WRAPPED_STATEMENT_NAME = "org.jboss.jca.adapters.jdbc.WrappedStatement";
                private static final String WRAPPED_RESULT_SET_NAME = "org.jboss.jca.adapters.jdbc.WrappedResultSet";
                ...
                
                

                 

                i then included a jboss-deployment-structure.xml file to include the dependency on the missing class...

                 

                 

                <jboss-deployment-structure>
                     <deployment>
                          <!-- need this for Spring CLOB along with my custom JBoss7NativeJdbcExtractor -->     
                          <dependencies>
                               <module name="org.jboss.ironjacamar.jdbcadapters" />
                          </dependencies>        
                     </deployment>
                </jboss-deployment-structure>
                
                • 5. Re: How to find missing classes in JBoss 7.1.1?
                  jaikiran

                  By the way, you should report this in the Spring forums too so that they can fix the code for AS7 integration. I however don't understand why they even need to know the JBoss specific class names.