CXF Exception thrown when calling REST call is made
I have a REST Service with a CXF & Spring backend and ExtJS front end.
The GET methods for the service work perfectly. I have attempted to implement a POST service with a new DAO and implementation at the end backend.
I have verified that the parameters are being passed in successfully to the service but when it makes a call to the backend method, it returns a strange exception that I can't trace back.
09:57:41.004 [http-8081-Processor21] WARN o.a.cxf.phase.PhaseInterceptorChain - Application has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: null
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:148) [cxf-2.2.3.jar:2.2.3]
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:114) [cxf-2.2.3.jar:2.2.3]
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:118) [cxf-2.2.3.jar:2.2.3]
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:78) [cxf-2.2.3.jar:2.2.3]
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) [cxf-2.2.3.jar:2.2.3]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) [na:1.6.0_25]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [na:1.6.0_25]
at java.util.concurrent.FutureTask.run(FutureTask.java:138) [na:1.6.0_25]
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) [cxf-2.2.3.jar:2.2.3]
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:98) [cxf-2.2.3.jar:2.2.3]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236) [cxf-2.2.3.jar:2.2.3]
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104) [cxf-2.2.3.jar:2.2.3]
at org.apache.cxf.transport.servlet.ServletDestination.invoke(ServletDestination.java:99) [cxf-2.2.3.jar:2.2.3]
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:452) [cxf-2.2.3.jar:2.2.3]
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:159) [cxf-2.2.3.jar:2.2.3]
at org.apache.cxf.transport.servlet.AbstractCXFServlet.invoke(AbstractCXFServlet.java:220) [cxf-2.2.3.jar:2.2.3]
at org.apache.cxf.transport开发者_JAVA技巧.servlet.AbstractCXFServlet.doPost(AbstractCXFServlet.java:153) [cxf-2.2.3.jar:2.2.3]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) [servlet-api.jar:na]
at org.apache.cxf.transport.servlet.AbstractCXFServlet.service(AbstractCXFServlet.java:211) [cxf-2.2.3.jar:2.2.3]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) [catalina.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) [catalina.jar:na]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) [catalina.jar:na]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) [catalina.jar:na]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [catalina.jar:na]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) [catalina.jar:na]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) [catalina.jar:na]
at ria.eclipsetomcatsso.siteminder.SiteMinderValve.forwardAuthSucceededResponse(SiteMinderValve.java:207) [ria_eclipsetomcatsso.jar:5.5.0]
at ria.eclipsetomcatsso.siteminder.SiteMinderValve.invoke(SiteMinderValve.java:140) [ria_eclipsetomcatsso.jar:5.5.0]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) [catalina.jar:na]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:879) [tomcat-http.jar:na]
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) [tomcat-http.jar:na]
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) [tomcat-util.jar:5.1]
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) [tomcat-util.jar:5.1]
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) [tomcat-util.jar:5.1]
at java.lang.Thread.run(Thread.java:662) [na:1.6.0_25]
Caused by: java.lang.NullPointerException: null
at itlnc.detr_web.restful.server.impl.DisplayServiceImpl.updateStatus(DisplayServiceImpl.java:96) [DisplayServiceImpl.class:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [na:1.6.0_25]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [na:1.6.0_25]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [na:1.6.0_25]
at java.lang.reflect.Method.invoke(Method.java:597) [na:1.6.0_25]
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:166) [cxf-2.2.3.jar:2.2.3]
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:82) [cxf-2.2.3.jar:2.2.3]
... 33 common frames omitted
I've ran it in debug mode and know that it fails on the method call - the service is implemented as:
@Override
@POST
@Produces("application/json")
@Path("/updatestatus")
public boolean updateReportStatus(@FormParam("reportDate") String reportDt, @FormParam("status") String status) {
System.err.println("report date = "+reportDt);
System.err.println("status = "+status);
System.err.println("In service to update");
gridUpdateDao.updateStatus();
.......
Just a suggestion, have you tried adding
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
to your method?
精彩评论