Hello, i'm using the latest (released) versions of hibernate, annotations and entitymanager.
The following code results in an error:
Code:
<%@ page import="javax.persistence.*" %>
<%
EntityManagerFactory emf = Persistence.createEntityManagerFactory("regapan");
%>
Quote:
java.lang.NullPointerException
at org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(PersistenceXmlLoader.java:68)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:139)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:103)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
at _jsp._test__jsp._jspService(test.jsp:3)
at com.caucho.jsp.JavaPage.service(JavaPage.java:60)
......
The following code doesn't result in an error:
Code:
<%@ page import="java.util.*, javax.persistence.*" %>
<%
Map cfg = new HashMap();
EntityManagerFactory emf = Persistence.createEntityManagerFactory("regapan", cfg);
%>
I've looked in the source, and i don't really understand why there is a call to log.fatal in org.hibernate.ejb.packaging.PersistenceXmlLoader.java line 101.