3 Replies Latest reply on Sep 25, 2002 6:30 PM by rockinryan

    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
          rockinryan

          I'm not sure if you're still fighting with this, but since it is becoming a dead thread I'll try to help-

          I notice one thing that I expect is related to your problem and thread title - NOT BOUND. Your JNDI Name is VulcanDBJNDI, so that is the name of the data souce you should be looking up in your code from the initial context object. I don't see your code or a stack trace attached, so this is speculation.

          Are you able to make anything of my suggestion? if not can you include more information?

          Ryan

          • 2. Re: Deployment Exception: java:jdbc not bound
            dmaclaren

            Ryan, what he is noting is the issue I have had.
            THat fisrt depends error is being logged on JBOSS startup. Even though the depends looks like it is fine nothing is bound.

            I can safely say that he is looking it up by that JNDI name you mentioned since I have done the same. I have gone though every creation on the Lookup string with attaching the JNDI name at the end. like java:jdbc/jndiname, java:jndiname, etc... Nothing.

            This is the issue that we are both having

            • 3. Re: Deployment Exception: java:jdbc not bound
              rockinryan

              I'm not sure what I can do to help. If the startup log shows something being deployed I'd expect it is there, otherwise it should throw an error. If you haven't already, look at the list of bound services here and see if the service did deploy, possibly in a different namespace, etc?

              http://localhost:8082/InvokeAction//jboss%3Aservice%3DJNDIView/action=list?action=list&boolean%2Bboolean=true

              Good luck?
              Ryan