11 Replies Latest reply on Feb 28, 2005 2:43 PM by Ivan Pechacek

    EntityManagerHibernateSessionFactory not bound

    Bill Burke Master

      Can you log this on jira.jboss.com? I'm doing another mini release on Friday.

      Thanks,

      Bill

        • 1. Re: EntityManagerHibernateSessionFactory not bound
          Bill Burke Master

          Nevermind,

          I just fixed the bug and logged into CVS. Preview 4 should be out on Friday.

          • 2. Re: EntityManagerHibernateSessionFactory not bound
            Ivan Pechacek Newbie

            Just upgraded to EJB3 preview 4 (JBoss 4.0.1SP1) and I am getting the same error when my session bean is accessing "EntityManager" -- and it has worked fine in preview 3?

            Any ideas please?

            • 3. Re: EntityManagerHibernateSessionFactory not bound
              Bill Burke Master

              java:comp.ejb3/env/EntityManager?

              • 4. Re: EntityManagerHibernateSessionFactory not bound
                Ivan Pechacek Newbie

                The EntityManager is "injected" inside a session bean:

                 @Inject
                 private EntityManager manager;
                
                


                Also when I deploy the *.ejb3 archive the deployer doesn't notify me about any entity beans being deployed...
                Same package works 100% on preview 3!


                Stack trace:
                14:44:22,343 INFO [STDOUT] java.lang.RuntimeException: javax.naming.NameNotFoundException: EntityManagerHibernateSessionFactory not bound
                14:44:22,343 INFO [STDOUT] at org.jboss.ejb3.entity.EntityManagerImpl.getSession(EntityManagerImpl.java:143)
                14:44:22,343 INFO [STDOUT] at org.jboss.ejb3.entity.EntityManagerImpl.createQuery(EntityManagerImpl.java:39)
                


                • 5. Re: EntityManagerHibernateSessionFactory not bound
                  Ivan Pechacek Newbie

                  Complete stack trace is here:

                  14:59:45,640 INFO [STDOUT] java.lang.RuntimeException: javax.naming.NameNotFoun
                  dException: EntityManagerHibernateSessionFactory not bound
                  14:59:45,640 INFO [STDOUT] at org.jboss.ejb3.entity.EntityManagerImpl.getSe
                  ssion(EntityManagerImpl.java:143)
                  14:59:45,640 INFO [STDOUT] at org.jboss.ejb3.entity.EntityManagerImpl.creat
                  eQuery(EntityManagerImpl.java:39)
                  14:59:45,640 INFO [STDOUT] at uk.mediatel.eval.ejb3.CompanyBean.removeAll(C
                  ompanyBean.java:52)
                  14:59:45,640 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(
                  Native Method)
                  14:59:45,640 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(N
                  ativeMethodAccessorImpl.java:39)
                  14:59:45,640 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invo
                  ke(DelegatingMethodAccessorImpl.java:25)
                  14:59:45,640 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:5
                  85)
                  14:59:45,640 INFO [STDOUT] at org.jboss.aop.joinpoint.MethodInvocation.invo
                  keNext(MethodInvocation.java:77)
                  14:59:45,640 INFO [STDOUT] at org.jboss.aspects.tx.TxSupport.invokeInOurTx(
                  TxSupport.java:141)
                  14:59:45,640 INFO [STDOUT] at org.jboss.aspects.tx.TxSupport$Required.serve
                  rInvoke(TxSupport.java:438)
                  14:59:45,640 INFO [STDOUT] at org.jboss.aspects.tx.TxInterceptor.internalIn
                  voke(TxInterceptor.java:112)
                  14:59:45,640 INFO [STDOUT] at org.jboss.aspects.tx.TxInterceptor.invoke(TxI
                  nterceptor.java:60)
                  14:59:45,640 INFO [STDOUT] at org.jboss.aop.joinpoint.MethodInvocation.invo
                  keNext(MethodInvocation.java:66)
                  14:59:45,640 INFO [STDOUT] at org.jboss.aspects.tx.TxPropagationInterceptor
                  .invoke(TxPropagationInterceptor.java:72)
                  14:59:45,640 INFO [STDOUT] at org.jboss.aop.joinpoint.MethodInvocation.invo
                  keNext(MethodInvocation.java:66)
                  14:59:45,640 INFO [STDOUT] at org.jboss.ejb3.stateless.StatelessInstanceInt
                  erceptor.invoke(StatelessInstanceInterceptor.java:36)
                  14:59:45,640 INFO [STDOUT] at org.jboss.aop.joinpoint.MethodInvocation.invo
                  keNext(MethodInvocation.java:66)
                  14:59:45,640 INFO [STDOUT] at org.jboss.aspects.security.AuthenticationInte
                  rceptor.invoke(AuthenticationInterceptor.java:80)
                  14:59:45,640 INFO [STDOUT] at org.jboss.aop.joinpoint.MethodInvocation.invo
                  keNext(MethodInvocation.java:66)
                  14:59:45,640 INFO [STDOUT] at org.jboss.ejb3.asynchronous.AsynchronousInter
                  ceptor.invoke(AsynchronousInterceptor.java:90)
                  14:59:45,640 INFO [STDOUT] at org.jboss.aop.joinpoint.MethodInvocation.invo
                  keNext(MethodInvocation.java:66)
                  14:59:45,640 INFO [STDOUT] at org.jboss.ejb3.stateless.StatelessContainer.d
                  ynamicInvoke(StatelessContainer.java:165)
                  14:59:45,640 INFO [STDOUT] at org.jboss.aop.Dispatcher.invoke(Dispatcher.ja
                  va:102)
                  14:59:45,640 INFO [STDOUT] at org.jboss.aspects.remoting.AOPRemotingInvocat
                  ionHandler.invoke(AOPRemotingInvocationHandler.java:74)
                  14:59:45,640 INFO [STDOUT] at org.jboss.remoting.ServerInvoker.invoke(Serve
                  rInvoker.java:295)
                  14:59:45,640 INFO [STDOUT] at org.jboss.remoting.ServerInvoker.invoke(Serve
                  rInvoker.java:169)
                  14:59:45,640 INFO [STDOUT] at org.jboss.remoting.transport.socket.ServerThr
                  ead.processInvocation(ServerThread.java:259)
                  14:59:45,656 INFO [STDOUT] at org.jboss.remoting.transport.socket.ServerThr
                  ead.dorun(ServerThread.java:308)
                  14:59:45,656 INFO [STDOUT] at org.jboss.remoting.transport.socket.ServerThr
                  ead.run(ServerThread.java:141)
                  14:59:45,656 INFO [STDOUT] Caused by: javax.naming.NameNotFoundException: Entit
                  yManagerHibernateSessionFactory not bound
                  14:59:45,656 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(Naming
                  Server.java:491)
                  14:59:45,656 INFO [STDOUT] at org.jnp.server.NamingServer.getBinding(Naming
                  Server.java:499)
                  14:59:45,656 INFO [STDOUT] at org.jnp.server.NamingServer.getObject(NamingS
                  erver.java:505)
                  14:59:45,656 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServ
                  er.java:278)
                  14:59:45,656 INFO [STDOUT] at org.jnp.server.NamingServer.lookup(NamingServ
                  er.java:252)
                  14:59:45,656 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(Namin
                  gContext.java:544)
                  14:59:45,656 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(Namin
                  gContext.java:658)
                  14:59:45,656 INFO [STDOUT] at org.jnp.interfaces.NamingContext.lookup(Namin
                  gContext.java:520)
                  14:59:45,656 INFO [STDOUT] at javax.naming.InitialContext.lookup(InitialCon
                  text.java:351)
                  14:59:45,656 INFO [STDOUT] at org.jboss.ejb3.entity.EntityManagerImpl.getSe
                  ssion(EntityManagerImpl.java:139)
                  14:59:45,656 INFO [STDOUT] ... 28 more
                  


                  • 6. Re: EntityManagerHibernateSessionFactory not bound
                    Bill Burke Master

                    FYI,

                    @javax.ejb.Entity has been moved to

                    @javax.persistence.Entity to comply with the specification.


                    Maybe this is your problem?

                    • 7. Re: EntityManagerHibernateSessionFactory not bound
                      Manuel Beyeler Newbie

                      I had exactly the same problem while upgrading from preview 3 to preview 4.

                      I found out that a complete rebuild of the application with the new lib's of the preview 4 fixes the problem. I don't know why, but it works in my case.

                      schoetz

                      • 8. Re: EntityManagerHibernateSessionFactory not bound
                        Bill Burke Master

                        Looks like the annotation problem. You would need a complete rebuild because annotation information is embedded in the class file it is applied to. So the old class file will still be referenced javax.ejb.Entity rather than javax.persistence.Entity.

                        Bill

                        • 9. Re: EntityManagerHibernateSessionFactory not bound
                          Ivan Pechacek Newbie

                          Thank you Bill - you were 100% right --> javax.ejb.Entity has been referenced and therefore all entity beans ignored by ejb3 deployer.

                          I wish some acknowledgement was made regarding this on preview 4 release. Also JBoss IDE (preview 1.5) have old javax.ejb.* classes and therefore I didn't get any warnings regarding this too...

                          • 11. Re: EntityManagerHibernateSessionFactory not bound
                            Ivan Pechacek Newbie

                            OK -- my aplology for being blind... ;-)