1

Problem : 1. JPA Classes/entities are in Bundle 1 and Bundle 2 using same persistence unit 2. Bundle 3 is trying to access(wrapper APIs for DB API abstraction) the classes in Bundle 1 and Bundle 2. 3. Runtime enhancement is not working.

So what I am planning to do is to enhance the JPA entities using Code, where in just before the bundle 3 comes up, these entities in Bundle 1 could be enhanced. I am planning doing this as the runtime enhancement does not complete and the bundle 3 comes up . This leads to DB APIs(Bundle 3 APIs) failure as tables are not created.

user3604158
  • 55
  • 1
  • 1
  • 5
  • Why don't you use compile time enhancement? OpenJPA can do that for you. Runtime bytecode manipulation is a very evil thing in my opinion and should be avoided. – Balazs Zsoldos Sep 12 '14 at 13:26

1 Answers1

1

We had the same problem in a former project with openjpa and OSGi. Luckily, OpenJPA supports compile time enhancement which could be done via the openjpa maven plugin as described here: http://openjpa.apache.org/enhancement-with-maven.html

And there is also an eclipse maven connector which supports runtime-enhancement inside the IDE, which is really comfortable if you want to use remote deployment. http://openjpa-maven-connector.googlecode.com/svn/trunk/

Martin Baumgartner
  • 3,524
  • 3
  • 20
  • 31