3 Replies Latest reply on Jun 19, 2006 5:14 AM by Marc Reis

    Dependency problem deploying EJB3 persistence unit

    Scott Balmos Newbie

      Hi all,

      I'm at a loss on what to fix to handle this. I have an app that used to run under 4.0.3 and standard Hibernate persistence. Yesterday I rewrote the entity classes with annotations and packaged everything up to be EJB3 compatible. However, the deployer always complains about an uninstalled depedency on the ManagedConnectionFactory of the database. But, as shown in the logs, the database connection is being deployed beforehand correctly. The only difference is in the service name. It's deployed as DataSourceBinding, but the EJB3 persistence engine expects ManagedConnectionFactory.

      Can anyone provide any advice? Thanks!

      postgresql-ds.xml (in META-INF/ of the EAR):

      <local-tx-datasource>
      <jndi-name>/simunex/DbConPool</jndi-name>
      <connection-url>jdbc:postgresql://localhost/snx_bedb</connection-url>
      <driver-class>org.postgresql.Driver</driver-class>
      <user-name></user-name>


      <set-tx-query-timeout/>
      <query-timeout>300</query-timeout>

      <min-pool-size>5</min-pool-size>
      <max-pool-size>20</max-pool-size>

      <idle-timeout-minutes>5</idle-timeout-minutes>
      </local-tx-datasource>


      postgresql-ds.xml is referenced in a tag block in the EAR's META-INF/jboss-app.xml

      persistence.xml (in /META_INF of container-EAR/persistence-jar.jar):
      <persistence xmlns="http://java.sun.com/xml/ns/persistence"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
      version="1.0">
      <persistence-unit name="simunex">
      <jta-data-source>java:/simunex/DbConPool</jta-data-source>









      </persistence-unit>


      Deployment log:
      09:37:18,499 INFO [EARDeployer] Init J2EE application: file:/C:/Documents and Settings/Scott/My Documents/IdeaProjects/SimuNex/Backend/SimuNex-Backend.ear
      09:37:23,116 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=/simunex/DbConPool' to JNDI name 'java:/simunex/DbConPool'
      09:37:23,246 INFO [JmxKernelAbstraction] installing MBean: persistence.units:ear=SimuNex-Backend.ear,unitName=simunex with dependencies:
      09:37:23,246 INFO [JmxKernelAbstraction] jboss.jca:name=simunex/DbConPool,service=ManagedConnectionFactory
      09:37:23,246 INFO [EJB3Deployer] Deployed: file:/C:/Program Files/jboss-4.0.4.GA/server/default/tmp/deploy/tmp50677SimuNex-Backend.ear-contents/Backend-Types2.jar
      09:37:23,617 INFO [EARDeployer] Started J2EE application: file:/C:/Documents and Settings/Scott/My Documents/IdeaProjects/SimuNex/Backend/SimuNex-Backend.ear
      Incomplete Deployment listing:

      --- MBeans waiting for other MBeans ---
      ObjectName: persistence.units:ear=SimuNex-Backend.ear,unitName=simunex
      State: NOTYETINSTALLED
      I Depend On:
      jboss.jca:name=simunex/DbConPool,service=ManagedConnectionFactory

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: jboss.jca:name=simunex/DbConPool,service=ManagedConnectionFactory
      State: NOTYETINSTALLED
      Depends On Me:
      persistence.units:ear=SimuNex-Backend.ear,unitName=simunex


      at org.jboss.deployment.MainDeployer.checkIncompleteDeployments(MainDeployer.java:1367)
      at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:774)
      at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at sun.reflect.GeneratedMethodAccessor128.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.jmx.connector.invoker.InvokerAdaptorService.invoke(InvokerAdaptorService.java:266)
      at sun.reflect.GeneratedMethodAccessor85.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.invocation.jrmp.server.JRMPProxyFactory.invoke(JRMPProxyFactory.java:179)
      at sun.reflect.GeneratedMethodAccessor84.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
      at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
      at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
      at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
      at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:819)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:420)
      at sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
      at sun.rmi.transport.Transport$1.run(Transport.java:153)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      at java.lang.Thread.run(Thread.java:595)
      [2006-06-07 09:37:23,657] Module Backend: Error during module deployment. See server log for details.