0 Replies Latest reply on May 7, 2004 4:05 AM by sysuser1

    Sessionbean and DB connection PB

    sysuser1

      Hello,

      I have a problem when I want to access a database via my session bean

      I use Jboss3.2.3 with postgresql 7.4 db

      I have got a MDB tha listening on a topic when it receives a message a session bean is instanciated and this one get record from a database

      but after deploying my beans and the start my publisher I have got the following error display in Jboss console:
      10:40:04,027 ERROR [STDERR] javax.naming.NameNotFoundException: jdbc not bound

      My xml files are:
      AdminDB-ds.xml


      <local-tx-datasource>
      <jndi-name>AdminDB</jndi-name>
      <connection-url>jdbc:postgresql://svt-lmk91:5432/AdminDB</connection-url>
      <driver-class>org.postgresql.Driver</driver-class>
      <user-name>postgres</user-name>


      <!-- <new-connection-sql></new-connection-sql> -->

      <check-valid-connection-sql>select * from is_copyprotocol</check-valid-connection-sql>

      </local-tx-datasource>



      ejb-jar.xml:
      <?xml version="1.0" encoding="ISO-8859-1"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      <ejb-jar>

      Deployment descriptor for the MDBTest
      <display-name>XferAgent</display-name>
      <enterprise-beans>

      <message-driven>
      Mdb for messages recieved about the test
      <display-name>Message Driven Bean MdbTest</display-name>
      <ejb-name>MdbTest2</ejb-name>
      <ejb-class>com.iratensolutions.mdbDB.MdbTest2</ejb-class>
      <transaction-type>Bean</transaction-type>
      <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
      <message-driven-destination>
      <destination-type>javax.jms.Topic</destination-type>
      <subscription-durability>NotDurable</subscription-durability>
      </message-driven-destination>

      <ejb-local-ref>
      <ejb-ref-name>ejb/SessionTestLocalHome</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      <local-home>com.iratensolutions.mdbDB.SessionTestLocalHome</local-home>
      com.iratensolutions.mdbDB.SessionTestLocal
      <ejb-link>SessionTestBean</ejb-link>
      </ejb-local-ref>
      </message-driven>


      <ejb-name>SessionTestBean</ejb-name>
      <local-home>com.iratensolutions.mdbDB.SessionTestLocalHome</local-home>
      com.iratensolutions.mdbDB.SessionTestLocal
      <ejb-class>com.iratensolutions.mdbDB.SessionTestBean</ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Bean</transaction-type>

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



      </enterprise-beans>
      </ejb-jar>

      jboss.xml:

      <?xml version="1.0" encoding="UTF-8"?>

      <!DOCTYPE jboss PUBLIC
      "-//JBoss//DTD JBOSS 3.2//EN"
      "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">


      <enterprise-beans>
      <message-driven>
      <ejb-name>MdbTest2</ejb-name>
      <destination-jndi-name>topic/testTopic</destination-jndi-name>
      </message-driven>



      <ejb-name>SessionTestBean</ejb-name>
      <local-jndi-name>SessionLocalHome</local-jndi-name>
      <jndi-name>SessionLocalHome</jndi-name>
      <resource-ref>
      <res-ref-name>jdbc/AdminDB</res-ref-name>
      <resource-name>AdminDB</resource-name>
      <jndi-name>java:/AdminDB</jndi-name>
      </resource-ref>

      </enterprise-beans>



      Thanks for any help