我试图在我的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)