1 Reply Latest reply on Feb 17, 2003 1:14 PM by faerch

    BMP entity bean using JBoss 3.0.4 and MySQL 4.0.9

    faerch

      Hi

      I am trying to create an BMP entity bean using JBoss 3.0.4, MySQL 4.0.9-gamma and MySQL Connector-J 3.0.5-gamma.

      I have done the following to get connection to MySQL.

      1) Created the following two files in the bmp entity bean:
      - META-INF/jboss.xml
      - META-INF/mysql-service.xml


      2) Edited the two files:
      - conf/standardjaws.xml
      - conf/standardjbosscmp-jdbc.xml

      Replacing lines:
      <datasource-mapping>Hypersonic SQL</datasource-mapping>

      with:
      <datasource-mapping>mySQL</datasource-mapping>


      3) Replaced the Hypersonic datasource:
      - deploy/hsqldb-service.xml
      with:
      - deploy/mysql-default-service.xml


      4) Placed mysql.jar file in the jboss lib directory so its added to the
      classpath.


      After all that is done, when I start JBoss it says:

      ...

      13:53:46,363 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
      -3.0.4/server/default/lib/hsqldb-plugin.jar
      13:53:46,393 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.0.4/server/
      default/lib/hsqldb-plugin.jar

      ...

      13:53:47,986 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
      -3.0.4/server/default/lib/hsqldb.jar
      13:53:48,116 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.0.4/server/
      default/lib/hsqldb.jar

      ...

      13:54:03,478 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
      -3.0.4/server/default/deploy/mysql-default-service.xml

      ...

      13:54:04,589 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss
      -3.0.4/server/default/deploy/accountbean.jar
      13:54:05,851 INFO [EjbModule] Creating
      13:54:05,911 INFO [EjbModule] Deploying Account
      13:54:06,783 INFO [EjbModule] Created
      13:54:06,783 INFO [EjbModule] Starting
      13:54:06,803 WARN [EntityContainer] No resource manager found for DefaultDS
      13:54:06,973 INFO [EjbModule] Started
      13:54:06,973 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.0.4/server/
      default/deploy/accountbean.jar

      ...

      13:54:12,931 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean ope
      ration 'checkIncompleteDeployments()'
      Cause: Incomplete Deployment listing:
      Packages waiting for a deployer:

      Incompletely deployed packages:

      MBeans waiting for classes:

      MBeans waiting for other MBeans:
      [ObjectName: jboss.jca:service=LocalTxCM,name=MySqlDS
      state: CONFIGURED
      I Depend On: jboss.jca:service=LocalTxDS,name=MySqlDS
      jboss.jca:service=LocalTxPool,name=MySqlDS
      jboss.jca:service=CachedConnectionManager
      jboss.security:name=JaasSecurityManager
      jboss.jca:service=RARDeployer

      Depends On Me: ]
      13:54:12,941 INFO [URLDeploymentScanner] Started


      Running the client the console says:
      bmpEntityBean.AccountException: javax.naming.NameNotFoundException: DefaultDS not bound
      at bmpEntityBean.AccountBean.ejbHomeGetTotalBankValue(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      ...


      And the server prints:
      14:26:10,048 INFO [STDOUT] New Bank Account Entity Bean Java Object created by EJB Container.
      14:26:10,058 INFO [STDOUT] setEntityContext called
      14:26:10,078 INFO [STDOUT] ejbHomeGetTotalBankValue()
      14:26:10,078 ERROR [STDERR] Could not locate datasource! Reason:
      14:26:10,078 ERROR [STDERR] javax.naming.NameNotFoundException: DefaultDS not bound
      14:26:10,078 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
      14:26:10,078 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
      14:26:10,078 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
      14:26:10,078 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
      14:26:10,088 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:256)
      14:26:10,088 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:464)
      14:26:10,088 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:592)
      14:26:10,088 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:443)
      14:26:10,088 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:347)
      14:26:10,088 ERROR [STDERR] at bmpEntityBean.AccountBean.getConnection(Unknown Source)
      14:26:10,088 ERROR [STDERR] at bmpEntityBean.AccountBean.ejbHomeGetTotalBankValue(Unknown Source)
      14:26:10,088 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      14:26:10,088 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      14:26:10,088 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      14:26:10,088 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      14:26:10,088 ERROR [STDERR] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1138)
      14:26:10,088 ERROR [STDERR] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:206)
      14:26:10,088 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
      14:26:10,088 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
      14:26:10,098 ERROR [STDERR] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:90)
      14:26:10,098 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
      14:26:10,098 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
      14:26:10,098 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
      14:26:10,098 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
      14:26:10,098 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
      14:26:10,098 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
      14:26:10,098 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
      14:26:10,098 ERROR [STDERR] at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
      14:26:10,098 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:730)
      14:26:10,098 ERROR [STDERR] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
      14:26:10,098 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      14:26:10,098 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
      14:26:10,098 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      14:26:10,108 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      14:26:10,108 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      14:26:10,108 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      14:26:10,108 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      14:26:10,108 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      14:26:10,108 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
      14:26:10,108 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      14:26:10,108 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      14:26:10,108 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      14:26:10,108 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536)
      14:26:10,108 ERROR [STDERR] javax.naming.NameNotFoundException: DefaultDS not bound
      14:26:10,108 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
      14:26:10,108 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
      14:26:10,108 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
      14:26:10,108 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
      14:26:10,118 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:256)
      14:26:10,118 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:464)
      14:26:10,118 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:592)
      14:26:10,118 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:443)
      14:26:10,118 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:347)
      14:26:10,118 ERROR [STDERR] at bmpEntityBean.AccountBean.getConnection(Unknown Source)
      14:26:10,118 ERROR [STDERR] at bmpEntityBean.AccountBean.ejbHomeGetTotalBankValue(Unknown Source)
      14:26:10,118 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      14:26:10,118 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      14:26:10,118 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      14:26:10,118 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      14:26:10,118 ERROR [STDERR] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1138)
      14:26:10,118 ERROR [STDERR] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySynchronizationInterceptor.java:206)
      14:26:10,118 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:215)
      14:26:10,118 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:73)
      14:26:10,128 ERROR [STDERR] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:90)
      14:26:10,128 ERROR [STDERR] at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:79)
      14:26:10,128 ERROR [STDERR] at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:44)
      14:26:10,128 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)
      14:26:10,128 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)
      14:26:10,128 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)
      14:26:10,128 ERROR [STDERR] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:105)
      14:26:10,128 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)
      14:26:10,128 ERROR [STDERR] at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
      14:26:10,128 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:730)
      14:26:10,128 ERROR [STDERR] at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
      14:26:10,128 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      14:26:10,128 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)
      14:26:10,138 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      14:26:10,138 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      14:26:10,138 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      14:26:10,138 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:324)
      14:26:10,138 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
      14:26:10,138 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:148)
      14:26:10,138 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
      14:26:10,138 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
      14:26:10,138 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      14:26:10,138 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      14:26:10,138 ERROR [STDERR] at java.lang.Thread.run(Thread.java:536)


      I have attached the client and server code and the modified jboss conf files.

      If someone could explain the connection between the jndi entries in the different files deployed on the server (ejb-jar.xml, jboss.xml, and mysql-service.xml), I would be thankful.