Sha*_*ake 7 java spring web-services jax-ws
我试图在我的webservice中启用Spring自动装配支持,遵循以下几行
public class MyService extends SpringBeanAutowiringSupport implements SomeInterface {
private Dao dao;
@Autowired
public void setDao(Dao dao) {
this.dao = dao;
}
Run Code Online (Sandbox Code Playgroud)
使用MyService类注释
@WebService(endpointInterface = "SomeInterfacePath")
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试运行它时,我得到了一个
java.lang.NoSuchMethodError: org.springframework.web.context.ContextLoader.getCurrentWebApplicationContext()Lorg/springframework/web/context/WebApplicationContext;
at org.springframework.web.context.support.SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(SpringBeanAutowiringSupport.java:81)
at org.springframework.web.context.support.SpringBeanAutowiringSupport.<init>(SpringBeanAutowiringSupport.java:68)
Run Code Online (Sandbox Code Playgroud)
错误,我无法找到解决方案.我正在使用Spring 3.0 jar和apache-cxf.Spring自动装配在我的项目的其他地方工作,但似乎在这里不能很好地发挥作用.关于发生了什么的任何想法?我在appConfig中定义了一个jaxws端点
<jaxws:endpoint
id="myendpoint"
implementor="MyService"
address="/helloworld
/>
Run Code Online (Sandbox Code Playgroud)
直到最近,Apache CXF 将 Spring 2.5.5 作为 Maven 依赖项。但是,CXF 2.3 版及更高版本使用 Spring 3。
<spring.version>2.5.5</spring.version>
Run Code Online (Sandbox Code Playgroud)<spring.version>3.0.4.RELEASE</spring.version>
Run Code Online (Sandbox Code Playgroud)两者都包含<dependencymanagement>
将 Spring 与指定版本联系起来的部分。
归档时间: |
|
查看次数: |
3045 次 |
最近记录: |