• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HandlerRegistry Problem

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic