0 Replies Latest reply on May 28, 2003 6:28 AM by zezile

    jdbc not bound

    zezile Newbie

      Hello
      I have a problem using jboss-3.2.1_tomcat-4.1_02 with windows 2000 avec j2sdk.4_1_0 :
      * running Jboss, I get the messages below:
      Depends On Me: jboss.jca:service=LocalTxCM,name=DefaultDS
      , ObjectName: jboss.jca:service=ManagedConnectionFactory,name=DefaultDS
      state: FAILED
      I Depend On: jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
      ***
      09:53:46,437 WARN [ServiceController] Problem starting service jboss.jca:service=ManagedConnectionFactory,name=DefaultDS
      java.lang.NoClassDefFoundError: org/jboss/resource/JBossResourceException

      sever configurations: (account is my db name)
      *************** mysql-ds.xml ***********

      <local-tx-datasource>
      <jndi-name>DefaultDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/account</connection-url>
      <driver-class>org.gjt.mm.mysql.Driver</driver-class>
      <user-name>root</user-name>

      </local-tx-datasource>


      ************** stadardjaws.xml ***********
      java:/DefaultDS
      <type-mapping>mySQL</type-mapping>

      ************** inside my app
      ************** ejb-jar.xml
      <resource-ref>
      <res-ref-name>jdbc/ejbPool</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      ************* jboss.xml
      <resource-ref>
      <res-ref-name>jdbc/ejbPool</res-ref-name>
      <resource-name>java:/DefaultDS</resource-name>
      <jndi-name>DefaultDS</jndi-name>
      </resource-ref>

      <resource-managers>
      <resource-manager>
      <res-jndi-name>jdbc/ejbPool</res-jndi-name>
      <res-name>DefaultDS</res-name>
      </resource-manager>
      </resource-managers>

      ************ AccountBean.java
      public Connection getConnection()throws Exception{
      javax.sql.DataSource ds=null;
      try {
      Context ctx=new InitialContext();
      ds=(javax.sql.DataSource) ctx.lookup("java:comp/env/jdbc/ejbPool"); >> PB
      } catch (NamingException e) {
      System.err.println("Connection failed ! ");
      e.printStackTrace();
      }
      return ds.getConnection();*/
      return conn;
      }

      >> running my app, I get this message:
      javax.naming.NameNotFoundException: jdbc not bound

      nb: the following connection does work:
      Class.forName("org.gjt.mm.mysql.Driver");
      Connection conn=DriverManager.getConnection("jdbc:mysql://localhost/account", "root", "");

      So, how configure JBoss (or my app) to connect jdbc ?
      Whath is precisely "java:comp/env/jdbc/ejbPool"

      Regards