I've struggled for a couple of days now trying to ascertain whether or not it's possible to create a persistence.xml 'less JPA configuration in a JSE application with EclipseLink.
I've found like solutions for Spring, Hybernate, using Tapestry, etc but not interested in any of them.
Can someone tell me whether it's possible to do so with EclipseLink?
I went so far as to create an implementation of javax.persistence.spi.PersistenceUnitInfo but when I invoke PersistenceProvider().createContainerEntityManagerFactory, I get the following:
java.lang.NullPointerException
at org.eclipse.persistence.exceptions.i18n.ExceptionMessageGenerator.buildMessage(ExceptionMessageGenerator.java:41)
at org.eclipse.persistence.exceptions.EntityManagerSetupException.createContainerEntityManagerFactoryNotSupportedInOSGi(EntityManagerSetupException.java:295)
at org.eclipse.persistence.jpa.osgi.PersistenceProvider.createContainerEntityManagerFactory(PersistenceProvider.java:62)
My application is not an OSGi app, nor do I aspire to convert it to one.
I'm simply trying to circumnavigate the requirement for a persistence.xml file. The results of my Google searches are indicative that others share the same requirement.
I'm using JPA 2 so no such method. As indicated in my post, there is a createContainerEntityManagerFactory(PersistenceUnitInfo, Map) method but it's invocation resulted in the aforementioned exception.
Is there no way to do this is JSE without using OSGI? If not, moving on.