2 Replies Latest reply on Jan 14, 2003 5:35 PM by nurb

    MySql not bound

    Daniel Fernandez Newbie

      I am trying to access mySql with a CMP entity bean but I get the message that de dataource is not bound. I am running Jboss3.0.2 + MySql and JBuilder7.
      I put mysql-service.xml in the server/default/deploy folder but it does not work.
      Here are my mysql-service.xml and log files to see if anyone can give me a hint.


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

      <!-- ==================================================================== -->
      <!-- New ConnectionManager setup for mysql using 2.0.11 driver -->
      <!-- Build jmx-api (build/build.sh all) and view for config documentation -->
      <!-- ==================================================================== -->

      <!-- Include a login module configuration named MySqlDbRealm.
      Update your login-conf.xml, here is an example for a
      ConfiguredIdentityLoginModule:

      <application-policy name = "MySqlDbRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
      <module-option name = "principal">yourprincipal</module-option>
      <module-option name = "userName">yourusername</module-option>
      <module-option name = "password">yourpassword</module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MySqlDS</module-option>
      </login-module>

      </application-policy>

      NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
      module-option name = "managedConnectionFactoryName"
      must match the object name of the ConnectionManager you are configuring here.
      -->
      <!--uncomment out this line if you are using the MySqlDbRealm above
      MySqlDbRealm
      -->
      <depends optional-attribute-name="ManagedConnectionFactoryName">
      <!--embedded mbean-->

      MySqlDS


      <config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://localhost:3306/dbSistemaLegado</config-property>
      <config-property name="DriverClass" type="java.lang.String">org.gjt.mm.mysql.Driver</config-property>
      <!--set these only if you want only default logins, not through JAAS -->
      <config-property name="UserName" type="java.lang.String"/>
      <config-property name="Password" type="java.lang.String"/>


      <!--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
      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
      <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=JaasSecurityManager
      java:/TransactionManager
      <!--make the rar deploy! hack till better deployment-->
      jboss.jca:service=RARDeployer





      2002-09-05 19:34:50,203 INFO [org.jboss.deployment.MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.2/server/default/deploy/Servicio.jar
      2002-09-05 19:34:50,203 DEBUG [org.jboss.deployment.MainDeployer] Starting deployment (init step) of package at: file:/C:/jboss-3.0.2/server/default/deploy/Servicio.jar
      2002-09-05 19:34:50,203 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] New jmx UCL with url file:/C:/jboss-3.0.2/server/default/tmp/deploy/server/default/deploy/Servicio.jar/60.Servicio.jar
      2002-09-05 19:34:50,203 DEBUG [org.jboss.mx.loading.UnifiedClassLoader] New jmx UCL with url file:/C:/jboss-3.0.2/server/default/tmp/deploy/server/default/deploy/Servicio.jar/60.Servicio.jar
      2002-09-05 19:34:50,203 DEBUG [org.jboss.mx.loading.UnifiedLoaderRepository2] Adding org.jboss.mx.loading.UnifiedClassLoader@64bb3c{ url=file:/C:/jboss-3.0.2/server/default/tmp/deploy/server/default/deploy/Servicio.jar/60.Servicio.jar }
      2002-09-05 19:34:50,203 DEBUG [org.jboss.deployment.MainDeployer] using deployer org.jboss.ejb.EJBDeployer@555986
      2002-09-05 19:34:50,203 DEBUG [org.jboss.deployment.MainDeployer] found 0 subpackages of file:/C:/jboss-3.0.2/server/default/deploy/Servicio.jar
      2002-09-05 19:34:50,203 DEBUG [org.jboss.deployment.MainDeployer] Watching new file: file:/C:/jboss-3.0.2/server/default/deploy/Servicio.jar
      2002-09-05 19:34:50,203 DEBUG [org.jboss.deployment.MainDeployer] create step for deployment file:/C:/jboss-3.0.2/server/default/deploy/Servicio.jar
      2002-09-05 19:34:50,375 DEBUG [org.jboss.metadata.EntityMetaData] Bean dependencies: []
      2002-09-05 19:34:50,375 DEBUG [org.jboss.ejb.EJBDeployer] Verifying file:/C:/jboss-3.0.2/server/default/deploy/Servicio.jar
      2002-09-05 19:34:50,421 DEBUG [org.jboss.ejb.EJBDeployer] Servicio: Verified.
      2002-09-05 19:34:50,421 DEBUG [org.jboss.ejb.EJBDeployer] Deploying: file:/C:/jboss-3.0.2/server/default/deploy/Servicio.jar
      2002-09-05 19:34:50,421 INFO [org.jboss.ejb.EjbModule] Creating
      2002-09-05 19:34:50,437 DEBUG [org.jboss.ejb.EjbModule] Application.start(), begin
      2002-09-05 19:34:50,437 DEBUG [org.jboss.management.j2ee.EJBModule] EJBModule.create(), server name: J2EEServer=Single
      2002-09-05 19:34:50,437 DEBUG [org.jboss.management.j2ee.J2EEDeployedObject] File: file:/C:/jboss-3.0.2/server/default/tmp/deploy/server/default/deploy/Servicio.jar/60.Servicio.jar, descriptor: META-INF/ejb-jar.xml
      2002-09-05 19:34:50,437 DEBUG [org.jboss.management.j2ee.EJBModule] Create EJB-Module, name: Servicio.jar, application: jboss.management.single:J2EEServer=Single,name=
      2002-09-05 19:34:50,437 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] getObjectName(), name: jboss.management.single:J2EEApplication= ,J2EEServer=Single,j2eeType=EJBModule,name=Servicio.jar
      2002-09-05 19:34:50,453 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] postRegister(), parent: jboss.management.single:J2EEServer=Single,name=
      2002-09-05 19:34:50,453 INFO [org.jboss.ejb.EjbModule] Deploying Servicio
      2002-09-05 19:34:50,593 DEBUG [org.jboss.ejb.plugins.LRUEnterpriseContextCachePolicy] Cache policy timer started, tasksTimer=java.util.Timer@5c998a
      2002-09-05 19:34:50,609 DEBUG [org.jboss.system.ServiceController] adding depends in ServiceController.create: []
      2002-09-05 19:34:50,625 DEBUG [org.jboss.proxy.ejb.ProxyFactory] Bound jmxName=jboss.j2ee:service=EJB,jndiName=ServicioRemote, hash=697510707into Registry
      2002-09-05 19:34:50,625 DEBUG [org.jboss.proxy.ejb.ProxyFactory] Proxy Factory for ServicioRemote initialized
      2002-09-05 19:34:50,671 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] getObjectName(), name: jboss.management.single:EJBModule=Servicio.jar,J2EEApplication= ,J2EEServer=Single,j2eeType=EntityBean,name=ServicioRemote
      2002-09-05 19:34:50,671 DEBUG [org.jboss.management.j2ee.J2EEManagedObject] postRegister(), parent: jboss.management.single:J2EEApplication= ,J2EEServer=Single,j2eeType=EJBModule,name=Servicio.jar
      2002-09-05 19:34:50,671 DEBUG [org.jboss.ejb.EjbModule] Application.start(), EJB: jboss.management.single:EJBModule=Servicio.jar,J2EEApplication= ,J2EEServer=Single,j2eeType=EntityBean,name=ServicioRemote
      2002-09-05 19:34:50,671 INFO [org.jboss.ejb.EjbModule] Created
      2002-09-05 19:34:50,671 DEBUG [org.jboss.deployment.MainDeployer] Done with create step of deploying Servicio.jar
      2002-09-05 19:34:50,671 DEBUG [org.jboss.deployment.MainDeployer] Begin deployment start file:/C:/jboss-3.0.2/server/default/deploy/Servicio.jar
      2002-09-05 19:34:50,671 DEBUG [org.jboss.ejb.EJBDeployer] start application, deploymentInfo: org.jboss.deployment.DeploymentInfo@b89707e1 { url=file:/C:/jboss-3.0.2/server/default/deploy/Servicio.jar }
      deployer: org.jboss.ejb.EJBDeployer@555986
      status: Starting
      state: START_DEPLOYER
      watch: file:/C:/jboss-3.0.2/server/default/deploy/Servicio.jar
      lastDeployed: 1031265290203
      lastModified: 1031265292000
      mbeans:
      jboss.j2ee:service=EJB,jndiName=ServicioRemote state: null
      , short name: Servicio.jar, parent short name: null
      2002-09-05 19:34:50,671 INFO [org.jboss.ejb.EjbModule] Starting
      2002-09-05 19:34:50,671 DEBUG [org.jboss.ejb.EjbModule] Application.start(), start container: org.jboss.ejb.EntityContainer@5f157b
      2002-09-05 19:34:50,671 DEBUG [org.jboss.ejb.EntityContainer] Begin java:comp/env for EJB: Servicio
      2002-09-05 19:34:50,671 DEBUG [org.jboss.ejb.EntityContainer] TCL: java.net.URLClassLoader@41c92b
      2002-09-05 19:34:50,671 DEBUG [org.jboss.ejb.EntityContainer] End java:comp/env for EJB: Servicio
      2002-09-05 19:34:50,671 DEBUG [org.jboss.ejb.plugins.local.BaseLocalContainerInvoker] Bound EJBLocalHome of Servicio to Servicio
      2002-09-05 19:34:50,671 DEBUG [org.jboss.proxy.ejb.ProxyFactory] Bound Servicio to ServicioRemote
      2002-09-05 19:34:50,687 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.Servicio] Initializing CMP plugin for Servicio
      2002-09-05 19:34:50,765 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.Servicio] Loading standardjbosscmp-jdbc.xml : file:/C:/jboss-3.0.2/server/default/conf/standardjbosscmp-jdbc.xml
      2002-09-05 19:34:50,859 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.Servicio] jar:file:/C:/jboss-3.0.2/server/default/tmp/deploy/server/default/deploy/Servicio.jar/60.Servicio.jar!/META-INF/jbosscmp-jdbc.xml found. Overriding defaults
      2002-09-05 19:34:50,906 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
      2002-09-05 19:34:50,906 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=true
      2002-09-05 19:34:50,906 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
      2002-09-05 19:34:50,906 WARN [org.jboss.system.ServiceController] Problem starting service jboss.j2ee:service=EJB,jndiName=ServicioRemote
      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 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:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy20.start(Unknown Source)
      at org.jboss.ejb.EjbModule.startService(EjbModule.java:430)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:164)
      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: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 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:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy9.start(Unknown Source)
      at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:394)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:802)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:616)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:580)
      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:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy4.deploy(Unknown Source)
      at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:427)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:648)
      at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:499)
      at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:261)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:164)
      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:517)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:967)
      at $Proxy0.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:396)
      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:517)
      at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174)
      at $Proxy3.start(Unknown Source)
      at org.jboss.deployment.SARDeployer.start(SARDeployer.java:249)
      at org.jboss.deployment.MainDeployer.start(MainDeployer.java:802)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:616)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:580)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:564)
      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:517)
      at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:324)
      at org.jboss.system.server.ServerImpl.start(ServerImpl.java:221)
      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)

        • 1. Re: MySql not bound
          David Jencks Master

          I'm not sure where you got your mysql-service.xml file, but I don't think it was from 3.0.2

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


          should be

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

          If there are other problems show the section of the log where the datasource is being deployed, not where your app discovers it wasn't deployed successfully.

          • 2. Re: MySql not bound
            nurb Newbie

            hi, after 2 days research, this version of mysql-service.xml whith mysql-connector-java-2.0.14-bin.jar and jboss 3.0.4 works till now. maybe i get in trouble again when my implementation goes on....

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

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



            <!-- ==================================================================== -->
            <!-- New ConnectionManager setup for mysql using 2.0.11 driver -->
            <!-- Build jmx-api (build/build.sh all) and view for config documentation -->
            <!-- ==================================================================== -->


            <!-- -->


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



            <!-- -->

            MySqlDS



            <config-property name="XADataSourceProperties" type="java.lang.String">URL=jdbc:mysql://192.168.1.10:3306/jbossdb</config-property>
            <config-property name="XADataSourceClass" type="java.lang.String">com.mysql.jdbc.jdbc2.optional.MysqlXaDataSource</config-property>
            <!-- Non XA config properties
            <config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://192.168.1.10:3306/jbossdb</config-property>
            <config-property name="DriverClass" type="java.lang.String">com.mysql.jdbc.Driver</config-property> -->
            <!--set these only if you want only default logins, not through JAAS -->
            <config-property name="UserName" type="java.lang.String">bla</config-property>
            <config-property name="Password" type="java.lang.String">fasel</config-property>








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




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

            <!-- -->

            0
            50
            5000
            15
            ByContainer



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

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

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






            good luck!
            nurb