This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Web Services and the fly likes HandlerRegistry Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "HandlerRegistry Problem" Watch "HandlerRegistry Problem" New topic
Author

HandlerRegistry Problem

Suresh Appagundi
Ranch Hand

Joined: Sep 22, 2003
Posts: 44
Service service = (Service) ic.lookup(java:comp/env/service/SDFWs);
servicePort = service.getPort(com.sdf.SDFWsSEI.class);

String targetNameSpace = "urn:SDFWs/wsdl"; // This target namespace from WSDL
// <definitions name="SDFWs" targetNamespace="urn:SDFWs/wsdl"

QName portName = new QName(targetNameSpace,"SDFWs");
HandlerRegistry registry = service.getHandlerRegistry();
if(registry != null){
List handlerList = new ArrayList();
handlerList.add(new HandlerInfo(ClientHandler.class,null,null));
registry.setHandlerChain(portName, handlerList);

cache.put(jndiHomeName, servicePort);
}


In the above snippet of code, iam getting NullPointerException at line

HandlerRegistry registry = service.getHandlerRegistry();

Not able to HandlerRegistry.

What could be the problem?

Please let me know if there is some problem the way oam registering the Handler.

thanks in advance.
Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078
A NullPointerException at the line you quoted could only be due to service being null. Why service is null I can't tell you, I'm not even sure what you're using off the top of my head.
 
rocket mass heater kickstarter
 
subject: HandlerRegistry Problem