No idea. It looks fine to me. Can you package up a sample and attach to
a JIRA? Is this just a simple standalone app?
Thanks!
Dan
On Tuesday, May 15, 2012 05:36:49 AM jerryscott2012 wrote:
> Dear everyone :
> I encountered some problem with integrated with the cxf for async
> call. Hope someone could help me point out the mistakes. Here comes my
> interface definition as follows
>
> 1. the interface publish with @WebService annotation
> @WebService
> public interface ICardWebServiceProvider {
>
> CardMsgBean[] reqForCardService(CardMsgBean[] cardMsgBeans);
>
>
> Future<?> reqForCardServiceAsync(CardMsgBean[] cardMsgBeans,
> AsyncHandler<ReqForCardServiceResponse> asyncHandler);
>
> }
>
> 2. the interface impl as follows
> @BindingType(value = SOAPBinding.SOAP12HTTP_MTOM_BINDING)
> @WebService(endpointInterface =
> "com.ylink.card.ws.business.service.ICardWebServiceProvider",
> targetNamespace = "http://www.gnete.com/card_soap_http",
> name = "CardWebServiceProvider",
> portName = "CardWebServiceProviderPort")
> @Service("cardWebServiceProvider")
> public class CardWebServiceProviderImpl extends AbstractCardWebServiceImpl
> implements ICardWebServiceProvider {
> @UseAsyncMethod
> @Override
> public CardMsgBean[] reqForCardService(CardMsgBean[] cardMsgBeans) {
> List<CardMsgBean> resCardMsgBeanList =
> getResCardMsgBeanList(cardMsgBeans);
>
> return resCardMsgBeanList.toArray(new
> CardMsgBean[resCardMsgBeanList.size()]);
> }
>
>
> public Future<?> reqForCardServiceAsync(final CardMsgBean[]
cardMsgBeans,
> final AsyncHandler<ReqForCardServiceResponse> asyncHandler) {
> final ServerAsyncResponse<ReqForCardServiceResponse>
serverAsyncResp =
> new ServerAsyncResponse<ReqForCardServiceResponse>();
>
> new Thread(new Runnable(){
> public void run() {
> ReqForCardServiceResponse resResponse = new
> ReqForCardServiceResponse();
>
>
resResponse.getReturn().addAll(getResCardMsgBeanList(cardMsgBeans));
>
> serverAsyncResp.set(resResponse);
>
> asyncHandler.handleResponse(serverAsyncResp);
>
> }
> }).start();
>
> return serverAsyncResp;
> }
>
> public List<CardMsgBean> getResCardMsgBeanList(CardMsgBean[]
> cardMsgBeans) {
> //egnore
> }
> }
>
> noticed that i used @UseAsyncMethod just like the sample of "jaxws_async"
> did.
>
> 2. I made use of JaxWsProxyFactoryBean to access the published interface.
> while i start to access, here comes the exception in *server side* :
> Exception in thread "Thread-4639" java.lang.IllegalStateException:
> IDLE,initial
> at
> org.eclipse.jetty.server.AsyncContinuation.dispatch(AsyncContinuation.java
> :403) at
> org.apache.cxf.transport.http_jetty.continuations.JettyContinuationWrapper
> .resume(JettyContinuationWrapper.java:68) at
> org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker$JaxwsServerHandler.handleR
> esponse(AbstractJAXWSMethodInvoker.java:134) at
> com.ylink.card.ws.business.service.impl.CardWebServiceProviderImpl$1.run(C
> ardWebServiceProviderImpl.java:88) at
> java.lang.Thread.run(Thread.java:662)
>
> and the client side exception as follows :
> org.apache.cxf.transport.http.HTTPException: HTTP response '404: Not
> Found' when communicating with
> https://59.41.103.101:9090/CardWebServiceProvider at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespon
> seInternal(HTTPConduit.java:1555) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespon
> se(HTTPConduit.java:1494) at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPCo
> nduit.java:1402) at
> org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
> at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:649)
> at
> org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInt
> erceptor.handleMessage(MessageSenderInterceptor.java:62)
>
> hope some one could point out the mistake.
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/Async-call-with-cxf-but-IllegalStateExcep
> tion-tp5707881.html Sent from the cxf-user mailing list archive at
> Nabble.com.
--
Daniel Kulp
[email protected] - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com