-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: Unable to reference JPA entity beans in a different package
PostPosted: Mon Jul 20, 2009 3:21 am 
Newbie

Joined: Mon Jul 20, 2009 3:10 am
Posts: 9
I am getting this error, while trying to deploy beans annotated using JPA. Beans from the second package or referencing beans from the first package and it fails with the following error. What should I do in order to resolve this class loader issue?

org.hibernate.AnnotationException: @OneToOne or @ManyToOne on com.two.domain.Idea.user references an unknown entity: com.one.domain.User: @OneToOne or @ManyToOne on com.two.domain.Idea.user references an unknown entity: com.one.domain.User
...
at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPa
ss.java:81)
at org.hibernate.cfg.AnnotationConfiguration.processEndOfQueue(Anno
tationConfiguration.java:456)
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInO
rder(AnnotationConfiguration.java:438)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(Anno
tationConfiguration.java:309)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java
:1148)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configurat
ion.java:1226)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListe
nerConfigurator.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.createContainerEntityMana
gerFactory(HibernatePersistence.java:131)
... 46 more


Top
 Profile  
 
 Post subject: Re: Unable to reference JPA entity beans in a different package
PostPosted: Tue Jul 21, 2009 1:17 am 
Newbie

Joined: Mon Jul 20, 2009 3:10 am
Posts: 9
The below mentioned issue will not happen if all of the beans can be resolved under a single package folder. This seems to be an issue of resolving beans which are built / packaged in a different folder.

Any pointers to solve this issue are highly appreciated


Top
 Profile  
 
 Post subject: Re: Unable to reference JPA entity beans in a different package
PostPosted: Mon Oct 12, 2009 11:22 am 
Newbie

Joined: Fri Jan 11, 2008 9:03 am
Posts: 1
Any solution?


Top
 Profile  
 
 Post subject: Re: Unable to reference JPA entity beans in a different package
PostPosted: Thu Nov 19, 2009 7:11 am 
Newbie

Joined: Fri Jan 27, 2006 5:13 pm
Posts: 4
Have the same problem. My application grows and using only one package for all entities is terrible. Trying to split them to different packages causes error:

org.hibernate.AnnotationException: @OneToOne or @ManyToOne on xx.db.ClientProduct.client references an unknown entity: xx.yy.db.Client

any solution? is it solvable by replacing annotations by ejb-jar.xml entries?

_________________
CRM SalesMax: unlimited sales


Top
 Profile  
 
 Post subject: Re: Unable to reference JPA entity beans in a different package
PostPosted: Fri Mar 12, 2010 12:16 am 
Newbie

Joined: Mon Jul 20, 2009 3:10 am
Posts: 9
I still haven't seen a solution to this problem and all my entity classes are compiled as a single unit (not into separate jars). This seems to be a very basic requirement, not sure how others are solving this problem though.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.