xsp.application.timeout 和“对象已被删除或回收"; [英] xsp.application.timeout and "Object has been removed or recycled"

查看:39
本文介绍了xsp.application.timeout 和“对象已被删除或回收";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在 Java 类级别的 Domino 对象消失方面遇到了很多问题.例如,我将 lotus.domino.Session 放置到(非静态)类级别变量,当我尝试在下一行代码中使用它时,我得到:

I've been having a lot of problems with disappearing Java class level Domino objects lately. For example I place a lotus.domino.Session to a (non-static) class level variable and when I try to use it in the next code line I get:

NotesException: Object has been removed or recycled

在我开始使用托管 bean 之前,我没有遇到这些问题,但现在我似乎一直使用请求范围的 bean 以及纯 Java 对象来解决这些问题.我一直在向许多地方添加 isRecycled() 检查,并想知道为什么我以前不必这样做.我知道 Domino 对象没有被序列化,但在它们在请求或代理期间停留之前.

I didn't have these problems before I started using managed beans but now I seem to get them all the time with request scoped beans and also in plain Java objects. I've been adding isRecycled() checks to many places and been wondering why I didn't have to do it before. I know Domino objects are not serialized but before they stayed for the duration of the request or agent.

今天我将给出此异常的代码复制到另一个数据库,并且没有发生异常.然后我将 xsp.properties 从该数据库复制到原始数据库,并且那里也没有发生异常.通过一次删除一行,我发现如果我有这个:

Today I copied the code giving this exception to another db and there the exception did not occur. Then I copied the xsp.properties from that db to the original db and the exception did not occur there either. By removing one line at a time I found out that if I have this:

xsp.application.timeout=10

我没有收到异常,如果我删除它,我就会收到异常.有谁明白为什么?默认值应该是 30 分钟,但除非我设置应用程序超时,否则我的会话对象似乎会在纳秒内消失.我将会话从 SSJS 传递到 Java 并将其存储在构造函数代码中:

I don't get the exception and if I remove it I get the exception. Does anyone understand why? The default should be 30 minutes but my session object seems to dissappear in nanoseconds unless I set the application timeout. I'm passing the session from SSJS to Java and store it in the constructor code:

private Session session;    

public Domino(Session session) {
    this.session = session;
}

如您所见,这不是托管 bean.我测试的 Domino 版本是 9.0.1,但我也需要在 8.5.2 中使用此代码.代码在 beforePageLoad 事件中运行.

As you can see this is not a managed bean. The Domino version I tested with is 9.0.1 but I need to use this code also with 8.5.2. The code is running in beforePageLoad event.

我的问题似乎解决了,但我想了解这里发生了什么.

It seems that my problem is solved but I'd like understand what's happening here.

更新 1

如果我等待一段时间(可能超过 10 分钟)然后重新加载 XPage,我仍然会在主数据库中收到错误消息.在另一个数据库中,我从未收到错误消息.

I still get the error in the main db if I wait for a while (probabaly more than 10 minutes) and then reload the XPage. In the other db I've never gotten the error.

更新 2

昨天我从一直工作的数据库中添加了完整的 xsp.properties.现在 8 小时后,它在我原来的数据库中仍然可以正常工作.看起来我也需要这个:

Yesterday I added back the full xsp.properties from the db where it has worked all the time. Now after 8 hours it still works fine also in my original db. Looks like I need also this:

xsp.persistence.mode=basic

表示将页面保留在内存中".XPage 似乎在没有此设置的情况下立即序列化(在单个 HTTP 请求中).

which means "Keeps pages in memory". It seems the XPage is serialized immediately (within a single HTTP request) without this setting.

推荐答案

事实证明,当我对父类的父类进行小的更改并构建应用程序时,它开始工作.以确保我将原始代码复制粘贴回来并且它仍然有效.

It turned out that when I made a small change to the parent of my parent class and built the application it started to work. To make sure I copy pasted the original code back and it still worked.

看起来像是某种构建问题.这不是我看到此问题的唯一案例,但下次我会尝试重新保存、清理和重建.

Looks like it was some kind of build problem. This was not the only case when I've seen this problem but next time I will try some re-saving, cleaning and rebuilding.

这篇关于xsp.application.timeout 和“对象已被删除或回收";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆