2016-09-19 9 views
1

SOAPサーバーを実行するためにspring-bootのteのガイドに従おうとしています。問題は、それは、このエラーがスローされます。defaultMethodEndpointAdapter Beanの作成エラー

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コンフィグ豆ファイルがある:私はこのエラーを理解することはできませんので、残りを自動構成することになっている

@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")); 
} 
} 

私はいくつかの関連するエラーのためにサイト全体をサーフィンしましたが、何も私を助けませんでした。 お願いします。

答えて

1

あなたが取得しているエラーが

java.lang.NoSuchMethodError: org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter.setCustomMethodArgumentResolvers(Ljava/util/List;)V 

クラス "DefaultMethodEndpointAdapterは" 春-WS-コアjarファイルの一部です。メソッド "DefaultMethodEndpointAdapter.setCustomMethodArgumentResolvers(List customMethodArgumentResolvers)"は、spring-ws-core-2.2.0.RELEASE.jar以降で使用できます。以下は、スプリングガイドhttps://spring.io/guides/gs/producing-web-service/のように、Springブート1.4.0のWSプロジェクトに必要な依存関係で、最新の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> 
関連する問題