我使用的是自定义InterceptStrategy,它在SOAP响应成功后抛出错误。
错误: java.lang.IllegalStateException:在org.apache.catalina.core.AsyncContextImpl.getRequest(AsyncContextImpl.java:224) at org.apache.catalina.core.AsyncContextImpl.dispatch(AsyncContextImpl.java:153) at org.springframework.security.web.servletapi.HttpServlet3RequestFactory$SecurityContextAsyncContext.dispatch(HttpServlet3RequestFactory.java:291) at org.apache.cxf.transport.http.Servlet3ContinuationProvider$Servlet3Continuation.redispatch(Servlet3ContinuationProvider.java:125)调用complete()或任何dispatch()方法后调用getRequest()是非法的在org.apache.cxf.transport.http.Servlet3ContinuationProvider$Servlet3Continuation.resume(Servlet3ContinuationProvider.java:131)
public class ApplicationLogStrategy implements InterceptStrategy {
@Override
public Processor wrapProcessorInInterceptors(CamelContext context, ProcessorDefinition<?> definition,
Processor target, Processor nextTarget) throws Exception {
return new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
System.out.println("Display" + definition);
if (definition.getId().equalsIgnoreCase(ApplicationConstants.INITIAL_LOG)) {
//setCommonFields(exchange);
//setSpecificFields(exchange);
}
target.process(exchange);
}
};
}
}我的骆驼路线:
<camelContext id="id-por" xmlns="http://camel.apache.org/schema/spring">
<route>
<!-- route starts from the cxf webservice -->
<from uri="cxf:bean:porEndpoint" />
<doTry>
<to uri="bean:soapBean?method=processSOAP"/>
<bean id="soap_success" method="processSuccess" ref="soapBean"/>
<camel:bean id="published_log" method="info('Message - SUCCESS')" ref="logger"/>
<doCatch>
<camel:exception>java.lang.Exception</camel:exception>
<handled>
<constant>true</constant>
</handled>
<to uri="bean:soapBean?method=processGenericError"/>
</doCatch>
</doTry>
</route>
</camelContext>在记录消息"Message - SUCCESS“后抛出错误。:
<camel:bean id="published_log" method="info('Message - SUCCESS')" ref="logger"/>我添加了<stop/>,但运气不佳,仍然抛出错误:在complete()或任何dispatch()方法之后调用getRequest()是非法的
发布于 2017-09-19 06:43:04
代替target.process(exchange);
就是return target;
https://stackoverflow.com/questions/46270269
复制相似问题