I am having issues persisting data to an embedded derby database via JPA. I have written a RESTful service via JAX-RS and have sent an xml file to one of these resources via a POST. This data should be persisted to the database but is throwing a null pointer exception. I have clearly layed out my code and detailed configuration on stack exchange. Please take a look at the following link and see if you can provide any assistance.
Pinned topic Issues with WASLiberty8.5.5, OpenJPA, Derby, and JAX-RS, EntityManager is null
rsanchezh 120000F8XE26 Posts
Re: Issues with WASLiberty8.5.5, OpenJPA, Derby, and JAX-RS, EntityManager is null2013-07-12T20:14:40ZThis is the accepted answer. This is the accepted answer.
Do you see anything else in the log besides the NPE? Have you tried to take out of the picture the JAX.RS code, to isolate the problem? By looking at the code you included in the link, I think it would be easy to write a simple client (e.g. a servlet) that would get a reference to the session ejb, and then call the method createUser().
VB3C_Wendy_Raschke 270000VB3C14 Posts
Re: Issues with WASLiberty8.5.5, OpenJPA, Derby, and JAX-RS, EntityManager is null2013-07-24T13:23:44ZThis is the accepted answer. This is the accepted answer.
Hi, Chris. I know that this is super-late (I am trying to fix my settings so I get notification), and I see in Stackoverflow that you posted that you did a JNDI lookup to resolve the NPE.
But I wonder if you could simply enable cdi-1.0 (I don't see that in your server.xml), and then you could probably forgo JNDI.