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.handleResponse(AbstractJAXWSMethodInvoker.java:134)
        at
com.ylink.card.ws.business.service.impl.CardWebServiceProviderImpl$1.run(CardWebServiceProviderImpl.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.handleResponseInternal(HTTPConduit.java:1555)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1494)
        at
org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.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$MessageSenderEndingInterceptor.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-IllegalStateException-tp5707881.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to