4 Replies Latest reply on Aug 18, 2002 5:24 AM by brian

    Unable to find DataSource

    Tom Jordon Newbie

      I am using JBoss 3 and having some difficulty configuring the datasource so that its accessible from our ejbs. So far I have done the following:

      - Placed a mssql-service.xml file in the deploy directory can see from the console that it is being deployed and creating 'dbDataSource'.

      - In the jboss.xml file I have defined the following resource manager:
      <resource-managers>

      <resource-manager>
      <res-name>jdbc/dbDatasource</res-name>
      <res-jndi-name>java:/dbDatasource</res-jndi-name>
      </resource-manager>

      </resource-managers>


      When I try to use my beans, I get a jndi naming exception indicating that i cannot find the name dbDatasource.

      Are the above steps correct and what additional steps to I need to take to make this work?

      Thanks
      Tom

        • 1. Re: Unable to find DataSource
          Shane Newbie

          You still need to edit the JBoss' config file to use the newly added service.
          For this step you will need to modify one of JBoss' config files. The file we are looking for is:

          %your JBoss dir%\server\default\conf\standardjbosscmp-jdbc.xml

          Once you have located this file, open the file in a simple text editor and edit the following lines of code:

          java:/DefaultDS
          <datasource-mapping>Hypersonic SQL</datasource-mapping>

          Replace "DefaultDS" with the JNDI name given in the mssql-service.xml file. And replace "Hypersonic SQL" with the mapping required (i.e. "MS SQLSERVER" or "MS SQLSERVER2000").

          Hope this helps,
          J8055

          • 2. Re: Unable to find DataSource
            brian Newbie

            Hi,

            I am using PostgreSQL 7.1.3 with jboss 3.0.1 (not RC).
            I had problems to bound to my own datasource other than DefaultDS. The problem was that jboss always looks for DefaultDS even I changed standardjbosscmp-jdbc.xml as you did. I tried many ways to solve the problems, including removing hsqldb-service.xml off from the deploy directory to avoid confusion. Finally, I found the cause of the problem. I had to modify standardjaws.xml. Why?

            After I modify the datasource and its mapping to my own datasource and PostgreSQL, respectively, on the standardjaws.xml file. I then can connect to my PostgreSQL datasource other than Hypersonic SQL.

            Best Regards,

            Brian

            • 3. Re: Unable to find DataSource
              David Jencks Master

              Your ejb-jar.xml dtd identifies it as ejb 1.1. Use the 2.0 dtd to use the cmp2 persistence engine. Ask more questions on the persistence forum.

              • 4. Re: Unable to find DataSource
                brian Newbie

                Thanks.

                I am not using ejb 1.1 but 2.0 dtd. However, the problem was gone forever without knowing where it came and went.