通过gradle任务bootJar创建的jar无法正常工作。获取javax.xml.bind.JAXBException。但是使用gradle bootRun或通过IDEA一切都可以正常工作
Caused by: javax.xml.bind.JAXBException: class com.xxx.PayOrderStatisticsGetRequest nor any of its super class is known to this context.
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getBeanInfo(JAXBContextImpl.java:593) ~[jaxb-impl-2.2.6.jar!/:2.2.6]
at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsRoot(XMLSerializer.java:482) ~[jaxb-impl-2.2.6.jar!/:2.2.6]
at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:323) ~[jaxb-impl-2.2.6.jar!/:2.2.6]
at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:251) ~[jaxb-impl-2.2.6.jar!/:2.2.6]
at javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:95) ~[na:1.8.0_221]
at org.apache.axis2.datasource.jaxb.JAXBDSContext$1.run(JAXBDSContext.java:477) ~[axis2-jaxws-1.7.9.jar!/:1.7.9]
at org.apache.axis2.datasource.jaxb.JAXBDSContext$1.run(JAXBDSContext.java:462) ~[axis2-jaxws-1.7.9.jar!/:1.7.9]
at org.apache.axis2.java.security.AccessController.doPrivileged(AccessController.java:76) ~[axis2-kernel-1.7.9.jar!/:1.7.9]
at org.apache.axis2.datasource.jaxb.JAXBDSContext.marshalByElement(JAXBDSContext.java:462) ~[axis2-jaxws-1.7.9.jar!/:1.7.9]
at org.apache.axis2.datasource.jaxb.JAXBDSContext.marshal(JAXBDSContext.java:422) ~[axis2-jaxws-1.7.9.jar!/:1.7.9]
at org.apache.axis2.jaxws.message.databinding.impl.JAXBBlockImpl._outputFromBO(JAXBBlockImpl.java:175) ~[axis2-jaxws-1.7.9.jar!/:1.7.9]
at org.apache.axis2.jaxws.message.impl.BlockImpl.outputTo(BlockImpl.java:371) ~[axis2-jaxws-1.7.9.jar!/:1.7.9]
at org.apache.axis2.jaxws.message.impl.BlockImpl.serialize(BlockImpl.java:295) ~[axis2-jaxws-1.7.9.jar!/:1.7.9]
at org.apache.axiom.om.impl.common.serializer.push.stax.StAXSerializer.serializePushOMDataSource(StAXSerializer.java:53) ~[axiom-dom-1.2.21.jar!/:na]
at org.apache.axiom.om.impl.common.serializer.push.Serializer.serialize(Serializer.java:293) ~[axiom-dom-1.2.21.jar!/:na]
答案 0 :(得分:0)
@ApiModel(value = "PayOrderStatisticsGetRequest", description = "Запрос на получение сводки по количеству ПП на подпись и отправку")
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "")
@XmlRootElement(name = "PayOrderStatisticsGetRequest")
@XmlSeeAlso({PayOrderStatisticsGetRequest.class}) //add this and try
public class PayOrderStatisticsGetRequest { }
参考javax.xml.bind.JAXBException: Class *** nor any of its super class is known to this context