7 Replies Latest reply on Jan 9, 2006 5:33 PM by Bill Burke

    Session Bean can not find Entity Manager

    Julian Htun Newbie



      I have checkout jboss-head and build it. I follow the TrailBlazer example.

      [ Entity Beans PAR file ]
      author.par
      --META-INF
      -- -- persistence.xml
      -- -- MANIFEST.MF
      -- -- org/jboss/ejb3demo/Article.class
      -- -- org/jboss/ejb3demo/Author.class

      [ Session Beans Archive ]
      authors-bean.ejb3
      -- org/jboss/ejb3demo/Authors.class
      -- org/jboss/ejb3demo/AuthorsBean.class

      Article.class and Author.class are entity beans.

      persistence.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <entity-manager>
       <name>articles</name>
       <jta-data-source>java:/DefaultDS</jta-data-source>
       <properties>
       <property name="hibernate.hbm2ddl.auto"
       value="create-drop"/>
       </properties>
      </entity-manager>


      AuthorBeans.java:

      @Stateless
      @Remote(Authors.class)
      public class AuthorsBean implements Authors
      {
       @PersistenceContext(unitName="articles")
       private EntityManager manager;
      
       public void addArticle(Author author, String title, String body)
       {
       manager.persist(author);
       author.addArticle(title, body);
       }
      . . . .
      }


      When Entity is deployed:

      Info Message:

      00:03:17,921 INFO [JaccHelper] JACC Policy Configuration for deployment has been put in service
      00:03:17,921 INFO [Ejb3Deployment] EJB3 deployment time took: 15
      00:03:17,921 INFO [EJB3Deployer] Deployed: file:/C:/jboss/server/all/deploy/author.par


      Error Message:

      00:03:48,093 INFO [EJB3Deployer] Deployed: file:/C:/jboss/server/all/deploy/authors-beans.ejb3
      00:03:48,109 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

      --- MBeans waiting for other MBeans ---
      ObjectName: jboss.j2ee:service=EJB3,name=AuthorsBean
      State: NOTYETINSTALLED
      I Depend On:
      entity.manager:name=articles

      --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
      ObjectName: entity.manager:name=articles
      State: NOTYETINSTALLED
      Depends On Me:
      jboss.j2ee:service=EJB3,name=AuthorsBean


      What am I doing wrong?

      Thanks,
      -Julian




        • 1. Re: Session Bean can not find Entity Manager
          YCS WYW Newbie

          It seems that schema of "persistence.xml" has been changed with xmlns="http://java.sun.com/xml/ns/persistence".

          Try with this other one "persistence.xml":

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

          <persistence-unit name="articles" transaction-type="JTA">
          <jta-data-source>java:/DefaultDS</jta-data-source>



          </persistence-unit>

          • 2. Re: Session Bean can not find Entity Manager
            YCS WYW Newbie

            Sorry, the previous XML has been submited incorrectly:

            &lt;?xml version="1.0" encoding="UTF-8"?&gt;
            &lt;persistence xmlns="http://java.sun.com/xml/ns/persistence"&gt;
            &lt;persistence-unit name="articles" transaction-type="JTA"&gt;
            &lt;jta-data-source&gt;java:/DefaultDS&lt;/jta-data-source&gt;
            &lt;properties&gt;
            &lt;property name="hibernate.hbm2ddl.auto"
            value="create-drop"/&gt;
            &lt;/properties&gt;
            &lt;/persistence-unit&gt;
            &lt;/persistence&gt;

            • 3. Re: Session Bean can not find Entity Manager
              YCS WYW Newbie

              Maybe now:

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

              <persistence-unit name="articles" transaction-type="JTA">
              <jta-data-source>java:/DefaultDS</jta-data-source>



              </persistence-unit>

              • 4. Re: Session Bean can not find Entity Manager
                YCS WYW Newbie

                Try with this other one "persistence.xml":

                <?xml version="1.0" encoding="UTF-8"?>
                <persistence xmlns="http://java.sun.com/xml/ns/persistence">
                 <persistence-unit name="articles" transaction-type="JTA">
                 <jta-data-source>java:/DefaultDS</jta-data-source>
                 <properties>
                 <property name="hibernate.hbm2ddl.auto"
                 value="create-drop"/>
                 </properties>
                 </persistence-unit>
                </persistence>
                


                • 5. Re: Session Bean can not find Entity Manager
                  Julian Htun Newbie



                  Now I get the following:

                  12:56:22,935 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.entity.PersistenceUnitDeployment
                  12:56:22,935 INFO [JmxKernelAbstraction] installing MBean: entity.manager:name=articles with dependencies:
                  12:56:22,935 INFO [JmxKernelAbstraction] jboss.jca:name=DefaultDS,service=DataSourceBinding
                  12:56:22,982 INFO [Ejb3Configuration] found EJB3 Entity bean: org.jboss.ejb3demo.Article
                  12:56:22,997 WARN [ServiceController] Problem starting service entity.manager:name=articles
                  java.lang.reflect.InvocationTargetException
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:87)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  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:157)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:957)
                  at $Proxy0.start(Unknown Source)
                  at org.jboss.system.ServiceController.start(ServiceController.java:442)
                  at sun.reflect.GeneratedMethodAccessor8.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:157)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
                  at $Proxy94.start(Unknown Source)
                  at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:76)
                  at org.jboss.ejb3.Ejb3Deployment.startEntityManagerDeployment(Ejb3Deployment.java:480)
                  at org.jboss.ejb3.Ejb3Deployment.initializeManagedEntityManagerFactory(Ejb3Deployment.java:456)
                  at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:335)
                  at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:110)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:243)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  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:157)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:957)
                  at $Proxy0.create(Unknown Source)
                  at org.jboss.system.ServiceController.create(ServiceController.java:355)
                  at org.jboss.system.ServiceController.create(ServiceController.java:299)
                  at sun.reflect.GeneratedMethodAccessor2.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:157)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
                  at $Proxy29.create(Unknown Source)
                  at org.jboss.ejb3.EJB3Deployer.create(EJB3Deployer.java:357)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  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:157)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
                  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
                  at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:96)
                  at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:237)
                  at org.jboss.ws.server.WebServiceDeployer.create(WebServiceDeployer.java:95)
                  at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:175)
                  at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:92)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
                  at $Proxy30.create(Unknown Source)
                  at org.jboss.deployment.MainDeployer.create(MainDeployer.java:948)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:802)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
                  at sun.reflect.GeneratedMethodAccessor22.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:157)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
                  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
                  at $Proxy9.deploy(Unknown Source)
                  at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:334)
                  at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:522)
                  at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:207)
                  at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:218)
                  at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:197)
                  Caused by: org.hibernate.AnnotationException: Annotated class should have a @javax.persistence.Entity, @javax.persistence.Embeddable or @javax.persistence.EmbeddedSuperclass annotation: org.jboss.ejb3demo.Author
                  at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:321)
                  at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:266)
                  at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:199)
                  at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:996)
                  at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:695)
                  at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:161)
                  at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:541)
                  at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:231)
                  at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:87)
                  at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:231)
                  ... 100 more
                  12:56:23,013 INFO [JaccHelper] JACC Policy Configuration for deployment has been put in service
                  12:56:23,013 INFO [Ejb3Deployment] EJB3 deployment time took: 94
                  12:56:23,013 INFO [EJB3Deployer] Deployed: file:/C:/jboss/server/all/deploy/author.par
                  12:56:23,013 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

                  --- MBeans waiting for other MBeans ---
                  ObjectName: entity.manager:name=articles
                  State: FAILED
                  Reason: java.lang.reflect.InvocationTargetException
                  I Depend On:
                  jboss.jca:service=DataSourceBinding,name=DefaultDS

                  --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
                  ObjectName: entity.manager:name=articles
                  State: FAILED
                  Reason: java.lang.reflect.InvocationTargetException
                  I Depend On:
                  jboss.jca:service=DataSourceBinding,name=DefaultDS


                  12:59:18,779 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.entity.PersistenceUnitDeployment
                  12:59:18,779 INFO [JmxKernelAbstraction] installing MBean: entity.manager:name=articles with dependencies:
                  12:59:18,779 INFO [JmxKernelAbstraction] jboss.jca:name=DefaultDS,service=DataSourceBinding
                  12:59:18,810 INFO [Ejb3Configuration] found EJB3 Entity bean: org.jboss.ejb3demo.Article
                  12:59:18,825 INFO [AnnotationBinder] Binding entity from annotated class: org.jboss.ejb3demo.Article
                  12:59:18,825 INFO [EntityBinder] Bind entity org.jboss.ejb3demo.Article on table Article
                  12:59:18,841 WARN [ServiceController] Problem starting service entity.manager:name=articles
                  java.lang.reflect.InvocationTargetException
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:585)
                  at org.jboss.ejb3.ServiceDelegateWrapper.startService(ServiceDelegateWrapper.java:87)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  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:157)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:957)
                  at $Proxy0.start(Unknown Source)
                  at org.jboss.system.ServiceController.start(ServiceController.java:442)
                  at sun.reflect.GeneratedMethodAccessor8.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:157)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
                  at $Proxy96.start(Unknown Source)
                  at org.jboss.ejb3.JmxKernelAbstraction.install(JmxKernelAbstraction.java:76)
                  at org.jboss.ejb3.Ejb3Deployment.startEntityManagerDeployment(Ejb3Deployment.java:480)
                  at org.jboss.ejb3.Ejb3Deployment.initializeManagedEntityManagerFactory(Ejb3Deployment.java:456)
                  at org.jboss.ejb3.Ejb3Deployment.create(Ejb3Deployment.java:335)
                  at org.jboss.ejb3.Ejb3Module.createService(Ejb3Module.java:110)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalCreate(ServiceMBeanSupport.java:260)
                  at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:243)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  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:157)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                  at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:957)
                  at $Proxy0.create(Unknown Source)
                  at org.jboss.system.ServiceController.create(ServiceController.java:355)
                  at org.jboss.system.ServiceController.create(ServiceController.java:299)
                  at sun.reflect.GeneratedMethodAccessor2.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:157)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
                  at $Proxy29.create(Unknown Source)
                  at org.jboss.ejb3.EJB3Deployer.create(EJB3Deployer.java:357)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  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:157)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
                  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
                  at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:96)
                  at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:237)
                  at org.jboss.ws.server.WebServiceDeployer.create(WebServiceDeployer.java:95)
                  at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:175)
                  at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:92)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
                  at $Proxy30.create(Unknown Source)
                  at org.jboss.deployment.MainDeployer.create(MainDeployer.java:948)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:802)
                  at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
                  at sun.reflect.GeneratedMethodAccessor22.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:157)
                  at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
                  at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
                  at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
                  at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
                  at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:262)
                  at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
                  at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:190)
                  at $Proxy9.deploy(Unknown Source)
                  at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:334)
                  at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:522)
                  at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:207)
                  at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:218)
                  at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:197)
                  Caused by: org.hibernate.AnnotationException: @OneToOne or @ManyToOne on org.jboss.ejb3demo.Article.author references an unknown entity: org.jboss.ejb3demo.Author
                  at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:39)
                  at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:222)
                  at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:996)
                  at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:695)
                  at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:161)
                  at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:541)
                  at org.hibernate.ejb.Ejb3Configuration.createContainerEntityManagerFactory(Ejb3Configuration.java:231)
                  at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:87)
                  at org.jboss.ejb3.entity.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:231)
                  ... 100 more
                  12:59:18,857 INFO [JaccHelper] JACC Policy Configuration for deployment has been put in service
                  12:59:18,857 INFO [Ejb3Deployment] EJB3 deployment time took: 94
                  12:59:18,857 INFO [EJB3Deployer] Deployed: file:/C:/jboss/server/all/deploy/author.par
                  12:59:18,857 ERROR [URLDeploymentScanner] Incomplete Deployment listing:

                  --- MBeans waiting for other MBeans ---
                  ObjectName: entity.manager:name=articles
                  State: FAILED
                  Reason: java.lang.reflect.InvocationTargetException
                  I Depend On:
                  jboss.jca:service=DataSourceBinding,name=DefaultDS

                  --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
                  ObjectName: entity.manager:name=articles
                  State: FAILED
                  Reason: java.lang.reflect.InvocationTargetException
                  I Depend On:
                  jboss.jca:service=DataSourceBinding,name=DefaultDS


                  • 6. Re: Session Bean can not find Entity Manager
                    Julian Htun Newbie

                    The error was obvious - I forgot @Entity on Author class.