1 Reply Latest reply on Oct 2, 2007 7:37 AM by Daniel Zimmermann

    javax.naming.NameNotFoundException: MySqlDS not bound

    Daniel Zimmermann Newbie

      Hello,

      I'm relativly new to jboss and as you can see on my subject, I've an issue with binding a Datasource.
      Actually I have no further ideas what might be the problem, though I guess it's only a small thing...

      I've tried different things, only to become a feeling about jboss.
      I have already written an Database-connection package using EJB3 but in application context - not in server context.
      Therefore I have re-written it to get those Remote/Local stuff and tried to load it - only the database connection without any application logic behind...

      when I first tried, I forgot the mysql-ds.xml


      13:33:12,421 INFO [EJB3Deployer] Deployed: file:/D:/DiplomArbeit/jboss-4.2.1.GA/server/default/deploy/TologResponderEAR.ear/TologResponderEJB.jar/
      13:33:12,437 INFO [EARDeployer] Started J2EE application: file:/D:/DiplomArbeit/jboss-4.2.1.GA/server/default/deploy/TologResponderEAR.ear/
      13:33:12,437 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

      --- MBeans waiting for other MBeans ---
      ObjectName: persistence.units:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,unitName=tologResponderPU
      State: NOTYETINSTALLED
      I Depend On:
      jboss.jca:name=MySqlDS,service=DataSourceBinding
      Depends On Me:
      jboss.j2ee:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,name=TologDatabaseQueryResponder,service=EJB3
      jboss.j2ee:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,name=TologTestDatabaseQueryResponder,service=EJB3

      ObjectName: jboss.j2ee:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,name=TologDatabaseQueryResponder,service=EJB3
      State: NOTYETINSTALLED
      I Depend On:
      persistence.units:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,unitName=tologResponderPU

      ObjectName: jboss.j2ee:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,name=TologTestDatabaseQueryResponder,service=EJB3
      State: NOTYETINSTALLED
      I Depend On:
      persistence.units:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,unitName=tologResponderPU

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.jca:name=MySqlDS,service=DataSourceBinding
      State: NOTYETINSTALLED
      Depends On Me:
      persistence.units:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,unitName=tologResponderPU



      I though: No Problem and added the -ds.xml


      13:35:23,312 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=MySqlDS' to JNDI name 'java:MySqlDS'
      13:35:23,406 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
      13:35:23,781 INFO [EARDeployer] Init J2EE application: file:/D:/DiplomArbeit/jboss-4.2.1.GA/server/default/deploy/TologResponderEAR.ear/
      13:35:24,875 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.entity.PersistenceUnitDeployment
      13:35:24,875 INFO [JmxKernelAbstraction] installing MBean: persistence.units:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,unitName=tologResponderPU with dependencies:
      13:35:24,875 INFO [JmxKernelAbstraction] jboss.jca:name=MySqlDS,service=DataSourceBinding
      13:35:24,890 INFO [PersistenceUnitDeployment] Starting persistence unit persistence.units:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,unitName=tologResponderPU
      13:35:24,921 WARN [ServiceController] Problem starting service persistence.units:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,unitName=tologResponderPU
      javax.naming.NameNotFoundException: MySqlDS not bound
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
      at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
      at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
      at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:589)
      at javax.naming.InitialContext.lookup(Unknown Source)

      ...

      13:35:25,078 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      13:35:25,093 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,name=TologDatabaseQueryResponder,service=EJB3 with dependencies:
      13:35:25,093 INFO [JmxKernelAbstraction] persistence.units:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,unitName=tologResponderPU
      13:35:25,093 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
      13:35:25,093 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,name=TologTestDatabaseQueryResponder,service=EJB3 with dependencies:
      13:35:25,093 INFO [JmxKernelAbstraction] persistence.units:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,unitName=tologResponderPU
      13:35:25,109 INFO [EJB3Deployer] Deployed: file:/D:/DiplomArbeit/jboss-4.2.1.GA/server/default/deploy/TologResponderEAR.ear/TologResponderEJB.jar/
      13:35:25,140 INFO [EARDeployer] Started J2EE application: file:/D:/DiplomArbeit/jboss-4.2.1.GA/server/default/deploy/TologResponderEAR.ear/
      13:35:25,140 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

      --- MBeans waiting for other MBeans ---
      ObjectName: persistence.units:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,unitName=tologResponderPU
      State: FAILED
      Reason: javax.naming.NameNotFoundException: MySqlDS not bound
      I Depend On:
      jboss.jca:service=DataSourceBinding,name=MySqlDS
      Depends On Me:
      jboss.j2ee:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,name=TologDatabaseQueryResponder,service=EJB3
      jboss.j2ee:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,name=TologTestDatabaseQueryResponder,service=EJB3

      ObjectName: jboss.j2ee:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,name=TologDatabaseQueryResponder,service=EJB3
      State: NOTYETINSTALLED
      I Depend On:
      persistence.units:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,unitName=tologResponderPU

      ObjectName: jboss.j2ee:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,name=TologTestDatabaseQueryResponder,service=EJB3
      State: NOTYETINSTALLED
      I Depend On:
      persistence.units:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,unitName=tologResponderPU

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: persistence.units:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,unitName=tologResponderPU
      State: FAILED
      Reason: javax.naming.NameNotFoundException: MySqlDS not bound
      I Depend On:
      jboss.jca:service=DataSourceBinding,name=MySqlDS
      Depends On Me:
      jboss.j2ee:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,name=TologDatabaseQueryResponder,service=EJB3
      jboss.j2ee:ear=TologResponderEAR.ear,jar=TologResponderEJB.jar,name=TologTestDatabaseQueryResponder,service=EJB3


      As I said, I have those Remote/Local stuff (these interfaces, which have to be implemented)

      import javax.ejb.Local;
      
      @Local
      public interface TologDatabaseQueryResponderLocal extends DatabaseQueryResponderInterface
      {
       public void test();
      }
      


      But I think, that doesn't really matters, does it?

      Have anyone of you an idea, what I have done wrong???

      Thanks and Greetings
      BGMF

      PS: my MySqlDS:
      <datasources>
       <local-tx-datasource>
       <jndi-name>MySqlDS</jndi-name>
       <connection-url>jdbc:mysql://mysql-hostname:3306/mydb</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <user-name>user</user-name>
       <password>pw</password>
       <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
       <!-- should only be used on drivers after 3.22.1 with "ping" support
       <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
       -->
       <!-- sql to call when connection is created
       <new-connection-sql>some arbitrary sql</new-connection-sql>
       -->
       <!-- sql to call on an existing pooled connection when it is obtained from pool - MySQLValidConnectionChecker is preferred for newer drivers
       <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
       -->
      
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
       <metadata>
       <type-mapping>mySQL</type-mapping>
       </metadata>
       </local-tx-datasource>
      </datasources>
      


      PPS: I'm using jboss 4.2.1GA on an WinXP-system using MyEclipse for developing

      PPPS: mysql connector added to jboss via external lib-folder and in jboss classpath - but: I'm using a MySQL Server 5.0 and the mysql-connector-5.0.7