MyBatis Spring3映射器null与SoapClient
我有一个ServiceXX.java,其中XXXMapper.java注入了@Autowire。ServiceXXX.java是一个webservice@webservice(endpointInterface=“com.xxx…”)。当用java客户机调用webservice时,一切似乎都连接正确,但如果用SoapClient调用webservice,则XXXMapper为空。为什么?(这可能是因为声明为MyBatis Spring3映射器null与SoapClient,spring,mybatis,Spring,Mybatis,我有一个ServiceXX.java,其中XXXMapper.java注入了@Autowire。ServiceXXX.java是一个webservice@webservice(endpointInterface=“com.xxx…”)。当用java客户机调用webservice时,一切似乎都连接正确,但如果用SoapClient调用webservice,则XXXMapper为空。为什么?(这可能是因为声明为@WebService的类正在由容器的WebService堆栈实例化(不是spring)因
@WebService
的类正在由容器的WebService堆栈实例化(不是spring)因此,上下文不知道自动连接的相关信息。要解决此问题,可以使服务类扩展SpringBeanAutowiringSupport
。然后,spring将在容器初始化后自动连接
顺便说一句,该bean位于
springweb
模块中。这可能是因为声明为@WebService
的类正在由容器(而不是spring)的WebService堆栈实例化因此,上下文不知道自动连接的相关信息。要解决此问题,可以使服务类扩展SpringBeanAutowiringSupport
。然后,spring将在容器初始化后自动连接
顺便说一句,这个bean在
SpringWeb
模块中。我在服务中使用extends-SpringBeanAutowiringSupport,一切正常。我在服务中使用extends-SpringBeanAutowiringSupport,一切正常。