2012-12-11 66 views
0

我想在AXIS2框架上编写的Web服务中使用spring web范围的bean。 如何配置它? Axis2和Spring文档彼此不一致。春季网络范围的bean和axis2

Axis2 documentation says

For the purpose of this example, we'll configure Spring via a WAR file's web.xml. Let's add a context-param and a listener: 
<listener> 
     <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
</listener> 
<context-param> 
     <param-name>contextConfigLocation</param-name> 
     <param-value>/WEB-INF/applicationContext.xml</param-value> 
</context-param> 

Spring documentation says

When using a Servlet 2.4+ web container, with requests processed outside of Spring's DispatcherServlet (e.g. when using JSF or Struts), you need to add the following javax.servlet.ServletRequestListener to the declarations in your web application's 'web.xml' file. 
<web-app> 
    ... 
    <listener> 
    <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> 
    </listener> 
    ... 
</web-app> 

当我使用的Axis2推荐的ContextLoaderListener与Spring Web作用范围的豆类我上部署

java.lang.IllegalStateException:未找到线程绑定请求:是否 你指的请求属性的实际网络之外请求, 或处理原始接收线程之外的请求?如果 你实际上是一个Web请求内运行,并仍收到此消息 ,你的代码可能运行 DispatcherServlet的/ DispatcherPortlet的以外:在这种情况下,使用 RequestContextListener或RequestContextFilter两个揭露当前 请求。

当我使用Spring的特别建议RequestContextListener我得到了正在运行的Web服务上请求故障:

 <faultstring>The SERVICE_OBJECT_SUPPLIER parameter is not specified.</faultstring> 

换句话说:如何与Spring和RequestContextListener配置AXIS2?

+0

此处也开始讨论:https://issues.apache.org/jira/browse/AXIS2-5467 – popalka

回答