I am confused about class visibility in OSGi. I run Apache Felix and download the following packages:
antlr
asm
jpa
core
javax.persistence
com.mysql.jdbc
persistence.xml
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.
OSGi Hibernate JDBC, , , .
, JDBC persistence.xml PU?
EclipseLink extender PU. , , persistence.xml, . , PU , persistence.xml, JDBC.
. EclipseLink JDBC- ( ) - , , , PU JDBC.
, OSGi-ified, EclipseLink.
, pdf : http://www.martinlippert.org/events/WJAX2008-ClassloadingTypeVisibilityOSGi.pdf
Source: https://habr.com/ru/post/1715078/More articles:Can I trust the Cocoa API to not fail, or do I need to fully check? - cocoa-touchTurn off anti-aliasing in Lรถve2D - luaHow to dynamically register in jquery custom events? - javascriptAutomatic data access level - c #boost interprocess: shared memory and stl types - c ++Saving custom files between ClickOnce updates? - clickonceWhat methods do you use to test scalability in web applications? - web-applicationsHow can I display an icon for a file from a Java application? - javaUse WCF to receive any XML message from an MSMQ queue? - c #Moonlight on PowerPC Mac - powerpcAll Articles