Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.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
Web services 范围';会议';对于当前线程而言,未处于活动状态_Web Services_Spring_Session_Jcr - Fatal编程技术网

Web services 范围';会议';对于当前线程而言,未处于活动状态

Web services 范围';会议';对于当前线程而言,未处于活动状态,web-services,spring,session,jcr,Web Services,Spring,Session,Jcr,我有两个Spring应用程序:客户端和服务器。服务器上的应用程序是服务,客户端的应用程序是视图逻辑。这两个应用程序都应该通过web服务进行通信,但由于出现错误,无法正常工作 请求处理失败;嵌套异常是 org.springframework.remoting.jaxws.JaxWsSoapFaultException:错误 正在创建名为“scopedTarget.jcrSession”的bean:作用域“session”为 当前线程不活动;考虑定义范围代理 对于这个bean,如果您打算从单例引用它

我有两个Spring应用程序:客户端和服务器。服务器上的应用程序是服务,客户端的应用程序是视图逻辑。这两个应用程序都应该通过web服务进行通信,但由于出现错误,无法正常工作

请求处理失败;嵌套异常是 org.springframework.remoting.jaxws.JaxWsSoapFaultException:错误 正在创建名为“scopedTarget.jcrSession”的bean:作用域“session”为 当前线程不活动;考虑定义范围代理 对于这个bean,如果您打算从单例引用它;嵌套 异常为java.lang.IllegalStateException:没有线程绑定请求 已找到:您是指实际应用程序之外的请求属性吗 web请求,或在原始 接收线程?如果您实际上是在web请求中操作 并且仍然收到此消息,您的代码可能正在外部运行 DispatcherServlet/DispatcherPortlet:在这种情况下,使用 RequestContextListener或RequestContextFilter公开当前 请求

在服务器应用程序上,我正在使用JCR会话(会话范围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();
    }
}