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
|