users@glassfish.java.net

WebServiceContext is null

From: <glassfish_at_javadesktop.org>
Date: Fri, 07 Dec 2007 04:16:18 PST

Hello. The code below results in a java.lang.NullPointerException at the line that says:

"wsContext.getMessageContext();"

I was following a previously stated example that I found here at the forums but cant seem to get it to work. I'm using Glassfish V2 on Unix and Java SDK 1.6.0_01. I'm stuck and any help would be appreciated.

- Owen


@WebService
public class MyService {
        
        @Resource
        WebServiceContext wsContext;

        @WebMethod
        public String test(String pPayload) throws Exception {

                MessageContext oMsgContext = wsContext.getMessageContext();

        }
}
[Message sent by forum member 'oilagan' (oilagan)]

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