1 Reply Latest reply on Jun 2, 2009 1:04 PM by lorinda visnick

    javax.activation.DataHandler does not have a no-arg default constructor. ?

    Marcel Casado Novice

      Hi,

       

      When I'm trying to deploy an osgi CXF service (wsdl first ) with attachments (swa) deployed on FUSE 4 . I got the exception below:

       

      Caused by: org.apache.cxf.service.factory.ServiceConstructionException

           at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:280)

           at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:340)

           at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:436)

           at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:194)

           at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:164)

           at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)

           at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:117)

           at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:168)

           at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:346)

           at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:259)

           ... 26 more

      Caused by: javax.xml.bind.JAXBException: Unable to create context

      - with linked exception:

           at javax.xml.bind.ContextFinder.find(ContextFinder.java:93)

           at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:65)

           at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:437)

           at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:263)

           ... 35 more

      Caused by: java.lang.reflect.InvocationTargetException

           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

           at java.lang.reflect.Method.invoke(Method.java:597)

           at javax.xml.bind.ContextFinder.find(ContextFinder.java:91)

           ... 38 more

      Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions

      javax.activation.DataHandler does not have a no-arg default constructor.

           this problem is related to the following location:

                at javax.activation.DataHandler

                at public javax.xml.bind.JAXBElement org.apache.cxf.swa.types.ObjectFactory.createHtmlAttach(javax.activation.DataHandler)

                at org.apache.cxf.swa.types.ObjectFactory

       

           at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:102)

           at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:438)

           at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:286)

           at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:139)

           at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:117)

           ... 43 more

       

       

      The method ObjectFactory method created by wsdl2java (xjc)  :

        /**

            

      • Create an instance of {@link JAXBElement }{@code <}{@link DataHandler }{@code >}}

            

           */

          @XmlElementDecl(namespace = "http://cxf.apache.org/swa/types", name = "HTMLAttach")

          @XmlMimeType("text/html")

          public JAXBElement(_HtmlAttach_QNAME, DataHandler.class, null, value);

          }

       

       

      Thanks,

       

      -Marcel