6 Replies Latest reply on Aug 20, 2002 2:45 PM by alexb

    Failed to register driver for: com.sybase.jdbc2.jdbc.SybDriv

    nikoleta

      Hello everyone!
      I'm trying to use JBoss 3.0.0 with Sybase 12.5
      I put the jconn2.jar(where the Sybase drivers are) in the server/defailt/lib directory,
      in fact I put the jconn2.jar in every possible lib directory that I saw within Jboss,
      but when I try to deploy my EAR application I get this exception:

      11:38:58,847 INFO [MainDeployer] Starting deployment of package: file:/D:/jboss/server/default/deploy/Oktabit.ear
      11:38:58,857 INFO [EARDeployer] Init J2EE application: file:/D:/jboss/server/default/deploy/Oktabit.ear
      11:39:04,204 INFO [EjbModule] Creating
      11:39:04,225 INFO [EjbModule] Deploying User
      11:39:04,795 INFO [EjbModule] Deploying UserRegister
      11:39:04,986 INFO [EjbModule] Deploying UserLogin
      11:39:05,336 INFO [EjbModule] Remove JSR-77 EJB Module: jboss.management.single:J2EEApplication=Oktabit.ear,J2EEServer=Single,j2eeType=EJBModule,name=user.jar
      11:39:05,336 ERROR [EjbModule] Initialization failed
      org.jboss.deployment.DeploymentException:
      Error while fixing table name; - nested throwable: (org.jboss.util.NestedSQLException: Failed to register driver for:
      com.sybase.jdbc2.jdbc.SybDriver
      ; - nested throwable: (java.lang.ClassNotFoundException:
      com.sybase.jdbc2.jdbc.SybDriver
      ); - nested throwable: (org.jboss.resource.ResourceException: Failed to register driver for:
      com.sybase.jdbc2.jdbc.SybDriver
      ; - nested throwable: (java.lang.ClassNotFoundException:
      com.sybase.jdbc2.jdbc.SybDriver
      )))


      Can anyone tell me where is the problem?
      I'll appreciate any help a lot!

      Nikoleta

        • 1. Re: Failed to register driver for: com.sybase.jdbc2.jdbc.Syb
          alexb

          I'm working on the same thing I found an example of a deployment xml for sybase maybe this will help.

          • 2. Re: Failed to register driver for: com.sybase.jdbc2.jdbc.Syb
            nikoleta

            Thanks!
            I found that xml file earlier when I struggled with the datasource configuration. I think I finally succeeded.
            It seems to me that the problem is somewhere else, maybe classpath...,
            although I've set it and I put the driver classes where they should be.

            • 3. Re: Failed to register driver for: com.sybase.jdbc2.jdbc.Syb
              nikoleta

              I found it at last!!!
              For all that you want to know the clue to my problem here it is:

              Do not ever write *-service.xml like that:

              <config-property name="DriverClass" type="java.lang.String">
              com.sybase.jdbc2.jdbc.SybDriver
              </config-property>
              (on different rows)

              I think that the parser or God knows what takes the String for the driver class name together with the hidden symbols like carriage return or tabulation.

              Write it that way:

              <config-property name="DriverClass" type="java.lang.String">com.sybase.jdbc2.jdbc.SybDriver</config-property>

              //everything on the same row

              I hope that will help the rest having those exception!

              Here is my sybase-service.xml file

              • 4. Re: Failed to register driver for: com.sybase.jdbc2.jdbc.Syb
                nikoleta

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

                <!-- ===================================================================== -->
                <!-- -->
                <!-- JBoss Server Configuration -->
                <!-- -->
                <!-- ===================================================================== -->



                <!-- ======================================================================-->
                <!-- New ConnectionManager setup for Sybase ASE/ASA jConnect driver -->
                <!-- Build jmx-api (build/build.sh all) and view for config documentation -->
                <!-- ===================================================================== -->
                <!--classpath ARCHIVE="jconn2.jar" CODEBASE="../lib/" /-->



                <!--uncomment out this line if you are using the SybaseDSRealm above
                SybaseDbRealm
                -->

                <depends optional-attribute-name="ManagedConnectionFactoryName">
                <!--embedded mbean-->


                SybaseDB



                <!-- The Sybase jConnect URL for the database.
                NOTE: The hostname and port of made up values. The optional
                database name is provided, as well as some additinal Driver
                parameters.
                -->
                <config-property name="ConnectionURL" type="java.lang.String">
                jdbc:sybase:Tds:Mila:5200/oktabit
                </config-property>
                <config-property name="DriverClass" type="java.lang.String">com.sybase.jdbc2.jdbc.SybDriver</config-property>
                <config-property name="UserName" type="java.lang.String">admin</config-property>
                <config-property name="Password" type="java.lang.String">admin</config-property>



                <!--Below here are advanced properties -->
                <!--hack-->
                <depends optional-attribute-name="OldRarDeployment">
                jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper




                <depends optional-attribute-name="ManagedConnectionPool">
                <!--embedded mbean-->


                0
                10
                5000
                15
                ByContainer



                <depends optional-attribute-name="CachedConnectionManager">
                jboss.jca:service=CachedConnectionManager


                <depends optional-attribute-name="JaasSecurityManagerService">
                jboss.security:name=JaasSecurityManager


                java:/TransactionManager

                <!--make the rar deploy! hack till better deployment-->
                jboss.jca:service=RARDeployer




                • 5. Re: Failed to register driver for: com.sybase.jdbc2.jdbc.Syb
                  alexb

                  I was wondering at the line
                  &lt;config-property name="ConnectionURL" type="java.lang.String"&gt;jdbc:sybase:Tds:light:2110/oktabit&lt;/config-property&gt;

                  Is oktabit the database name

                  • 6. Re: Failed to register driver for: com.sybase.jdbc2.jdbc.Syb
                    alexb

                    I was wondering at the line
                    <config-property name="ConnectionURL" type="java.lang.String">jdbc:sybase:Tds:light:2110/oktabit</config-property>

                    Is oktabit the database name.

                    thanks