-->
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: Annotations scanning not working properly in JBoss 5.1
PostPosted: Wed Aug 05, 2009 10:17 pm 
Newbie

Joined: Tue Aug 04, 2009 6:01 pm
Posts: 4
I'm trying to upgrade my spring + jpa(hibernate) application to JBoss 5 and am noticing that hibernate is not finding any of my entities. It works fine when I run it outside of the container inside a unit test, but once inside the container it doesn't find my entities. Has anyone experienced anything like this? I'm using the built in hibernate jars and not including any in my war. I'm wondering if it has something to do with those classes being loaded outside of the webapp classloader?

Daniel


Top
 Profile  
 
 Post subject: Re: Annotations scanning not working properly in JBoss 5.1
PostPosted: Wed Aug 05, 2009 11:33 pm 
Newbie

Joined: Tue Aug 04, 2009 6:01 pm
Posts: 4
I can work around this issue by listing the classes in my peristence.xml file. Any suggestions on why the annotation scanning might work in my unit tests but not within JBoss 5 would be greatly appreciated though.

Daniel


Top
 Profile  
 
 Post subject: Re: Annotations scanning not working properly in JBoss 5.1
PostPosted: Thu Aug 06, 2009 9:12 pm 
Newbie

Joined: Thu Aug 06, 2009 9:09 pm
Posts: 2
I am having a similar problem when upgrading from Jboss 4.2.3. Works with JBoss 4.2.3, but fails with JBoss 5.X. I am not using Spring.


Top
 Profile  
 
 Post subject: Re: Annotations scanning not working properly in JBoss 5.1
PostPosted: Fri Aug 07, 2009 12:41 pm 
Newbie

Joined: Thu Aug 06, 2009 9:09 pm
Posts: 2
I fixed my problem by converting my war to a ear and putting my entities in a ejb jar file.


Top
 Profile  
 
 Post subject: Re: Annotations scanning not working properly in JBoss 5.1
PostPosted: Fri Aug 07, 2009 5:29 pm 
Newbie

Joined: Tue Aug 04, 2009 6:01 pm
Posts: 4
Putting them in an ejb jar file is definitely going to work because they are now being managed by the container and are first class ejb3 beans. In my case, I don't want the container to manage the life cycle of my JPA entities. I have aspects of my code base that needs to be self-contained and run with and without an ejb3 container and I don't want to have different configurations for each deployment environment. My configuration works just fine under JBoss 4 without having to list all of the classes in my persistence xml file.


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.