1

Spring Service を SOAPHandler に注入しようとしていますが、参照は常に null です。

SpringBeanAutowiringSupport を拡張して使用してみました:

public class FuelServiceSOAPHandlerBase extends SpringBeanAutowiringSupport implements SOAPHandler<SOAPMessageContext>, InitializingBean {
    @Autowired
    private AuthenticationService authenticationService;

    @Override
    @PostConstruct
    public void afterPropertiesSet() throws Exception {
        LOG.info("AuthenticationHandler - PostConstruct");
        SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this);
    }
    ....
}

機能しません。authenticationService は常に null です。豆投げもやってみた

authenticationService = WebApplicationContextUtils.getWebApplicationContext(((HttpServletRequest)context.getMessage().getProperty(MessageContext.SERVLET_REQUEST)).getSession().getServletContext()).getBean(FuelAuthenticationService.class);

しかし、ServletRequest は null です。Webservice-Call throw SOAPUI を実行しています。

誰がエラーが何であるか知っていますか?

ありがとう

4

1 に答える 1

3

@Autowire ではなく @Resource を使用して解決しました

于 2014-12-18T13:08:54.763 に答える