1 Reply Latest reply on Sep 16, 2002 11:07 AM by Adrian Brock

    Datasource cannot bind...plz help urgent

    shaikaman Newbie

      Hey outthere,

      Earlier I've posted a qury for migrating from j2ee from jboss..none replied. Idea..Nope.

      Hope u do this time.

      I've application earlier deployed in j2ee now in the process of deploying jboss3.0.2

      My Jar file has, ejb-jar.xml(created by deploytool)
      jboss.xml
      of CMP and BMP

      My war file has,
      web.xml
      of servlets/jsps/images etc.,

      Database is mysql

      I've modified mysql-services.xml & login-config.xml. and that it.
      Now, when I deployed jar & war I can see the jsp coming up..but without
      database fetching. Yes, the ejbs cannot bind to the datasource.

      my datasource is jdbc/VULCAN23 (also, my db name)
      jndi is jdbc/VulcanDBJNDI

      Do I need to add anymore files and any configurations needed to run this
      appl. in jboss. Plz help I'm struc for a long time.

      Plz specify the modifications needed in mysql-service.xml / login-config.xml.
      I can send those files later if I could not solve the problem from ur replies

      TIA,
      Aman

        • 1. Re: Datasource cannot bind...plz help urgent
          Adrian Brock Master

          Assuming your data source is bound.
          Check jboss:service=JNDIView on
          http://localhost:8080/jmx-console

          You need a resource reference

          ejb-jar.xml
          -----------

          <ejb-name>ejb/Test</ejb-name>
          ...
          <resource-ref>
          <res-ref-name>jdbc/DataSource</res-ref-name>
          <res-type>javax.sql.DataSource</res-type>
          <res-auth>Container</res-auth>
          </resource-ref>


          jboss.xml
          ---------

          <ejb-name>ejb/Test</ejb-name>
          ...
          <resource-ref>
          <res-ref-name>jdbc/DataSource</res-ref-name>
          <resource-name>DataSourceRef</resource-name>
          </resource-ref>


          <resource-managers>
          <resource-manager>
          <res-name>DataSourceRef</res-name>
          <res-jndi-name>java:/DefaultDS</res-jndi-name>
          </resource-manager>
          </resource-managers>

          Please adjust names to taste

          Regards,
          Adrian