我正在使用JBoss 5.1(EAP)。我正在使用Spring webservices(3.0.5)。 对于编组,我使用的是JaxB。
我正在使用maven.jaxb2.plugin从架构(xsd)生成pojo。
当我在JBoss上部署EAR时,我收到以下错误:
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)
我已经检查了jaxb2插件版本并尝试使用以前的版本,假设JBoss得到了JaxB 2.1.12,尝试了很多版本但没有运气。
有什么建议吗?
谢谢, 阿迪
答案 0 :(得分:0)
您实体中的某个地方有字段DataHandler
。标记此字段
@javax.xml.bind.annotation.XmlTransient
注释
class SomeEntity
{
//...
@javax.xml.bind.annotation.XmlTransient
private javax.activation.DataHandler yourField;
// ...
}