[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-4985) Unable to reference JPA entity beans in a different package

Steve Ebersole (JIRA) noreply at atlassian.com
Fri Aug 19 12:51:02 EDT 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4985?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole updated HHH-4985:
--------------------------------

    Suitable for new contributors: [Yes, likely]
                      Component/s: entity-manager
                    Fix Version/s: 4.0.0.next
                         Assignee: Steve Ebersole
                           Labels: jpa2  (was: )

Going to need a test case illustrating this.  Please see http://www.hibernate.org/issuetracker.html#testcases

> Unable to reference JPA entity beans in a different package
> -----------------------------------------------------------
>
>                 Key: HHH-4985
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4985
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: entity-manager
>         Environment: Hibernate Annotations 3.4.0.GA in Jboss 5.1.0.GA
>            Reporter: Krashan Brahmanjara
>            Assignee: Steve Ebersole
>              Labels: jpa2
>             Fix For: 4.0.0.next
>
>
> Problem described in
> https://forum.hibernate.org/viewtopic.php?f=1&t=998404 
> Example
> Two classes test.jpa.db1.Card ant test.jpa.db2.Cards are in different packages in the same jar and @ManyToOne fails if deployed on Jboss server
> ... but it work if these clases are together in the same package.
> ... it not fails on Weblogic with OpenJpa
> Stack trace
> 09:53:37,609 ERROR [AbstractKernelController] Error installing to Start: name=persistence.unit:unitName=test-services-ear
> .ear/test-services-ejb-3.0.alfa-SNAPSHOT.jar#test-services-jpa state=Create
> org.hibernate.AnnotationException: @OneToOne or @ManyToOne on test.jpa.db1.Card.podm references an unknown ent
> ity: test.jpa.db2.Cards
>         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.jbtest.jpa.deployment.PersistenceUnitDeployment.start(PersistenceUnitDeployment.java:301)
>         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:597)
>         at org.jbtest.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
>         at org.jbtest.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
> Tested workarounds, both doesn't work:
> - adding an orm.xml file with entries like:
>  <entity>test.jpa.db1.Card</entity>
>  <entity>test.jpa.db2.Cards</entity>
> - adding an hibernate extensions to class definition like:
>   @Entity
>   @org.hibernate.annotations.Entity
>   @Table(name = "card")
>     public class Card implements Serializable {

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list