- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试遵循 spring-boot 指南来运行 SOAP 服务器。问题是它抛出这个错误:
2016-09-19 09:43:39.797 WARN 8668 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultMethodEndpointAdapter' defined in class path resource [org/springframework/ws/config/annotation/DelegatingWsConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter]: Factory method 'defaultMethodEndpointAdapter' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter.setCustomMethodArgumentResolvers(Ljava/util/List;)V
我的 ws 配置 bean 文件是:
@EnableWs
@Configuration
public class WebServiceConfig extends WsConfigurerAdapter {
@Bean
public ServletRegistrationBean messageDispatcherServlet(ApplicationContext applicationContext) {
MessageDispatcherServlet servlet = new MessageDispatcherServlet();
servlet.setApplicationContext(applicationContext);
servlet.setTransformWsdlLocations(true);
return new ServletRegistrationBean(servlet, "/ws/*");
}
@Bean(name = "expedientes")
public DefaultWsdl11Definition defaultWsdl11Definition(XsdSchema expedienteSchema) {
DefaultWsdl11Definition wsdl11Definition = new DefaultWsdl11Definition();
wsdl11Definition.setPortTypeName("ExpedientesPort");
wsdl11Definition.setLocationUri("/ws");
wsdl11Definition.setTargetNamespace("http://localhost/ws");
wsdl11Definition.setSchema(expedienteSchema);
return wsdl11Definition;
}
@Bean
public XsdSchema expedienteSchema() {
return new SimpleXsdSchema(new ClassPathResource("Expedientes.xsd"));
}
}
它应该自动配置其余部分,所以我无法理解这个错误。
我浏览了整个网站以查找一些相关错误,但没有任何帮助。请问有什么建议吗?
最佳答案
您收到的错误是
java.lang.NoSuchMethodError: org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter.setCustomMethodArgumentResolvers(Ljava/util/List;)V
类“DefaultMethodEndpointAdapter”是 spring-ws-core jar 文件的一部分。方法“DefaultMethodEndpointAdapter.setCustomMethodArgumentResolvers(List customMethodArgumentResolvers)”自 spring-ws-core-2.2.0.RELEASE.jar 起可用。以下是使用 Spring Boot 1.4.0 的 WS 项目所需的依赖项,根据 spring 指南 https://spring.io/guides/gs/producing-web-service/它将下载最新的 spring-ws-core-2.3.0.RELEASE.jar。请检查您在 pom.xml 中使用的依赖项和版本。
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-ws</artifactId>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
</dependency>
</dependencies>
关于java - defaultMethodEndpointAdapter bean 创建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39567973/
我正在尝试遵循 spring-boot 指南来运行 SOAP 服务器。问题是它抛出这个错误: 2016-09-19 09:43:39.797 WARN 8668 --- [ ma
在使用 Spring-WS 时,配置非常少,因为我一直在使用注释。最近我一直在尝试测试如何在 SOAP 响应中包含附件并使其正常工作,我最终得到了以下配置。
我正在尝试一个简单的 spring web 服务应用程序。我已正确配置应用程序,但当我尝试访问 wsdl 文件时出现以下错误: at java.lang.Thread.run(Thread.j
我是一名优秀的程序员,十分优秀!