"jaikiran" wrote : anonymous wrote : @WebService()
| | @PersistenceContext(name = "persistence/LogicalName", unitName =
"MissionStatusProjectPU2")
| | public class MissionStatusService {
| |
| | EntityManager em;
| |
| | public MissionStatusService() {
| |
| | try {
| | Context ctx = (Context) new
javax.naming.InitialContext().lookup("java:comp/env");
| | em = (EntityManager) ctx.lookup("persistence/LogicalName");
| | } catch (NamingException ex) {
| | ex.printStackTrace();
| | }
| |
| | }
|
| How about this:
|
|
| | @WebService()
| | public class MissionStatusService {
| |
| | @PersistenceContext
| | EntityManager em;
| |
| | public MissionStatusService() {
| | //do nothing
| |
| | }
| | .....
| | }
|
I did try that.
Then my web service handler that uses the em to create the response fails with a null
pointer error for em.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4109345#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...