cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cleber Muramoto" <dreg...@gmail.com>
Subject Issues with Java SE Deployment
Date Mon, 15 Dec 2008 01:53:47 GMT
Hi.
I'm trying to deploy a service supplying my own wsdl file. When I deploy
progamatically using the Enpoint api, my wsdl file is ignored and another is
generated from the annotated classes instead. Here's the code snippet I'm
using to deploy the service:


public void publish() {
// validate();
 Endpoint ep = Endpoint.create(sib);
URL wsdlURL = getWSDLURL();
 if(wsdlURL==null){
logger.error("Couldn't load wsdlURL from classpath resource "+wsdlPath);
ep.stop();
throw new IllegalArgumentException(wsdlPath);
}

ArrayList<Source> metadata = new ArrayList<Source>();
Source wsdlSource = getWSDLSource();
 String externalForm = wsdlURL.toExternalForm();
wsdlSource.setSystemId(externalForm);
metadata.add(wsdlSource);
ep.setMetadata(metadata);
ep.publish(address);
}

Anyway, albeit a bit different, the service works fine.

Then I tried deploying via my appcontext:

<jaxws:endpoint id="myservice"
implementor="com.natcomp.webservices.ocr.impl.OCR" address="
http://localhost:9000/service"
wsdlLocation="/schemas/ocr.wsdl"  />

It does publish using my supplied wsdl but then I got an NPE when a client
makes a request:


java.lang.NullPointerException
at
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:112)
at
org.apache.cxf.jaxws.JAXWSMethodInvoker.createFault(JAXWSMethodInvoker.java:73)
at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:104)
at
org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:97)
at
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:68)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56)
at
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:92)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:221)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:78)
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:280)
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:254)
at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:722)
at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:842)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)


What is causing this exception is that the HashMap "opToMethod"
of org.apache.cxf.frontend.SimpleMethodDispatcher
is returning null for the BindingOperationInfo associated with the client's
request, even though the map does have a similar key. Thus the Method
object
returned in line 57 of org.apache.cxf.service.invoker.AbstractInvoker is
null, causing the NPE.

BindingOperationgInfo does not implement hashcode, so I think internally the
api take care of acquiring the proper reference via the Exchange object.

When I remove the wsdlLocation from the <jaxws:endpoint ...> the service
works fine.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message