Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
2 replies Latest Post - ‏2013-07-24T13:23:44Z by VB3C_Wendy_Raschke
chris.jackson
chris.jackson
1 Post
ACCEPTED ANSWER

Pinned topic Issues with WASLiberty8.5.5, OpenJPA, Derby, and JAX-RS, EntityManager is null

‏2013-07-11T17:26:33Z |

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.

http://stackoverflow.com/questions/17584009/entitymanager-is-null-using-jax-rs-and-jpa-on-was-liberty

  • rsanchezh
    rsanchezh
    26 Posts
    ACCEPTED ANSWER

    Re: Issues with WASLiberty8.5.5, OpenJPA, Derby, and JAX-RS, EntityManager is null

    ‏2013-07-12T20:14:40Z  in response to chris.jackson

    Hello,

    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
    VB3C_Wendy_Raschke
    14 Posts
    ACCEPTED ANSWER

    Re: Issues with WASLiberty8.5.5, OpenJPA, Derby, and JAX-RS, EntityManager is null

    ‏2013-07-24T13:23:44Z  in response to chris.jackson

    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.

    Thanks,

    Wendy