5 Replies Latest reply on Oct 21, 2003 3:41 AM by penguinf

    Using mySQL as the datasource

      I read the Appendix A and tried to configure for MySQL.

      page 184: some of the OracleDS references in the file "titandb-service.xml" are highlighted and explained. However, there are much more references to OracleDS in this file. I tried to change all of them to "MySQLDS".

      page 185, paragraph "Examine the jBoss specific files".
      There is quite an unexpected topic change here. I tried to change example 06_1 and rebuilt it using ant - ok?
      There is a setting mentioned:
      <datasource-mapping>MySQLDS</datasource-mapping>
      But it is not explained, to which datasource this identifier maps to!?

      then I started up JBoss again and got the following error:
      datasource-mapping MySQLDS not found.

      I attach the two configuration files here.
      anybody having the same issue?
      johannes

        • 1. Re: Using mySQL as the datasource

          additionally - in the PDF the datasource-mapping Oracle8 is used. But where does this one come from? Where is it configured?

          thx alot
          johannes

          • 2. Re: Using mySQL as the datasource

            It seems that the datasource-mapping is provided by JBoss. It should be in the advanced documentation, but where can I get this (it is not in the publicly available getting started PDF)??

            However, after correcting this, the titan-service.xml seems to get deployed correctly (see log below).

            BUT I still get an error after JBoss is starting up:
            Error: Can't find datasource java:/MySQLDS; (javax.naming.NameNotFoundException: MySQLDS not bound).

            Anybody else got this?

            johannes


            2002-10-05 19:19:43,531 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/E:/jboss/server/default/deploy/titandb-service.xml
            2002-10-05 19:19:43,531 DEBUG [org.jboss.deployment.MainDeployer] Starting deployment (init step) of package at: file:/E:/jboss/server/default/deploy/titandb-service.xml
            2002-10-05 19:19:43,546 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] New jmx UCL with url file:/E:/jboss/server/default/tmp/deploy/server/default/deploy/titandb-service.xml/53.titandb-service.xml
            2002-10-05 19:19:43,546 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] New jmx UCL with url file:/E:/jboss/server/default/tmp/deploy/server/default/deploy/titandb-service.xml/53.titandb-service.xml
            2002-10-05 19:19:43,546 DEBUG [org.jboss.mx.loading.UnifiedLoaderRepository2] Adding org.jboss.mx.loading.UnifiedClassLoader@5c7734{ url=file:/E:/jboss/server/default/tmp/deploy/server/default/deploy/titandb-service.xml/53.titandb-service.xml }
            2002-10-05 19:19:43,546 DEBUG [org.jboss.deployment.MainDeployer] using deployer org.jboss.deployment.SARDeployer@482923
            2002-10-05 19:19:43,546 DEBUG [org.jboss.deployment.SARDeployer] about to copy 0 local directories
            2002-10-05 19:19:43,546 DEBUG [org.jboss.deployment.MainDeployer] found 0 subpackages of file:/E:/jboss/server/default/deploy/titandb-service.xml
            2002-10-05 19:19:43,546 DEBUG [org.jboss.deployment.MainDeployer] Watching new file: file:/E:/jboss/server/default/deploy/titandb-service.xml
            2002-10-05 19:19:43,546 DEBUG [org.jboss.deployment.MainDeployer] create step for deployment file:/E:/jboss/server/default/deploy/titandb-service.xml
            2002-10-05 19:19:43,546 DEBUG [org.jboss.deployment.SARDeployer] Deploying SAR, create step: url file:/E:/jboss/server/default/deploy/titandb-service.xml
            2002-10-05 19:19:43,546 DEBUG [org.jboss.deployment.SARDeployer] Registering service UCL=jmx.loading:UCL=9838890
            2002-10-05 19:19:43,546 DEBUG [org.jboss.system.ServiceCreator] About to create bean: jboss.jca:service=LocalTxCM,name=MySQLDS
            2002-10-05 19:19:43,546 DEBUG [org.jboss.system.ServiceCreator] code: org.jboss.resource.connectionmanager.LocalTxConnectionManager
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceCreator] Created bean: jboss.jca:service=LocalTxCM,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceCreator] About to create bean: jboss.jca:service=LocalTxDS,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceCreator] code: org.jboss.resource.connectionmanager.RARDeployment
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceCreator] Created bean: jboss.jca:service=LocalTxDS,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceConfigurator] JndiName set to MySQLDS in jboss.jca:service=LocalTxDS,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceConfigurator] ManagedConnectionFactoryProperties set to
            <config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://localhost/test</config-property>
            <config-property name="DriverClass" type="java.lang.String">com.mysql.jdbc.Driver</config-property>
            <config-property name="UserName" type="java.lang.String">johannes</config-property>
            <config-property name="Password" type="java.lang.String">test</config-property>
            in jboss.jca:service=LocalTxDS,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceController] recording that jboss.jca:service=LocalTxDS,name=MySQLDS depends on jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceConfigurator] considering OldRarDeployment with object name jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceController] recording that jboss.jca:service=LocalTxCM,name=MySQLDS depends on jboss.jca:service=LocalTxDS,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceConfigurator] considering ManagedConnectionFactoryName with object name jboss.jca:service=LocalTxDS,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceCreator] About to create bean: jboss.jca:service=LocalTxPool,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceCreator] code: org.jboss.resource.connectionmanager.JBossManagedConnectionPool
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceCreator] Created bean: jboss.jca:service=LocalTxPool,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceConfigurator] MinSize set to 0 in jboss.jca:service=LocalTxPool,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceConfigurator] MaxSize set to 50 in jboss.jca:service=LocalTxPool,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceConfigurator] BlockingTimeoutMillis set to 5000 in jboss.jca:service=LocalTxPool,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceConfigurator] IdleTimeoutMinutes set to 15 in jboss.jca:service=LocalTxPool,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceConfigurator] Criteria set to ByContainer in jboss.jca:service=LocalTxPool,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceController] recording that jboss.jca:service=LocalTxCM,name=MySQLDS depends on jboss.jca:service=LocalTxPool,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceConfigurator] considering ManagedConnectionPool with object name jboss.jca:service=LocalTxPool,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceController] recording that jboss.jca:service=LocalTxCM,name=MySQLDS depends on jboss.jca:service=CachedConnectionManager
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceConfigurator] considering CachedConnectionManager with object name jboss.jca:service=CachedConnectionManager
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceController] recording that jboss.jca:service=LocalTxCM,name=MySQLDS depends on jboss.security:name=JaasSecurityManager
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceConfigurator] considering JaasSecurityManagerService with object name jboss.security:name=JaasSecurityManager
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceConfigurator] TransactionManager set to java:/TransactionManager in jboss.jca:service=LocalTxCM,name=MySQLDS
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceController] recording that jboss.jca:service=LocalTxCM,name=MySQLDS depends on jboss.jca:service=RARDeployer
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceConfigurator] considering with object name jboss.jca:service=RARDeployer
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceController] waiting in create of jboss.jca:service=LocalTxCM,name=MySQLDS waiting on jboss.jca:service=LocalTxDS,name=MySQLDS
            2002-10-05 19:19:43,562 WARN [org.jboss.system.ServiceController] jboss.jca:service=LocalTxDS,name=MySQLDS does not implement any Service methods
            2002-10-05 19:19:43,562 DEBUG [org.jboss.system.ServiceController] waiting in create of jboss.jca:service=LocalTxDS,name=MySQLDS waiting on jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
            2002-10-05 19:19:43,562 INFO [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Creating
            2002-10-05 19:19:43,562 INFO [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Created
            2002-10-05 19:19:43,578 DEBUG [org.jboss.system.ServiceController] Starting dependent components: [ObjectName: jboss.jca:service=LocalTxCM,name=MySQLDS
            state: CONFIGURED
            I Depend On: jboss.jca:service=LocalTxDS,name=MySQLDS
            jboss.jca:service=LocalTxPool,name=MySQLDS
            jboss.jca:service=CachedConnectionManager
            jboss.security:name=JaasSecurityManager
            jboss.jca:service=RARDeployer

            Depends On Me: ]
            2002-10-05 19:19:43,578 DEBUG [org.jboss.system.ServiceController] waiting in create of jboss.jca:service=LocalTxCM,name=MySQLDS waiting on jboss.jca:service=LocalTxDS,name=MySQLDS
            2002-10-05 19:19:43,578 DEBUG [org.jboss.deployment.MainDeployer] Done with create step of deploying titandb-service.xml
            2002-10-05 19:19:43,578 DEBUG [org.jboss.deployment.MainDeployer] Begin deployment start file:/E:/jboss/server/default/deploy/titandb-service.xml
            2002-10-05 19:19:43,578 DEBUG [org.jboss.deployment.SARDeployer] Deploying SAR, start step: url file:/E:/jboss/server/default/deploy/titandb-service.xml
            2002-10-05 19:19:43,578 DEBUG [org.jboss.system.ServiceController] waiting in start jboss.jca:service=LocalTxCM,name=MySQLDS on jboss.jca:service=LocalTxDS,name=MySQLDS
            2002-10-05 19:19:43,578 DEBUG [org.jboss.system.ServiceController] waiting in start jboss.jca:service=LocalTxDS,name=MySQLDS on jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
            2002-10-05 19:19:43,578 INFO [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Starting
            2002-10-05 19:19:43,578 INFO [org.jboss.resource.connectionmanager.JBossManagedConnectionPool] Started
            2002-10-05 19:19:43,578 DEBUG [org.jboss.system.ServiceController] Starting dependent components: [ObjectName: jboss.jca:service=LocalTxCM,name=MySQLDS
            state: CONFIGURED
            I Depend On: jboss.jca:service=LocalTxDS,name=MySQLDS
            jboss.jca:service=LocalTxPool,name=MySQLDS
            jboss.jca:service=CachedConnectionManager
            jboss.security:name=JaasSecurityManager
            jboss.jca:service=RARDeployer

            Depends On Me: ]
            2002-10-05 19:19:43,578 DEBUG [org.jboss.system.ServiceController] waiting in start jboss.jca:service=LocalTxCM,name=MySQLDS on jboss.jca:service=LocalTxDS,name=MySQLDS
            2002-10-05 19:19:43,578 DEBUG [org.jboss.deployment.MainDeployer] End deployment start on package: titandb-service.xml
            2002-10-05 19:19:43,578 INFO [org.jboss.deployment.MainDeployer] Deployed package: file:/E:/jboss/server/default/deploy/titandb-service.xml

            • 3. Re: Using mySQL as the datasource

              Here is the error in more detail:

              2002-10-05 19:19:47,812 INFO [org.jboss.ejb.EjbModule] Starting
              2002-10-05 19:19:47,812 DEBUG [org.jboss.ejb.EjbModule] Application.start(), start container: org.jboss.ejb.EntityContainer@1bef1ac
              2002-10-05 19:19:47,812 DEBUG [org.jboss.ejb.EntityContainer] Begin java:comp/env for EJB: CustomerEJB
              2002-10-05 19:19:47,812 DEBUG [org.jboss.ejb.EntityContainer] TCL: java.net.URLClassLoader@8ef455
              2002-10-05 19:19:47,812 DEBUG [org.jboss.ejb.EntityContainer] End java:comp/env for EJB: CustomerEJB
              2002-10-05 19:19:47,812 DEBUG [org.jboss.ejb.plugins.local.BaseLocalContainerInvoker] CustomerEJB cannot be Bound, doesn't have local and local home interfaces
              2002-10-05 19:19:47,828 DEBUG [org.jboss.proxy.ejb.ProxyFactory] Bound CustomerEJB to CustomerHomeRemote
              2002-10-05 19:19:47,828 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.CustomerEJB] Initializing CMP plugin for CustomerEJB
              2002-10-05 19:19:47,828 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.CustomerEJB] Loading standardjbosscmp-jdbc.xml : file:/E:/jboss/server/default/conf/standardjbosscmp-jdbc.xml
              2002-10-05 19:19:48,093 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.CustomerEJB] jar:file:/E:/jboss/server/default/tmp/deploy/server/default/deploy/titan.jar/62.titan.jar!/META-INF/jbosscmp-jdbc.xml found. Overriding defaults
              2002-10-05 19:19:48,109 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
              2002-10-05 19:19:48,109 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
              2002-10-05 19:19:48,109 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true

              2002-10-05 19:19:48,125 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:service=EJB,jndiName=CustomerHomeRemote
              org.jboss.deployment.DeploymentException: Error: can't find data source: java:/MySQLDS; - nested throwable: (javax.naming.NameNotFoundException: MySQLDS not bound)
              at

              org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.(JDBCEntityBridge.java:99)
              at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:397)
              at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:339)
              at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:198)
              at org.jboss.ejb.EntityContainer.start(EntityContainer.java:376)
              at org.jboss.ejb.Container.invoke(Container.java:764)
              at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
              at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:967)
              at $Proxy5.start(Unknown Source)
              at org.jboss.system.ServiceController.start(ServiceController.java:396)
              at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

              • 4. Re: Using mySQL as the datasource
                slaboure

                it seems that your datasource is not bound under the good name (or not deployed at all).

                Check under http://localhost:8080/jmx-console/ with the JNDIView MBean (there is a list operation that lists the JNDI tree)

                Cheers,

                sacha

                • 5. Re: Using mySQL as the datasource
                  penguinf

                  Hi

                  I figure it out.

                  In the JBoss Workbook exAppendixA/src/resource/META-INF/jbosscmp-jdbc.xml

                  change the <datasource-mapping>Oracle8</datasource-mapping> to:

                  <datasource-mapping>mySQL</datasource-mapping>

                  The reason 'mySQL' here is because in the

                  $JBOSS_HOME/server/default/conf/standardjbosscmp-jdbc.xml

                  - <type-mapping>
                  mySQL
                  .....
                  </type-mapping>

                  And this is your datasource-mapping name the server looks for.

                  Hope this help.