-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate unknown entity problem in OSGI bundles
PostPosted: Mon Dec 07, 2009 9:28 am 
Newbie

Joined: Mon Dec 07, 2009 9:07 am
Posts: 2
Hello,

Please assume you have ordinary two osgi bundles with activator of theirselves. One of the bundles for persistency service (bundle A), working such a way that it has a method with argument Object type so that it can accept any pojo to persist.

Second bundle (bundle B) is a simple bundle which has a pojo object within. Bundle B gets the bundle A as a service and calls bundle A's store method as giving a "new pojo()" as the argument.

i tested a lot. in bundle A's store method we have the answer of "object.getClass().isAnnotationPresent(javax.persistence.Entity.class)" as false.

if you move the pojo class in bundle A and in store method you set the object with "new pojo()", everything works well, pojo gets saved, you see it in DB.

i tried also buddy loading thing by setting manifest files. bundleA is added with "Eclipse-BuddyPolicy: registered" and bundleB "Eclipse-RegisterBuddy: <bundlenameA>". nothing changed.

i am kind of stuck with that "org.hibernate.MappingException: Unknown entity:" error at the line with code "session.save(object);"

Regards


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

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.