Web services 范围';会议';对于当前线程而言,未处于活动状态
我有两个Spring应用程序:客户端和服务器。服务器上的应用程序是服务,客户端的应用程序是视图逻辑。这两个应用程序都应该通过web服务进行通信,但由于出现错误,无法正常工作 请求处理失败;嵌套异常是 org.springframework.remoting.jaxws.JaxWsSoapFaultException:错误 正在创建名为“scopedTarget.jcrSession”的bean:作用域“session”为 当前线程不活动;考虑定义范围代理 对于这个bean,如果您打算从单例引用它;嵌套 异常为java.lang.IllegalStateException:没有线程绑定请求 已找到:您是指实际应用程序之外的请求属性吗 web请求,或在原始 接收线程?如果您实际上是在web请求中操作 并且仍然收到此消息,您的代码可能正在外部运行 DispatcherServlet/DispatcherPortlet:在这种情况下,使用 RequestContextListener或RequestContextFilter公开当前 请求 在服务器应用程序上,我正在使用JCR会话(会话范围bean)Web services 范围';会议';对于当前线程而言,未处于活动状态,web-services,spring,session,jcr,Web Services,Spring,Session,Jcr,我有两个Spring应用程序:客户端和服务器。服务器上的应用程序是服务,客户端的应用程序是视图逻辑。这两个应用程序都应该通过web服务进行通信,但由于出现错误,无法正常工作 请求处理失败;嵌套异常是 org.springframework.remoting.jaxws.JaxWsSoapFaultException:错误 正在创建名为“scopedTarget.jcrSession”的bean:作用域“session”为 当前线程不活动;考虑定义范围代理 对于这个bean,如果您打算从单例引用它
另外,当我试图在同一个应用程序中自动连接服务,并在
@PostConstruct
注释的方法中使用它,或者在方法afterPropertiesSet()中的初始化bean
的实现中使用它时,也发生了相同的错误
什么是指jcrSession
?@skaffman我更新了问题什么是指jcrSession
?@skaffman我更新了问题
<bean name="jcrSession" factory-bean="sessionFactory" factory-method="login" scope="session" destroy-method="logout" >
<aop:scoped-proxy/>
</bean>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
Example of simplified `JcrSessionFactory`:
public class JcrSessionFactory {
private Repository repository;
private Credentials credentials;
private Session session;
public Session login() {
session = repository.login(credentials);
return session;
}
public void logout() {
session.logout();
}
}