7 Replies Latest reply on Sep 13, 2005 11:41 PM by nectodev

    Problem while deploying  ejb3 entity beans: "Unable to find

    nectodev


      The application currently has 15 entity beans and i get this obscure error

      ..........
      ........
      ....
      
      06:58:32,868 INFO [HibernatePersistence] found EJB3 Entity bean: com.nectosoft.pu.domain.Seat
      06:58:32,878 INFO [HibernatePersistence] found EJB3 Entity bean: com.nectosoft.pu.domain.User
      06:58:32,888 INFO [HibernatePersistence] found EJB3 Entity bean: com.nectosoft.pu.domain.UserAccount
      06:58:32,888 INFO [HibernatePersistence] found EJB3 Entity bean: com.nectosoft.pu.domain.UserAddress
      06:58:32,888 INFO [HibernatePersistence] found EJB3 Entity bean: com.nectosoft.pu.domain.UserNote
      06:58:32,898 INFO [HibernatePersistence] found EJB3 Entity bean: com.nectosoft.pu.domain.UserPrefs
      06:58:32,908 INFO [HibernatePersistence] found EJB3 Entity bean: com.nectosoft.pu.domain.UserStats
      06:58:33,138 INFO [Environment] Hibernate 3.1 beta 2
      06:58:33,169 INFO [Environment] hibernate.properties not found
      06:58:33,179 INFO [Environment] using CGLIB reflection optimizer
      06:58:33,189 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
      06:58:38,066 WARN [ServiceController] Problem creating service jboss.j2ee:service=EJB3,module=pu_services.ejb3
      org.hibernate.AnnotationException: Unable to find entity javax.persistence.Table
       at org.hibernate.cfg.AnnotationBinder.bindFkSecondPass(AnnotationBinder.java:1480)
       at org.hibernate.cfg.FkSecondPass.secondPass(FkSecondPass.java:37)
       at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:31)
       at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:215)
       at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:876)
       at org.hibernate.ejb.HibernatePersistence.handleListenerCallbacks(HibernatePersistence.java:448)
       at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:4
      ....
      .......
      ..........
      


      My environment is Jboss4.0.3RC2 and MySQL 5.0.x.

      When i was developing the application I had no problem when i had 5 entity beans. And when i further developed the other entity beans i am running into this problem. Checked all the annotations, database for FK mappings and fixed any unintendedi nconsistencies. But I still get this error.

      Clearly the javax.persistence.Table Class is in ejb3-persistence.jar file and that jar is in the ejb3.deployer directory of Jboss "all" server deploy directory.

      Does this problem sound familiar to anyone? At the very least the error message is not very helpful if not misleading.

      Any pointers are deeply appreciatied.


        • 1. Re: Problem while deploying  ejb3 entity beans:
          nectodev

          I also get this error summary from jboss console...

          
          -- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
          ObjectName: jboss.jms:alias=QueueConnectionFactory
           State: FAILED
           Reason: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
          
          ObjectName: jboss.jms:alias=TopicConnectionFactory
           State: FAILED
           Reason: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out]
          
          ObjectName: jboss.j2ee:service=EJB3,module=pu_services.ejb3
           State: FAILED
           Reason: org.hibernate.AnnotationException: Unable to find entity javax.persistence.Table
          


          • 2. Re: Problem while deploying  ejb3 entity beans:
            epbernard

            I'll need to see the entity mappings

            • 3. Re: Problem while deploying  ejb3 entity beans:
              nectodev

              Thanks for the reply. Is there any way i can send this 15 entity bean java files privately instead of publishing them publicly over the forum.

              I look forward to your advice.

              • 4. Re: Problem while deploying  ejb3 entity beans:
                epbernard

                Your problem should arise with 2 or 3 entities, try to isolate it. Otherwise it would be useless for both of us :-(

                • 5. Re: Problem while deploying  ejb3 entity beans:
                  nectodev

                  The problem is that these entities are quite intertwined. I will try to comment out some of the "linkages" and try to isolate them further. I will keep the forum posted.

                  In any case do you agree with the premise that the error message is misleading even assuming that I may have made a mistake in either the ORMappings of entity beans or the schema itself?

                  • 6. Re: Problem while deploying  ejb3 entity beans:
                    epbernard

                    Either I do have a bad bug or you're doing something really weird like using a @Table in a targetEntity

                    • 7. Re: Problem while deploying  ejb3 entity beans:
                      nectodev

                      My sincere apologies. you are right. I goofed up. There was a class com.company.pu.domain.Table in the application which was later refactored to GameTable to avoid name collision with javax.persistence.Table. However for some reason the refactoring did not take place in an EntityBean which was referring to a relation field of Table instead of GameTable. The compiler did not complain becos the javax.persistence.Table was imported for @Table annotation for that entity bean.

                      no wonder JBoss was completely confused how to deal with that.

                      Again my sincere apologies and I leave it to your expertise if Jboss can throw a more meaningful error.

                      Thanks again for taking time out.