5 Replies Latest reply on Apr 24, 2002 12:54 PM by Pete Luellen

    JBOSS3.0.0RC1 and DB2 database

    lairi Newbie

      Hi,

      Where and how to configure the DB2 database support by jboss3.0.0rc1.


      This is my db2-service.xml file used in deploy directory:

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

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



      <!-- ==================================================================== -->
      <!-- New ConnectionManager setup for default DB2 dbs -->
      <!-- ==================================================================== -->


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


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

      <!--hack-->
      <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter
      jboss:service=DB2

      <!--real attributes-->


      <config-property>
      <config-property-name>ConnectionURL</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>jdbc:db2:THESAUML</config-property-value>
      </config-property>
      <config-property>
      <config-property-name>DriverClass</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>COM.ibm.db2.jdbc.app.DB2Driver</config-property-value>
      </config-property>
      <config-property>
      <config-property-name>UserName</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value></config-property-value>
      </config-property>
      <config-property>
      <config-property-name>Password</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value></config-property-value>
      </config-property>


      DB2


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


      0
      50
      5000
      15
      <!--criteria indicates if Subject (from security domain) or app supplied
      parameters (such as from getConnection(user, pw)) are used to distinguish
      connections in the pool. Choices are
      ByContainerAndApplication (use both),
      ByContainer (use Subject),
      ByApplication (use app supplied params only),
      ByNothing (all connections are equivalent, usually if adapter supports
      reauthentication)-->
      ByContainer


      <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
      java:/jaas/HsqlDbRealm
      java:/TransactionManager





      This is the Log server message:
      -------------------------------

      org.jboss.deployment.DeploymentException: Error: can't find data source: java:/DB2; - nested throwable is: javax.naming.NameNotFoundException: DB2 not bound
      javax.naming.NameNotFoundException: DB2 not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:365)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.(JDBCEntityBridge.java:96)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.create(JDBCStoreManager.java:333)
      at org.jboss.ejb.plugins.CMPPersistenceManager.create(CMPPersistenceManager.java:155)
      at org.jboss.ejb.EntityContainer.create(EntityContainer.java:337)
      at org.jboss.ejb.Container.invoke(Container.java:790)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
      at $Proxy0.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:271)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy15.create(Unknown Source)
      at org.jboss.ejb.EjbModule.createService(EjbModule.java:381)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:134)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
      at $Proxy0.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:271)
      at org.jboss.system.ServiceController.create(ServiceController.java:211)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy5.create(Unknown Source)
      at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:376)
      at org.jboss.deployment.MainDeployer.create(MainDeployer.java:626)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:506)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy4.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:350)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:530)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:410)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:237)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:162)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:867)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:341)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy3.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:281)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:665)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:507)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:470)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:452)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:492)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:320)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:218)
      at org.jboss.Main.boot(Main.java:142)
      at org.jboss.Main$1.run(Main.java:375)
      at java.lang.Thread.run(Thread.java:484)


      Thanks

        • 1. Re: JBOSS3.0.0RC1 and DB2 database
          Ian Macey Newbie


          Just had the same problem going to RC1, though with an oracle-service.xml file. Have a look at http://main.jboss.org/thread.jsp?forum=46&thread=13033

          The example files should show you how to adapt your existing db2-service.xml.

          • 2. Re: JBOSS3.0.0RC1 and DB2 database
            Darko Mulej Newbie

            It seems to work if one takes oracle-service.xml as template for DB2. Nevertheless there's still a problem: it creates a table in DB2, but it fails, when I want to create a new bean. It seems to me we have logging problems ?!
            after line
            home.create("1", "VEN")
            I've got this error message :


            Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/logging/Log
            ger
            at org.jboss.invocation.MarshalledValueInputStream.(MarshalledVa
            lueInputStream.java:25)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Class.java:115)
            at org.jboss.invocation.MarshalledValueOutputStream.class$(MarshalledVal
            ueOutputStream.java:23)
            at org.jboss.invocation.MarshalledValueOutputStream.(MarshalledV
            alueOutputStream.java:25)
            at org.jboss.invocation.MarshalledValue.(MarshalledValue.java:47)
            at org.jboss.invocation.MarshalledInvocation.writeExternal(MarshalledInv
            ocation.java:317)
            at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:1167)

            at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:361)
            at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:263)
            at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
            at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Sour
            ce)
            at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvo
            kerProxy.java:128)
            at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.jav
            a:108)
            at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.
            java:73)
            at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:7
            6)
            at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:185)
            at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:96)
            at $Proxy0.create(Unknown Source)
            at examples.AccountClient.main(Unknown Source)

            • 3. Re: JBOSS3.0.0RC1 and DB2 database
              Ian Macey Newbie

              That's just a classpath problem. With RC1 you need to add:

              ${JBOSS_HOME}/lib/jboss-common.jar

              and:

              ${JBOSS_HOME}/lib/log4j.jar

              to your previous 'beta' classpath.

              • 4. Re: JBOSS3.0.0RC1 and DB2 database
                Darko Mulej Newbie

                Classpath problem it was.
                ThankYou!

                • 5. Re: JBOSS3.0.0RC1 and DB2 database
                  Pete Luellen Newbie

                  snowghost,

                  I'm having the same problem (java.lang.NoClassDefFoundError: org/jboss/logging/Logger) when trying to run the CMP-CD example against my DB2 sample database.

                  What do you mean by "beta" classpath?

                  Thanks for your help.