3 Replies Latest reply on Oct 25, 2009 7:18 PM by Ignacio de Cordoba

    Migrating .ear to JBoss 5 with several EJB3 Jars inside

    Ignacio de Cordoba Novice

      I am migrating to JBoss 5 from Jboss 4.0.3
      My application is packed in an .ear file with multiple .jar files inside.

      All share a common persistence unit and have relations between them. This works OK in JBoss 4.0.3 (To make it work I had to include all EJBs in the orm.xml file in the .ear META-INF dir)

      Now, when deploying this same .ear in JBoss 5 I find that EJBs in a jar file is not visible to EJBs in another jar (even they are in the same .ear file and they all appear in orm.xml file as exposed)
      Am I missing something that I must include in JBoss 5?

      This is one of the multiple errors I get:
      com.servengine.dns.VirtualHost and com.servengine.portal.Portal are the entities packed echaone in a different jar.

      2009-10-09 11:43:54,073 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] (main) Error installing to Start: name=persistence.unit:unitName=tuportal3.ear/ServEngineDNSEJB.jar#mainPersistenceUnit state=Create
      org.hibernate.AnnotationException: @OneToOne or @ManyToOne on com.servengine.dns.VirtualHost.portal references an unknown entity: com.servengine.portal.Portal
       at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:81)
       at org.hibernate.cfg.AnnotationConfiguration.processEndOfQueue(AnnotationConfiguration.java:456)
       at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:438)
       at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:309)
       at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1148)
       at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1226)
       at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:173)
       at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
       at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:425)
       at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:131)
       at org.jboss.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:301)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      I have read docs but have no info about this. Do I have to repack my EJBs all in one ear?
      Thanks for any directions.