6 Replies Latest reply on May 29, 2009 4:23 PM by Ken McCaleb

    Getting Exception for Derby Data Source

    Alex Samueel Newbie

      I am trying to test my MDB with Derby database. I have copied getting error
      org.jboss.deployment.DeploymentException: No ClassLoaders found for: org.jboss.
      dbc.DerbyDatabase; - nested throwable: (java.lang.ClassNotFoundException: No ClassLoaders found for: org.jboss.jdbc.DerbyDatabase)

      Looks like org.jboss.jdbc.DerbyDatabase is not in my class path. Which jar file contains this class or how can i resolve this error.

        • 1. Re: Getting Exception for Derby Data Source
          Andrew Dale Newbie

          is the Derby jdbc driver in the /lib directory of the server ??



          • 2. Re: Getting Exception for Derby Data Source
            Alex Samueel Newbie

            I have copied derby.jar in /lib directory of server but it doesn't contain org.jboss.jdbc.DerbyDatabase class.

            • 3. Re: Getting Exception for Derby Data Source
              Nico Nico Newbie

              Hi Alex,

              It seems that the problem doesn't come from Derby, but from a jboss class which is not found , look at the class name : org.jboss.jdbc.DerbyDatabase

              One solution i've found to deploy the datasource is to comment out the two following lines in your -ds.xml file :

               <mbean code="org.jboss.jdbc.DerbyDatabase" name="jboss:service=Derby"/>

              Here is a sample -ds.xml file:

              <?xml version="1.0" encoding="UTF-8"?>
              <!-- The Derby embedded database JCA connection factory config
              $Id: derby-ds.xml 25345 2004-11-03 13:29:58Z loubyansky $ -->
               <!-- The jndi name of the DataSource, it is prefixed with java:/ -->
               <!-- Datasources are not available outside the virtual machine -->
               <!-- for in-process persistent db, saved when jboss stops. The
               org.jboss.jdbc.DerbyDatabase mbean is necessary for properly db shutdown -->
               <!-- The driver class -->
               <!-- The login and password -->
               <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
               <!-- The maximum connections in a pool/sub-pool -->
               <!-- The time before an unused connection is destroyed -->
               <!-- Whether to check all statements are closed when the connection is returned to the pool,
               this is a debugging feature that should be turned off in production -->
               <!-- This mbean can be used when using in process persistent derby -->
               <mbean code="org.jboss.jdbc.DerbyDatabase" name="jboss:service=Derby"/>

              PS : Does someone knows where to find that org.jboss.jdbc.DerbyDatabase class, and what it does ?

              • 4. Re: Getting Exception for Derby Data Source
                rolando Newbie

                I googled and found this site where you can dowload all the varia jars, including derby-plugin-4.0.4


                hope it helps.
                Since it is added to the server/xxx/ib the Derby NPE has gone but another problem shows up:
                13:43:31,828 INFO [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca
                :service=DataSourceBinding,name=DerbyDS' to JNDI name 'java:DerbyDS'
                13:43:32,000 WARN [ServiceController] Problem starting service jboss.mq:service
                javax.management.AttributeNotFoundException: not found: BindName
                at org.jboss.mx.server.AbstractMBeanInvoker.getAttribute(AbstractMBeanIn

                If I remove the hsqldb-ds.xml file this error goes but anohter unfriendly message shows up:

                13:47:12,656 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../dep
                13:47:12,859 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

                --- MBeans waiting for other MBeans ---
                ObjectName: jboss.ejb:service=EJBTimerService,persistencePolicy=database
                State: CONFIGURED
                I Depend On:

                ObjectName: jboss.mq:service=StateManager
                State: CONFIGURED
                I Depend On:
                Depends On Me:

                This means that it must be more config to use Derby instead of HSQLDB

                • 5. Re: Getting Exception for Derby Data Source
                  Andrew Dale Newbie


                  If you want to use Derby as the default DS you will need to do some more config (i have done this for EJBTimerService and for JMS/MDB)

                  For EJBTimerService, you will need to edit the ejb-timer-service.xml file located in the deploy directory and change the following line

                  <depends optional-attribute-name="DataSource">jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>

                  btw, you will only need to do this if your Derby datasource is called something else other than DefaultDS, but seems as you get the error i am assuming yourts is not called DefaultDS.

                  For the JMS/MDB i would suggest copying the "derby-jdbc2-service.xml" from $JBOSS_HOME/doc/examples/jms/ into deploy/jms/ and edit the datsource name as needed. Remove the hsqldb-jdbc2-service.xml and rename hsqldb-jdbc-state-service.xml to derby-jdbc-state-service.xml, and edit the datasource name if needed.



                  • 6. Re: Getting Exception for Derby Data Source
                    Ken McCaleb Newbie

                    org.jboss.jdbc.DerbyDatabase is found in derby-plugin-.jar. It is found in the varia sub-component of JBoss app server. You will need to download the source and run your own build. You might also find the jar if you search the web.