In an OSGi environment, how are classes and class loader classes configured?

I am confused about class visibility in OSGi. I run Apache Felix and download the following packages:

  • bags antlr, asm, jpaand corefrom eclipselink
  • OSGi-fied jar for javax.persistence1.99
  • OSGi-fied jar with driver com.mysql.jdbc
  • native package containing annotated entity classes and persistence.xml
  • another native node that calls Persistence.createEntityManagerFactory(String, Map)

Now I am confused which package should be able to see the MySQL driver. I thought it would be a set that creates an EntityManagerFactory, but I get ClassNotFound errors when importing into this manifest. Then I tried to import it from the manifest of the eclipselink package jpa, but again incorrectly. Only when I import it from the manifest of a package containing a persistence block (entity classes and persistence.xml) does it work.

So, it looks like the database driver is being looked at by clasloader for the PU pool, but that doesn't make sense to me. What's happening?

I can not find simple documentation for this. These slides give some clues, but not quite comprehensive.

+3
2

OSGi Hibernate JDBC, , , .

, JDBC persistence.xml PU?

EclipseLink extender PU. , , persistence.xml, . , PU , persistence.xml, JDBC.

. EclipseLink JDBC- ( ) - , , , PU JDBC.

, OSGi-ified, EclipseLink.

+3

Source: https://habr.com/ru/post/1715078/


All Articles