Junit test with Osgi doesn't start the Jpa component
We're using OSGI and want to write a开发者_如何学运维 JUnit Systemtest. We have one component, that interacts with the database using the Java Persistence API (JPA). When we're launching the test, we get an error message, that the database component couldn't be activated.
We think, that this error occurs, because jpa doesn't find the persistence.xml. But we tried copying the file on quite every possible location we could think of. Everytime the same error occured. Does anybody know a solution?
osgi> 10:03:49.461 [Component Resolve Thread] DEBUG f.d.s.system.test.SystemTest - started ERROR 22 [SCR] Cannot activate instance ...
No Persistence provider for EntityManager named bus.database So there is no JPA implementation present in the CLASSPATH. Obviously depends if "bus.database" is specified to only run on a specific JPA implementation (provider).
Try to implement your system test with Pax Exam. You have to define all required bundles for your test (e.g. JPA implementation bundle, your component etc.).
精彩评论