3 Replies Latest reply on Jul 11, 2011 12:40 PM by tomgrannan

    Recieving ClassNotFoundException with sqljdbc4.jar using JBoss 6

    tomgrannan

      I hope someone can help.  I am deploying an EAR file to JBoss 6.  If I use eclipse the project starts successfully. If I deploy outside of eclipse (i.e. place .ear in the deploy directory) I receive the following message:

       

      ERROR:

        Deployment "vfs:///C:/work/jboss-6.0.0.Final_LocalCopy/jboss-6.0.0.Final/server/default/deploy/NapersoftCCM_JBOSS60_EAR.ear" is in error due to the following reason(s): java.lang.ClassNotFoundException: sqljdbc4.jar.com.microsoft.sqlserver.jdbc.XAReturnValue

       

      The sqljdbc4.jar file is located in the ..\jboss-6.0.0.Final\server\default\lib directory.

       

      I have attached the server.log if needed.

       

      Thanks, Tom

        • 1. Re: Recieving ClassNotFoundException with sqljdbc4.jar using JBoss 6
          alesj

            Deployment "vfs:///C:/work/jboss-6.0.0.Final_LocalCopy/jboss-6.0.0.Final/server/default/deploy/NapersoftCCM_JBOSS60_EAR.ear" is in error due to the following reason(s): java.lang.ClassNotFoundException: sqljdbc4.jar.com.microsoft.sqlserver.jdbc.XAReturnValue

          What is trying to lookup this class with the wrong name?

          • 2. Re: Recieving ClassNotFoundException with sqljdbc4.jar using JBoss 6
            tomgrannan

            I presume the JBOSS connection manager.  The software requests a connection to a Microsoft SQL Server 2008 database.  the datasource file located inthe deploy directory looks as follows:

             

            <datasources>

             

              <xa-datasource>

                <jndi-name>NapersoftRepository</jndi-name>

             

                <track-connection-by-tx/>

                <isSameRM-override-value>false</isSameRM-override-value>

             

                <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>

             

                <xa-datasource-property name="ServerName">w7-w520-tgranna</xa-datasource-property>

                <xa-datasource-property name="DatabaseName">NapersoftRepository_R70</xa-datasource-property>

                <xa-datasource-property name="SelectMethod">cursor</xa-datasource-property>

                <xa-datasource-property name="User">sa</xa-datasource-property>

                <xa-datasource-property name="Password">naper123</xa-datasource-property>

               

                <transaction-isolation>TRANSACTION_SERIALIZABLE</transaction-isolation>

             

                <!-- pooling parameters -->

                <min-pool-size>25</min-pool-size>

                <max-pool-size>50</max-pool-size>

                <blocking-timeout-millis>5000</blocking-timeout-millis>

                <idle-timeout-minutes>15</idle-timeout-minutes>

               

                <!-- sql to call when connection is created -->

                <new-connection-sql>select 1</new-connection-sql>

                <!-- sql to call on an existing pooled connection when it is obtained from pool -->

                <check-valid-connection-sql>select 1</check-valid-connection-sql>

               

                <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

                <metadata>

                <type-mapping>MS SQLSERVER2000</type-mapping>

                </metadata>

              </xa-datasource>

            </datasources>

             

            I will log the full exception in the next post.

             

            But note, deployment works fine if I use Eclipse to deploy the EAR file. If everything else remains the same (i.e. datasources) and I the only change I make is to place the EAR file directly into the deploy directory (i.e. outside of eclipse) and start JBoss the problem occurs.

             

            I did see and old post where someone detected jar files where not being loaded from the lib directory.  The post indicated it was a bug and a fix was checked in, but How can I determine if the fix is part of the JBoss 6.0.0.Final download. Or, should I get a copy from the latest build and test?

             

            Thanks, Tom

            • 3. Re: Recieving ClassNotFoundException with sqljdbc4.jar using JBoss 6
              tomgrannan

              DEPLOYMENTS IN ERROR:

                Deployment "vfs:///C:/work/jboss-6.0.0.Final_LocalCopy/jboss-6.0.0.Final/server/default/deploy/NapersoftCCM_JBOSS60_EAR.ear" is in error due to the following reason(s): java.lang.ClassNotFoundException: sqljdbc4.jar.com.microsoft.sqlserver.jdbc.XAReturnValue

               

                  at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1228) [:2.2.0.GA]

                  at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:905) [:2.2.0.GA]

                  at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:87) [:6.0.0.Final]

                  at org.jboss.profileservice.deployment.ProfileDeployerPluginRegistry.checkAllComplete(ProfileDeployerPluginRegistry.java:107) [:0.2.2]

                  at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:135) [:6.0.0.Final]

                  at org.jboss.system.server.profileservice.bootstrap.BasicProfileServiceBootstrap.start(BasicProfileServiceBootstrap.java:56) [:6.0.0.Final]

                  at org.jboss.bootstrap.impl.base.server.AbstractServer.startBootstraps(AbstractServer.java:827) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

                  at org.jboss.bootstrap.impl.base.server.AbstractServer$StartServerTask.run(AbstractServer.java:417) [jboss-bootstrap-impl-base.jar:2.1.0-alpha-5]

                  at java.lang.Thread.run(Unknown Source) [:1.6.0_25]