geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sim085 <>
Subject Re: @PersistenceContext not working
Date Sun, 26 Dec 2010 18:13:59 GMT

> Open  the description and read it;

Thanks. I re-read the description and copied the geronimo-web.xml into my
openejb-jar.xml. I read the exceptions I was getting on deployment very
carefully and removed the parts it was complaining about. Now I finally
managed to deploy my ejb jar file on it's own and also as part of an ear
file without any problems. HOWEVER I still have problems :( 

Here is my openejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>
<openejb-jar xmlns="">


My problem is that I still get a java.lang.NullPointerException wehn I try
to use the EntityManager initialised using the @PersistenceContext. My
persistence.xml is now as follows;

<?xml version="1.0" encoding="UTF-8"?>
<persistence ... >
	<persistence-unit name="TestApp" transaction-type="JTA">

and the code is as follows;

	private EntityManager entityManager;

I really don't know what I am doing wrong and why @PersistenceContext is not
initialising my EntityManage. As much as I know all should be fine and
therefore do not know what I am lacking!
View this message in context:
Sent from the Users mailing list archive at

View raw message