*
The moose likes Web Services and the fly likes CXF fails to serve WebService Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "CXF fails to serve WebService" Watch "CXF fails to serve WebService" New topic
Author

CXF fails to serve WebService

Bozhidar Bozhanov
Greenhorn

Joined: Oct 17, 2009
Posts: 3
The WebService is generated from a WSDL via wsdl2java, then deployed. Then a client is also generated by wsdl2java, and invoked. The exception on the server is:

org.apache.cxf.interceptor.Fault: java.lang.ClassCastException@e9f1cb while invoking public void (msg details).
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:152)
at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:83)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:126)
at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:55)
and so on..


In the message details I trimmed above follow the method signature (which is OK), and the arguments with which it is invoked. One of the arguments there (2nd or 3rd) fails to be resolved, and is instead moved as LAST argument, with null value, thus breaking the correct sequence of argument types.

I thought it had something to do with XmlGregorianCalendar, and replaced it with Calendar - same error. I then replaced the Calendar with plain String (and xsd:dateTime with xsd:string) - fails again.

The value that fails to be parsed/read/.. is just an ordinary String.

I intercepted the raw SOAP message (with a proxy), and it is completely fine there.

CXF 2.2.4 (latest version).
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Please include the complete exception stack trace - it is impossible to say anything about the root cause of the exception from the five lines you have supplied.
Best wishes!
Bozhidar Bozhanov
Greenhorn

Joined: Oct 17, 2009
Posts: 3


org.apache.cxf.interceptor.Fault: java.lang.ClassCastException@17013da while invoking public void [...]
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:152)
at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.createFault(AbstractJAXWSMethodInvoker.java:83)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:126)
at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:55)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:68)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:98)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)
at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:99)
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:352)
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:181)
at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:163)
at org.apache.cxf.transport.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:141)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalArgumentException: java.lang.ClassCastException@17013da
at sun.reflect.GeneratedMethodAccessor82.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:166)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:82)
... 29 more
Bozhidar Bozhanov
Greenhorn

Joined: Oct 17, 2009
Posts: 3
I created an issue on the matter. Posting a link here for those who would stumble upon in: https://issues.apache.org/jira/browse/CXF-2478
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Thanks, but I regretfully have to admit that having seen the complete stack trace did not make things more clear to me. :-(
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CXF fails to serve WebService
 
Similar Threads
Axis 1.4 does not validate input parameters?
org.apache.cxf.interceptor.Fault: null while invoking public "function"
XML Response modification
can we expose only required methods of EJB into Web service ?
Web Services Client Error