Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WSServletContainerInitializer和SpringBeanAutowiringSupport_Spring_Jax Ws_Tomcat7 - Fatal编程技术网

WSServletContainerInitializer和SpringBeanAutowiringSupport

WSServletContainerInitializer和SpringBeanAutowiringSupport,spring,jax-ws,tomcat7,Spring,Jax Ws,Tomcat7,关于上述类,我有一些集成问题,但仅限于“太新”的tomcat版本 基本设置: web.xml 这对我来说非常有效。但不是我的同事。。。如果他试图运行该应用程序,WSServletContainerInitializer会首先启动,这会产生与上述完全相同的布线问题 显然,我们可以“破解”这个问题,摆脱SpringBeanAutowiringSupport,并从getter、web方法或任何类似方式手动注入Bar。但是SpringBeanAutowiringSupport会更加清晰,所以如果有解决上

关于上述类,我有一些集成问题,但仅限于“太新”的tomcat版本

基本设置: web.xml

这对我来说非常有效。但不是我的同事。。。如果他试图运行该应用程序,WSServletContainerInitializer会首先启动,这会产生与上述完全相同的布线问题

显然,我们可以“破解”这个问题,摆脱SpringBeanAutowiringSupport,并从getter、web方法或任何类似方式手动注入Bar。但是SpringBeanAutowiringSupport会更加清晰,所以如果有解决上述问题的好方法,我们愿意使用它


更新:这会导致问题:

对于我来说,解决方案是在自动连线引用为null时调用以下内容

processInjectionBasedOnCurrentContext(this);

我希望它对所有人都有帮助。

不确定该漏洞是否是罪魁祸首。Changelog说它是在7.0.29中修复的。我在Tomcat 7.0.39上看到了同样的行为
@WebService(serviceName = ServiceInfo.SERVICENAME, targetNamespace = ServiceInfo.TARGETNAMESPACE, endpointInterface = "bar.FooService")
@HandlerChain(file = "/handler-chain.xml")
public class FooServiceImpl extends SpringBeanAutowiringSupport implements FooService {

    @Autowired
    private Bar bar;

    << some methods using the injected bar singleton >>
public class MyInitializer implements WebApplicationInitializer {

    @Override
    public void onStartup(ServletContext servletContext) throws ServletException {
        ContextLoader loader = new ContextLoader();
        loader.initWebApplicationContext(servletContext);
    }

}
processInjectionBasedOnCurrentContext(this);