The following problems may exhibit themselves. Potential solutions are listed underneath each problem.
- EntityManagerFactory service does not appear to be registered
- Possible Cause: The Meta-Persistence header is missing from the bundle manifest, or an improperly specified persistence descriptor path is listed.
- Solution: Examine the Meta-Persistence manifest header and the persistence descriptor value entry to ensure all is correctly specified.
- Possible Cause: The Gemini DBAccess bundle for the JDBC driver has not been started or has not had a chance to register a DataSourceFactory service for the driver before the persistence bundle was processed by Gemini JPA.
- Solution: Ensure the start order causes the DBAccess bundle to be started before the Gemini JPA bundle.
- Possible Cause: The local JDBC driver packaged with the persistence bundle was not able to be found by Gemini JPA.
- Solution: Ensure the JDBC driver is on the Bundle-ClassPath in the persistence bundle.
- "No persistence provider found... "
- Possible Cause: The javax.persistence bundle was not fully activated before Gemini JPA processing began.
- Solution: Ensure that the javax.persistence bundle has been activated and has had a chance to set the ProviderResolver to be the special OSGi resolver. If it does not have a chance to do it then the default resolver will be used and no provider will be found.
The following system properties may be useful when problems occur. They can be specified using the –D runtime option as a java command line argument. No value is required; the existence of the property is enough to cause the debugging to occur.
|GEMINI_DEBUG||Prints out general trace statements of interest during debugging|
|GEMINI_DEBUG_WEAVING||Prints out trace statements relating to weaving hooks|
|GEMINI_DEBUG_CLASSLOADER||Prints out trace statements relating to classloaders|
|GEMINI_DEBUG_XML||Prints out trace statements relating to persistence descriptor XML file parsing|
It is recommended that the GEMINI_DEBUG flag be enabled when asking for help with a problem or when submitting a trace to the forum.
Some of the internal Gemini JPA persistence unit information is available to help with debugging. It can be accessed by invoking EntityManagerFactory.getProperties() and getting the Map<String,Object> associated with the "PUnitInfo" key. The following code example will return the internal configuration info for the persistence unit of the entity manager factory being invoked:
Map<String,Object> info = (Map<String,Object>) emf.getProperties().get("PUnitInfo");