我有一个 Spring boot Gradle 项目并使用 JAXB 编组器来编组和解组 XML 请求/响应。
它与一组包路径一起正常工作:
@Bean
public SoapClient client(Jaxb2Marshaller marshaller) throws Exception {
SoapClient client = new SoapClient();
client.setDefaultUri("http://localhost:8088");
client.setMarshaller(marshaller);
client.setUnmarshaller(marshaller);
client.setMessageSender(httpComponentsMessageSender());
return client;
}
@Bean
public Jaxb2Marshaller marshaller() throws Exception {
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
//works
//marshaller.setContextPaths("generated.identity.wsdl");
//works
//marshaller.setContextPaths("generated.network.wsdl");
//does not work
marshaller.setContextPaths("generated.identity.wsdl","generated.network.wsdl");
return marshaller;
}
使用更多参数运行后,我收到以下错误消息:
xycontroller.VerificationControllerTest > checkByToken FAILED
java.lang.IllegalStateException
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException
Caused by: org.springframework.beans.factory.BeanCreationException
Caused by: org.springframework.beans.BeanInstantiationException
Caused by: org.springframework.oxm.UncategorizedMappingException
Caused by: com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException
谢谢你的帮助!
慕森王
相关分类