users@glassfish.java.net

JPA + webservice do not mix

From: <glassfish_at_javadesktop.org>
Date: Mon, 28 May 2007 10:23:38 PDT

hi

I am using jpa to persist several entities.

The code for corresponding entity's creation is pretty simple:
create(Entity e){
tx.begin();
em.persist(e);
tx.commit();
}

This works well standalone.

Now I am wrapping them into axis based web services.

They work well only if an entity is not referring to any other entity. ie. there are no foreign keys.

When they have foreign keys, I get a nullpointerexception when I call the method from webservice client.

Note that this works well when I call the method standalone outside the webservice.

Any clue what could be done?

Regards
Ketan
[Message sent by forum member 'ketancmaheshwari' (ketancmaheshwari)]

http://forums.java.net/jive/thread.jspa?messageID=219196