4 Replies Latest reply on Feb 3, 2002 11:14 PM by java_developer

    JBoss3.0 Demo program question.

    garymarsh

      Hi,
      I installed Jboss3.0alph and ran the ant test program and it ran fine. I wanted to test it against my
      database, ms sqlserver instead of hypersonic so I created a mssql-service.xml like so:




      <!-- ====================================================================-->
      <!-- JDBC - Initialize the databases -->
      <!-- to ConnectionFactoryLoader -->
      <!-- ====================================================================-->


      ConnectionURL=jdbc:AvenirDriver://localhost:1433/commerce;uid=gary;pwd=garygary
      DriverClass=net.avenir.jdbc2.Driver

      MSSQL2000DS
      java:/TransactionManager

      <mbean-ref>JBOSS-SYSTEM:service=MSSQL2000</mbean-ref>


      <mbean-ref optional-attribute-name="ResourceAdapterName">JCA:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter</mbean-ref>
      <mbean-ref optional-attribute-name="ConnectionManagerFactoryLoaderName">JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory</mbean-ref>
      #
      #Wed Aug 15 16:17:29 EDT 2001
      BlockingTimeoutMillis=50000
      IdleTimeoutMinutes=30
      MaxSize=10
      CleanupIntervalMinutes=10
      MinSize=0
      MaxIdleTimeoutPercent=1.0


      org.jboss.resource.security.ManyToOnePrincipalMapping

      userName=gary
      password=gary


      ================

      I have installed Avenir's 2.5 JDBC Connection Driver;

      I startup JBoss and the following error occurs:

      [16:21:32,277,ContainerFactory] Could not deploy file:/D:/jboss-3.0.0alpha/deploy/Default/cmp2-example.ear
      org.jboss.ejb.DeploymentException: Error: can't find data source: java:/MSSQL2000DS
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.init(JDBCStoreManager.java:113)
      at org.jboss.ejb.plugins.CMPPersistenceManager.init(CMPPersistenceManager.java:141)
      at org.jboss.ejb.EntityContainer.init(EntityContainer.java:313)
      at org.jboss.ejb.Application.start(Application.java:201)
      at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:382)
      at org.jboss.ejb.ContainerFactory.deploy(ContainerFactory.java:308)
      at java.lang.reflect.Method.invoke(Native Method)

      ====================

      The mssqlds-service.xml file was put in the deploy directory and as far as I can tell it is nearly a straight copy of the example in the documentation for the Avenir Driver.

      Why can't JBoss find the Datasource MSSQL2000DS that was defined in the mssqlds-service.xml file?

      Gary

        • 1. Re: JBoss3.0 Demo program question.
          davidjencks

          It is possible that the cmp2 ear is being deployed before the connection factory loader. Look in the server log or, more easily, take the cmp2 app out of the deploy folder, start jboss, and put it back in.

          If this doesn't work, check jndiview to check it is bound, and look for and report errors in the startup log from the ConnectionFactoryLoader deployment.

          • 2. Re: JBoss3.0 Demo program question.
            garymarsh

            David;

            I did as you suggested and removed the cmp2.ear from
            the deploy directory and started JBoss. The following
            is a clip from the log:

            [2002-01-11 19:35:34,238,ServiceDeployer,DEBUG] deploying with ServiceController mbean

            ConnectionURL=jdbc:AvenirDriver://localhost:1433/commerce;uid=gary;pwd=garygary
            DriverClass=net.avenir.jdbc2.Driver

            MSSQL2000DS
            java:/TransactionManager

            <mbean-ref>JBOSS-SYSTEM:service=MSSQL2000</mbean-ref>


            <mbean-ref optional-attribute-name="ResourceAdapterName">JCA:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter</mbean-ref>
            <mbean-ref optional-attribute-name="ConnectionManagerFactoryLoaderName">JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory</mbean-ref>
            #
            #Wed Aug 15 16:17:29 EDT 2001
            BlockingTimeoutMillis=50000
            IdleTimeoutMinutes=30
            MaxSize=10
            CleanupIntervalMinutes=10
            MinSize=0
            MaxIdleTimeoutPercent=1.0


            org.jboss.resource.security.ManyToOnePrincipalMapping

            userName=gary
            password=garygary

            [2002-01-11 19:35:34,238,AutoDeployer,DEBUG] Received notification of mbean ZClassLoaders:id=-617212637's deployment.
            [2002-01-11 19:35:34,238,ServiceCreator,INFO] About to create the beanJBOSS-SYSTEM:service=ConnectionFactoryLoader,name=MSSQL2000DS
            [2002-01-11 19:35:34,248,AutoDeployer,DEBUG] Received notification of mbean JBOSS-SYSTEM:service=ConnectionFactoryLoader,name=MSSQL2000DS's deployment.
            [2002-01-11 19:35:34,248,ServiceCreator,INFO] Created the beanJBOSS-SYSTEM:service=ConnectionFactoryLoader,name=MSSQL2000DS
            [2002-01-11 19:35:34,288,Configurator,DEBUG] ManagedConnectionFactoryProperties set to ConnectionURL=jdbc:AvenirDriver://localhost:1433/commerce;uid=gary;pwd=garygary
            DriverClass=net.avenir.jdbc2.Driver in JBOSS-SYSTEM:service=ConnectionFactoryLoader,name=MSSQL2000DS
            [2002-01-11 19:35:34,318,Configurator,DEBUG] JndiName set to MSSQL2000DS in JBOSS-SYSTEM:service=ConnectionFactoryLoader,name=MSSQL2000DS
            [2002-01-11 19:35:34,348,Configurator,DEBUG] TransactionManagerName set to java:/TransactionManager in JBOSS-SYSTEM:service=ConnectionFactoryLoader,name=MSSQL2000DS
            [2002-01-11 19:35:34,378,Configurator,DEBUG] ConnectionManagerProperties set to #
            #Wed Aug 15 16:17:29 EDT 2001
            BlockingTimeoutMillis=50000
            IdleTimeoutMinutes=30
            MaxSize=10
            CleanupIntervalMinutes=10
            MinSize=0
            MaxIdleTimeoutPercent=1.0 in JBOSS-SYSTEM:service=ConnectionFactoryLoader,name=MSSQL2000DS
            [2002-01-11 19:35:34,418,Configurator,DEBUG] PrincipalMappingClass set to org.jboss.resource.security.ManyToOnePrincipalMapping in JBOSS-SYSTEM:service=ConnectionFactoryLoader,name=MSSQL2000DS
            [2002-01-11 19:35:34,438,Configurator,DEBUG] PrincipalMappingProperties set to userName=gary
            password=garygary in JBOSS-SYSTEM:service=ConnectionFactoryLoader,name=MSSQL2000DS
            [2002-01-11 19:35:34,448,Configurator,DEBUG] found 3 mbean-ref elements
            [2002-01-11 19:35:34,448,Configurator,DEBUG] Anonymous dependency on object name JBOSS-SYSTEM:service=MSSQL2000
            [2002-01-11 19:35:34,448,Configurator,DEBUG] Anonymous dependency on object name JCA:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter
            [2002-01-11 19:35:34,448,Configurator,DEBUG] Anonymous dependency on object name JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory
            [2002-01-11 19:35:34,448,ServiceController,DEBUG] waiting to start JBOSS-SYSTEM:service=ConnectionFactoryLoader,name=MSSQL2000DS until dependencies are resolved
            [2002-01-11 19:35:34,448,AutoDeployer,INFO] Started

            ===================

            As you can see the ServiceController is attempting to
            deploy the MSSQL2000DS service but goes into a wait
            state until dependencies are resolved. What dependencies?

            A little latter down in the log this line pops up :

            ============================

            [2002-01-11 19:35:38,574,ServiceController,DEBUG] There are still missing mbeans, deployment of JBOSS-SYSTEM:service=ConnectionFactoryLoader,name=MSSQL2000DS postponed

            =============================

            Then after an inordinate amount of time I deployed the
            cmp2.ear and this error message eventually came out in
            the log :

            [2002-01-11 19:54:00,399,CMP,DEBUG] Loading standardjbosscmp-jdbc.xml : file:/D:/jboss-3.0.0alpha//conf/default/standardjbosscmp-jdbc.xml
            [2002-01-11 19:54:00,509,CMP,DEBUG] jar:file:/D:/jboss-3.0.0alpha/deploy/Default/cmp2-example.ear/ejb1003.jar!/META-INF/jbosscmp-jdbc.xml found. Overriding defaults
            [2002-01-11 19:54:00,589,ContainerFactory,ERROR] Could not deploy file:/D:/jboss-3.0.0alpha/deploy/Default/cmp2-example.ear
            org.jboss.ejb.DeploymentException: Error: can't find data source: java:/MSSQL2000DS
            at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.init(JDBCStoreManager.java:113)
            at org.jboss.ejb.plugins.CMPPersistenceManager.init(CMPPersistenceManager.java:141)

            ============

            So David what do you think is going on??

            Gary

            • 3. Re: JBoss3.0 Demo program question.

              When you copied the hypersonic configuration,
              did you see the warning?
              This might not have been in JBoss3.0alpha



              ConnectionURL=jdbc:hsqldb:hsql://localhost:1476
              DriverClass=org.hsqldb.jdbcDriver
              UserName=sa

              DefaultDS
              java:/TransactionManager

              <!--Anonymous depends to database being started -->
              <!--WARNING: DO NOT COPY BLINDLY! This is useful only if the database is
              started by an mbean in the jboss jmx framework! The only example of this
              we have right now is hsqldb! Do not use a line like this for external
              databases. -->
              jboss:service=Hypersonic

              You need to REMOVE the line

              <mbean-ref>JBOSS-SYSTEM:service=MSSQL2000</mbean-ref>

              It thinks you will be running a special
              embedded version of the database.
              It is waiting for that to start before starting the
              data source.
              Of course it never does because it doesn't exist!

              Regards,
              Adrian

              • 4. Re: JBoss3.0 Demo program question.
                java_developer

                Hi there,

                I've set up JBoss3.0 with atinav driver using the
                mssql-service.xml

                <?xml version="1.0" encoding="UTF-8"?>
                <!-- $Id: mssql-service.xml,v 1.2 2002/01/14 00:16:51 d_jencks Exp $ -->

                <!-- =====================================================================-->
                <!-- mssql-service.xml -->
                <!-- JBoss v3.0alpha (november 23, 2001) ATINAV thin driver Configuration -->
                <!-- tested against MS SQL 2000 -->
                <!-- =====================================================================-->
                <!-- -->
                <!-- please put jdbc driver (in this case TaveConn25C.jar) under -->
                <!-- jboss_home/lib/ext -->
                <!-- please put this file (mssqlds-service.xml) under jboss_home/deploy -->
                <!-- The atinav driver is from -->
                <!-- http://www.atinav.com/products/aveconnect/aveconnect.htm -->
                <!-- This configuration is contributed by Alex Pavlov apavlov@ma.us.mks.com -->
                <!-- =====================================================================-->







                ConnectionURL=jdbc:AvenirDriver://10.122.10.88:1433/tempdb;uid=sa;pwd=""
                DriverClass=net.avenir.jdbc2.Driver

                MSSQL2000DS
                java:/TransactionManager
                <depends optional-attribute-name="ResourceAdapterName">jboss.jca:service=RARDeployment,name=Minerva
                JDBC LocalTransaction ResourceAdapter
                <depends optional-attribute-name="ConnectionManagerFactoryLoaderName">jboss.jca:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory
                #
                #Wed Aug 15 16:17:29 EDT 2001
                BlockingTimeoutMillis=50000
                IdleTimeoutMinutes=30
                MaxSize=10
                CleanupIntervalMinutes=10
                MinSize=0
                MaxIdleTimeoutPercent=1.0


                org.jboss.resource.security.ManyToOnePrincipalMapping

                userName=sa
                password=""



                However on starting jboss i get the error:

                [11:12:23,518,Default] Libraries adding URLClassLoader 1652023458 key URL file:/
                C:/jboss//lib/ext/TaveCEXAPI25C.jar
                [11:12:23,558,ServiceCreator] About to create the beanjboss.jca:service=Connecti
                onFactoryLoader,name=MSSQL2000DS
                [11:12:23,588,ServiceCreator] Created the beanjboss.jca:service=ConnectionFactor
                yLoader,name=MSSQL2000DS
                [11:12:23,909,ConnectionFactoryLoader] Starting
                [11:12:23,939,MSSQL2000DS] Stopped
                javax.management.RuntimeOperationsException: Object name cannot be null
                at com.sun.management.jmx.MBeanServerImpl.isRegistered(MBeanServerImpl.j
                ava:1096)
                at org.jboss.resource.ConnectionFactoryLoader.startService(ConnectionFac
                toryLoader.java:402)
                at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:1
                17)
                at java.lang.reflect.Method.invoke(Native Method)
                at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:16
                28)
                at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
                23)
                at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceControl
                ler.java:775)
                at $Proxy0.start(Unknown Source)
                at org.jboss.system.ServiceController.start(ServiceController.java:479)

                ---------

                what is the "object name" the error message is referring to?

                thnx