2012-04-27 7 views
5

Utilizzo JBoss 5.1 (EAP). Sto usando Spring webservices (3.0.5). Per il marshalling sto usando JaxB.JBoss: compatibilità JaxB DataHandler

Sto usando maven.jaxb2.plugin per generare pojo dallo schema (xsd).

Quando schiero l'orecchio sul JBoss, ottengo il seguente errore:

 
    19:05:52,524 ERROR [[eventmanager-ws]] Allocate exception for servlet eventmanager-ws 
    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 protected javax.activation.DataHandler 
        uk.co.aol.shipmanager.ws.schema.ReportResponse.data 
        at uk.co.aol.shipmanager.ws.schema.ReportResponse 
        at public uk.co.aol.shipmanager.ws.schema.ReportResponse 
        uk.co.aol.shipmanager.ws.schema.ObjectFactory.createReportResponse() 
        at uk.co.aol.shipmanager.ws.schema.ObjectFactory 

      at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.j>ava:102) 
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:472) 
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl.(JAXBContextImpl.java:302) 
      at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1136) 
      at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:154) 
      at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:121) 
      at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:202) 
      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.newInstance(ContextFinder.java:128) 
      at javax.xml.bind.ContextFinder.find(ContextFinder.java:277) 
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:372) 
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:337) 
      at org.springframework.oxm.jaxb.Jaxb2Marshaller.createJaxbContextFromContextPath(Jaxb2Marshaller.java:>355) 
      at org.springframework.oxm.jaxb.Jaxb2Marshaller.getJaxbContext(Jaxb2Marshaller.java:328) 
      at org.springframework.oxm.jaxb.Jaxb2Marshaller.afterPropertiesSet(Jaxb2Marshaller.java:317) 
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477) 
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417) 
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) 
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) 
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291) 
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingleto>BeanRegistry.java:222) 

Ho controllato la versione plug-in e jaxb2 provato a usare la versione precedente con il presupposto che il JBoss ha JAXB 2.1.12, provato molte versioni ma senza fortuna.

Qualche suggerimento?

Grazie, Adi

risposta

0

qualche parte nella tua entità avete campo con tipo DataHandler. Segnare questo campo con @javax.xml.bind.annotation.XmlTransient annotazione

class SomeEntity 
{ 
    //... 
    @javax.xml.bind.annotation.XmlTransient 
    private javax.activation.DataHandler yourField; 
    // ... 
} 
+0

ho lo stesso errore. Generato il client da wsdl usando wsimport. Cosa è successo con il mio jboss 5.1 GA? – Christian13467