Problem with webservice handlers

Latest response

Hi,
We have some jax-ws webservice clients . We configured them in web.xml using

 <service-ref>
  <description>PMService</description>
  <service-ref-name>service/PMService</service-ref-name>
  <service-interface>test.PManagementService</service-interface>
  <wsdl-file>WEB-INF/wsdl/PMservice.wsdl</wsdl-file>

  <handler-chains>
    <handler-chain>
        <handler>
        <handler-name>nume</handler-name>
        <handler-class>chain.handler</handler-class>
        </handler>          
    </handler-chain>
   </handler-chains>

 </service-ref>

Then we load the class using a custom factory :

initialCtx = new InitialContext();
Service service=null;
service = (Service) initialCtx.lookup(getJndiContext());

It works, but the handler is not applied .
Any ideas?

Thanks

Responses

Another thing.. when i try to add @HandlerChain annotation in the generated class i get the following error:

Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public java.lang.Object ro.ing.hb.core.general.JaxWsReferenceImpl.getService()] threw exception; nested exception is javax.xml.ws.WebServiceException: Chain not specified
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:127) [org.springframework.beans-2.5.6.A.jar:2.5.6]
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:435) [org.springframework.beans-2.5.6.A.jar:2.5.6]
    ... 29 more
Caused by: javax.xml.ws.WebServiceException: Chain not specified
    at org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(AnnotationHandlerChainBuilder.java:129)
    at org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(AnnotationHandlerChainBuilder.java:285)
    at org.apache.cxf.jaxws.handler.HandlerResolverImpl.getHandlersFromAnnotation(HandlerResolverImpl.java:93)
    at org.apache.cxf.jaxws.handler.HandlerResolverImpl.createHandlerChain(HandlerResolverImpl.java:74)
    at org.apache.cxf.jaxws.handler.HandlerResolverImpl.getHandlerChain(HandlerResolverImpl.java:61)
    at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:484)
    at org.jboss.wsf.stack.cxf.client.ProviderImpl$JBossWSServiceImpl.createPort(ProviderImpl.java:484)
    at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:316)
    at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:311)
    at javax.xml.ws.Service.getPort(Service.java:168) [jboss-jaxws-api_2.2_spec-2.0.1.Final-redhat-2.jar:2.0.1.Final-redhat-2]
    at ro.ing.hb.core.general.JaxWsReferenceImpl.getService(JaxWsReferenceImpl.java:46) [hb-common.jar:]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_18]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_18]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_18]
    at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.6.0_18]
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:115) [org.springframework.beans-2.5.6.A.jar:2.5.6]
    ... 30 more
Caused by: java.lang.ClassCastException: org.apache.cxf.jaxws.javaee.PortComponentHandlerType$JaxbAccessorF_description cannot be cast to com.sun.xml.bind.v2.runtime.reflect.Accessor
    at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.instanciate(OptimizedAccessorFactory.java:151) [jaxb-impl.jar:2.1]
    at com.sun.xml.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:143) [jaxb-impl.jar:2.1]
    at com.sun.xml.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:204) [jaxb-impl.jar:2.1]
    at com.sun.xml.bind.v2.runtime.property.ArrayProperty.<init>(ArrayProperty.java:29) [jaxb-impl.jar:2.1]
    at com.sun.xml.bind.v2.runtime.property.ArrayERProperty.<init>(ArrayERProperty.java:45) [jaxb-impl.jar:2.1]
    at com.sun.xml.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:60) [jaxb-impl.jar:2.1]
    at com.sun.xml.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:22) [jaxb-impl.jar:2.1]
    at sun.reflect.GeneratedConstructorAccessor61.newInstance(Unknown Source) [:1.6.0_18]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) [rt.jar:1.6.0_18]
    at java.lang.reflect.Constructor.newInstance(Unknown Source) [rt.jar:1.6.0_18]
    at com.sun.xml.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:88) [jaxb-impl.jar:2.1]
    at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:135) [jaxb-impl.jar:2.1]
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:448) [jaxb-impl.jar:2.1]
    at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:282) [jaxb-impl.jar:2.1]
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:84) [jaxb-impl.jar:2.1]
    at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:66) [jaxb-impl.jar:2.1]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_18]
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_18]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [rt.jar:1.6.0_18]
    at java.lang.reflect.Method.invoke(Unknown Source) [rt.jar:1.6.0_18]
    at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:211) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
    at javax.xml.bind.ContextFinder.find(ContextFinder.java:392) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:618) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
    at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:565) [jboss-jaxb-api_2.2_spec-1.0.4.Final-redhat-2.jar:1.0.4.Final-redhat-2]
    at org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.getContextForPortComponentHandlerType(AnnotationHandlerChainBuilder.java:278)
    at org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.processHandlerElement(AnnotationHandlerChainBuilder.java:265)
    at org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.processHandlerChainElement(AnnotationHandlerChainBuilder.java:168)
    at org.apache.cxf.jaxws.handler.AnnotationHandlerChainBuilder.buildHandlerChainFromClass(