Hello,

We are getting a NullPointerException when trying to renew the token:


Code:
--------------------

EVERE: java.lang.NullPointerException
javax.xml.ws.WebServiceException: java.lang.NullPointerException
at com.sun.xml.ws.security.trust.sts.BaseSTSImpl.invo ke(BaseSTSImpl.java:211)
at com.novell.nidp.wstrust.service.CustomSTS.invoke(y :1225)
at com.novell.nidp.wstrust.service.CustomSTS.invoke(y :3520)
at com.sun.xml.ws.api.server.InstanceResolver$1.invok eProvider(InstanceResolver.java:260)
at com.sun.xml.ws.server.InvokerTube$2.invokeProvider (InvokerTube.java:159)
at com.sun.xml.ws.server.provider.SyncProviderInvoker Tube.processRequest(SyncProviderInvokerTube.java:8 5)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1 136)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:10 50)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:101 9)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:8 77)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSE ndpointImpl.java:420)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpTool kit.handle(HttpAdapter.java:687)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(H ttpAdapter.java:266)
at com.sun.xml.ws.transport.http.servlet.ServletAdapt er.invokeAsync(ServletAdapter.java:225)
at com.sun.xml.ws.transport.http.servlet.WSServletDel egate.doGet(WSServletDelegate.java:161)
at com.sun.xml.ws.transport.http.servlet.WSServletDel egate.doPost(WSServletDelegate.java:197)
at com.sun.xml.ws.transport.http.servlet.WSServlet.do Post(WSServlet.java:81)
at com.novell.nidp.wstrust.servlet.CustomSTSServlet.d oPost(y:2793)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:727)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBas e.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.p rocess(AbstractHttp11Processor.java:1040)
at org.apache.coyote.AbstractProtocol$AbstractConnect ionHandler.process(AbstractProtocol.java:607)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProce ssor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$Wrapping Runnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at com.sun.xml.ws.security.trust.impl.WSTrustContract Impl.validate(WSTrustContractImpl.java:567)
at com.novell.nidp.wstrust.NAMWSTrustContractImpl.ren ew(y:1386)
at com.novell.nidp.wstrust.NAMWSTrustContractImpl.ren ew(y:1405)
at com.sun.xml.ws.security.trust.sts.BaseSTSImpl.rene w(BaseSTSImpl.java:364)
at com.sun.xml.ws.security.trust.sts.BaseSTSImpl.invo ke(BaseSTSImpl.java:205)
... 35 more

--------------------


We are using the following sample code on our web service client in
order to get a token and renew it:


Code:
--------------------


WSPTestServices_Service ss = new WSPTestServices_Service(new URL("http://localhost:8080/WS-TRUST-WSP-TEST/services/WSPTestServicesSOAP?wsdl"), SERVICE_NAME);
WSPTestServices port = ss.getWSPTestServicesSOAP();

System.setProperty(BusFactory.BUS_FACTORY_PROPERTY _NAME, "org.apache.cxf.bus.CXFBusFactory");

CXFBusFactory bf = new CXFBusFactory();
Bus bus = bf.createBus();
bus.getFeatures().add(new org.apache.cxf.feature.LoggingFeature());

bus.setProperty("ws-security.username", "aaaa";
bus.setProperty("ws-security.password", "bbbbb");
bus.setProperty("soap.force.doclit.bare", true);
bus.setProperty("soap.no.validate.parts", true);

STSClient stsClient = new STSClient(bus);
stsClient.setWsdlLocation("https://logindev.sample.com/nidp/wstrust/sts?wsdl");
stsClient.setServiceName("{http://www.netiq.com/nam-4-0/wstrust}SecurityTokenService");
stsClient.setEndpointName("{http://www.netiq.com/nam-4-0/wstrust}STS_Port");
stsClient.setWspNamespace("http://schemas.xmlsoap.org/ws/2004/09/policy");

bus.setProperty("ws-security.sts.client", stsClient);
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);

System.out.println("Asking for a Security Token");
SecurityToken token = stsClient.requestSecurityToken("http://localhost:8080/WS-TRUST-WSP-TEST/services/WSPTestServicesSOAP");
System.out.println("Recieved Security Token");
System.out.println("Renewing the token...");
stsClient.renew(token);
System.out.println("Token Renewed");


--------------------


Any ideas?


--
tomerazran
------------------------------------------------------------------------
tomerazran's Profile: https://forums.netiq.com/member.php?userid=3182
View this thread: https://forums.netiq.com/showthread.php?t=52791