0 Replies Latest reply on Oct 14, 2002 10:19 PM by Kristofor Jacobson

    My 'java:/AS400DS' ends up bound to 'java:/DefaultDS'

    Kristofor Jacobson Newbie

      I am having a problem with my datasource not being seen by my bean when deployed. I have scoured the forums looking for answers, and found lots of people asking similar questions, but none of the suggestions have worked for me. I've read the JBoss Admin-Devel manual (for 3.0), and I've found NOTHING that helps me (to top it off, much of the v3.0 manual inaccurately refers to JBoss 2.4.x configuration files).

      Background:
      I created an as400db2-service.xml from the db2 template provided in my distribution. I'm using JBoss 3.0.0. In my as400db2-service.xml file I specify AS400DS as my data source name, to be bound to 'java:/AS400DS'.

      I modified the driver, connection url, username, and password in the service file (to appropriate, known values that work).

      I removed hsqldb-service.xml from the %JBOSS%/server/default/deploy directory.

      I deployed my jt400.jar (my AS/400 JDBC provider) into %JBOSS%/server/default/lib.

      I started JBoss, and all appears OK at first (also, the JNDIview shows my resource bound to java:/AS400DS).

      THEN, I deployed a session bean with the following configuration (partial):

      ejb-jar.xml:

      <resource-ref>
      <res-ref-name>jdbc/AS400DS</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      <jndi-name>java:/AS400DS</jndi-name>
      </resource-ref>

      jboss.xml:
      <resource-ref>
      <res-ref-name>jdbc/AS400DS</res-ref-name>
      <jndi-name>java:/AS400DS</jndi-name>
      <resource-name>AS400DS</resource-name>
      </resource-ref>

      I get the following error in my server.log:
      2002-10-14 18:19:02,787 DEBUG [org.jboss.ejb.StatefulSessionContainer] failed to lookup DefaultDS; ignoring
      javax.naming.NameNotFoundException: DefaultDS not bound

      If I re-add the hsqldb-service.xml file to the "deploy" directory, it corrects the NameNotFoundException. However, I start getting this line in my server.log:

      2002-10-14 18:21:18,877 DEBUG [org.jboss.ejb.StatefulSessionContainer] Binding resource manager: java:/DefaultDS to JDNI ENC as: jdbc/AS400DS

      At this point, performing a lookup with "jdbc/AS400DS" appears to return a Hypersonic DataSource object. What am I doing wrong?

      Please save me from the almost-certain insanity that I'm spiraling into.

      Thanks in advance,

      Kristofor