Your EntityManagerFactory
doesn't get properly created at initialization time (so it is null
), hence the NullPointerException
when you try to use it to obtain an EntityManager
.
And while EclipseLink should certainly not fail with a NPE
while trying to generate an internationalized message for the exception (you should log this as a bug), the trace still contains useful information, as shown in bold below:
[EL Severe]: 2010-10-23 05:27:14.092--ServerSession(1673653)--java.lang.NullPointerException
at java.util.ResourceBundle.getBundle(Unknown Source)
at org.eclipse.persistence.exceptions.i18n.ExceptionMessageGenerator.buildMessage(ExceptionMessageGenerator.java:47)
at org.eclipse.persistence.exceptions.DatabaseException.unableToAcquireConnectionFromDriverException(DatabaseException.java:376)
at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:91)
at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:579)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:228)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:380)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:157)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:214)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:202)
...
There is very likely something wrong with your connection pool configuration, EclipseLink isn't able to get a valid connection from it.
I can't give a more precise answer without more details about your settings like the persistence.xml
, the Tomcat datasource configuration, the way you use Derby (in server mode?). But that's where to look.