1 Reply Latest reply on Sep 18, 2002 12:38 AM by davidjencks

    Deployment Exception: java:jdbc not bound

    shaikaman

      Hi all,

      My application prev. deployed on j2ee, now i'm porting
      it to jboss 3.0.2.

      Now, I'm having problems in connecting to database(mysql)

      These are the steps I followed to deploy:

      1. Modified and copied mysql-service to /deploy directory
      2. Modified login-config in /conf
      3. Modified ejb-jar.xml(created using j2ee's deploytool) and
      provided jndi name for the beans in <ejb-name> tag to avoid
      jboss.xml
      4. Modified datasource name in standardjaws.xml under /conf
      5. Modified datasource name in standardjbosscmp-jdbc.xml under /conf
      6. Created jbosscmp-jdbc.xml

      I created jar file whose contents are:
      applications/class/files/with/package
      META-INF/ejb-jar.xml
      META-INF/jbosscmp-jdbc.xml

      After copying this jar file to the deploy directoy:
      The application gets deployed with the following errors:


      ...........
      ...........
      ...........
      ...........

      MBeans waiting for other MBeans:
      [ObjectName: jboss.j2ee.service=EJB, jndiName=Vulcan.ShopperInfoHomeEB
      state: FAILED
      I Depend On :
      Depends on Me: org.jboss.deployment.DeploymentException: java:jdbc not bound..

      ]

      I found that all these beans are of CMP type and follows EJB1.1 specification.

      So..now how to rectify this problem and connect to database.

      I'm struck for a long time now.


      ----mysql-sercie.xml---
      <?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 -->
      <!-- ==================================================================== -->




      <!-- 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-->


      VulcanDBJNDI



      <config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://192.168.0.1:3306/VULCAN23</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">root</config-property>
      <config-property name="Password" type="java.lang.String"></config-property>




      <!--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:service=JaasSecurityManager

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






      ---- end of mysql-service.xml

      ---login - congif.xml
      <application-policy name = "MySqlDbRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
      flag = "required">
      <module-option name = "principal"></module-option>
      <module-option name = "userName">root</module-option>
      <module-option name = "password"></module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=XaTxCM,name=jdbc/VulcanDBJNDI</module-option>
      </login-module>

      </application-policy>

      ---------end of l-c.xml

        • 1. Re: Deployment Exception: java:jdbc not bound
          davidjencks

          Without a jboss.xml file your app should be looking up the datasource as java:/VulcanDBJNDI and should specify either VulcanDBJNDI or java:/VulcanDBJNDI in jaws.xml (I have trouble remembering which)

          You arent using the login-conf entry so you might as well remove it.