Return-Path: Delivered-To: apmail-ws-wss4j-dev-archive@www.apache.org Received: (qmail 83638 invoked from network); 5 Nov 2005 03:57:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Nov 2005 03:57:48 -0000 Received: (qmail 67956 invoked by uid 500); 5 Nov 2005 03:57:46 -0000 Delivered-To: apmail-ws-wss4j-dev-archive@ws.apache.org Received: (qmail 67902 invoked by uid 500); 5 Nov 2005 03:57:45 -0000 Mailing-List: contact wss4j-dev-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list wss4j-dev@ws.apache.org Received: (qmail 67891 invoked by uid 99); 5 Nov 2005 03:57:45 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2005 19:57:45 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [132.239.1.59] (HELO mailbox7.ucsd.edu) (132.239.1.59) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Nov 2005 19:57:40 -0800 Received: from smtp.ucsd.edu (smtp.ucsd.edu [132.239.1.49]) by mailbox7.ucsd.edu (8.13.5/8.13.5) with ESMTP id jA53vHif098445 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 4 Nov 2005 19:57:17 -0800 (PST) Received: from gpsmail.ucsd.edu (gpsmail.ucsd.edu [132.239.152.86]) by smtp.ucsd.edu (8.13.4/8.13.4) with ESMTP id jA53vEOF043115 for ; Fri, 4 Nov 2005 19:57:17 -0800 (PST) Date: Fri, 4 Nov 2005 19:57:14 -0800 (PST) From: Paul Jamason To: wss4j-dev@ws.apache.org Subject: NPE with WSSecurityEngineResult Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylisting: NO DELAY (Trusted relay host); processed by UCSD_GL-v2.1 on mailbox7.ucsd.edu; Fri, 04 November 2005 19:57:17 -0800 (PST) X-MailScanner: PASSED (v1.2.8 89689 jA53vHif098445 mailbox7.ucsd.edu) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, I'm attempting to read the username from the soap header ws-security block in my web service, using the following code (modified from the snippet shown at http://ws.apache.org/wss4j/apidocs/org/apache/ws/axis/security/package-summary.html): String user = null; try { MessageContext context = MessageContext.getCurrentContext(); Vector recvResults = (Vector) context.getProperty(WSHandlerConstants.RECV_RESULTS); WSHandlerResult result = (WSHandlerResult) recvResults.get(0); Vector results = result.getResults(); WSSecurityEngineResult wsseResult = (WSSecurityEngineResult) results.get(0); String DN = wsseResult.getPrincipal().getName(); user = DN.substring(13, DN.indexOf(',')); } catch (Exception e) { e.printStackTrace(System.err); } However, I get an NPE here: String DN = wsseResult.getPrincipal().getName(); Here's the stack trace: java.lang.NullPointerException at edu.ucsd.sopac.reason.asa.ws.ASA_Receive.authRequest(ASA_Receive.java:65) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code)) at java.lang.reflect.Method.invoke(Method.java(Compiled Code)) at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:388) at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:283) at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453) at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281) at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699) at javax.servlet.http.HttpServlet.service(HttpServlet.java:709) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684) at java.lang.Thread.run(Thread.java:568) I am able to get debug output for WSSecurityEngine (handler output): - enter processSecurityHeader() - Processing WS-Security header for '' actor. - Found UsernameToken list element - UsernameToken user test - UsernameToken password CcgmjRKPSS/vVrETPlpGWgwsSQg= - UsernameToken callback password - Found Timestamp list element - Preparing to verify the timestamp - Current time: 2005-11-05T03:06:47Z - Timestamp created: 2005-11-05T03:06:47Z - Timestamp expires: 2005-11-05T03:11:47Z - Validation of Timestamp: Everything is ok but not for WSS4JHandler, for the code snippet above. Both are set to DEBUG in log4j.properties. If I use the code snippet at the url above, the NPE occurs at: WSSecurityEngineResult eResult = (WSSecurityEngineResult) hResults.get(j); Finally, I am seeing the "java.lang.NoSuchFieldException: m_functions" error in the log, which still persists despite creating the $JAVA_HOME/jre/lib/endorsed directory and placing xalan-2.6.0.jar there. Thanks in advance for any help. Paul --------------------------------------------------------------------- To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org For additional commands, e-mail: wss4j-dev-help@ws.apache.org