Bug 1051089
| Summary: | Unable to load session snapshot due to a NPE | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Retired] JBoss BPMS Platform 6 | Reporter: | Ivo Bek <ibek> | ||||
| Component: | Business Central | Assignee: | Kris Verlaenen <kverlaen> | ||||
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Ivo Bek <ibek> | ||||
| Severity: | high | Docs Contact: | |||||
| Priority: | high | ||||||
| Version: | 6.0.0 | CC: | ibek, kverlaen, mbaluch, vigoyal | ||||
| Target Milestone: | ER1 | ||||||
| Target Release: | 6.0.1 | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: |
Unmarshalling a process request on the server side via a Remote API causes an error (NullPointerException). This error happens reliably on Oracle11gR2 and Postgresql 8.4 databases and on other databases intermittently.
Cause:
Consequence:
Fix:
Result:
|
Story Points: | --- | ||||
| Clone Of: | Environment: |
Oracle11gR2
PostgreSQL 8.4
|
|||||
| Last Closed: | 2014-08-06 20:03:19 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
I believe this is not related to the database or remoting. The NPE seems to be caused by the fact that a process instances was inserted into the ksession at some point but never removed (and therefore stored as part of the session state). Once a process instance is completed, the ProcessInstanceResolverStrategy is no longer able to restore it, as completed process instances are no longer in the database. When you insert process instances in the session, you should either destroy the session when the process instance is completed as well, or remove the process instance at some point from the session (before it is completed), otherwise you would end up with a memory leak (session state would keep growing with process instances). Is it possible that in the case where this NPE was detected, the session that was loaded for some reason contained a process instance that is no longer active? If so, was this intential (is there a valid use case for this) or just a side effect of a test (reusing a ksession from another test by accident, or no cleanup of ksession from previous operations)? I use only the singleton session of Business central. AFAIK there are no scenarios which would put no longer active instances into the singleton session and I do not believe I am able to. So it must be some side effect. Before ER7 I added a rule task tests and tests for testing own types, so I will try ignoring them to find out whether they are the cause because the exceptions start just after these tests. You are right that it is not related to a database because as I rerun the tests, the Oracle11gR2 DB job passed. Well, it must be the rule task tests which fail because I have run it a few times without them and there was not any problem with the load session snapshot. Do you plan to update a sources to restore the session in such cases? The problem is that when the session gets to the wrong state, there is no way how to start any process. Every attempt will fail. Yes, we should be able to avoid the NPE (either by simply inserting a new ProcessInstance object in state completed, or not reinsert a process instance object in case it was completed), to avoid the issue altogether. The problem is probably not that completed process instances are inserted in the working memory, but that an active process instance was inserted in the working memory (and that working memory was then saved) and later when restoring that same session, that process instance was no longer in the database (because the process instance already completed, or because it was deleted as part of test cleanup). The workaround for now would be to make sure the rule task tests clean up afterwards. 6.0.x: http://github.com/droolsjbpm/jbpm/commit/ee43fd0ca master: http://github.com/droolsjbpm/jbpm/commit/2ad6649c4 This no longer has a target release of 6.0.0. Verified in BPMS 6.0.1.ER1 |
Created attachment 847733 [details] stacktrace Description of problem: The following problem occurs on Oracle11gR2 and Postgresql 8.4 only. Also I saw the same type of problem on other databases but it was not so common. When I start a process via remote API, I get NPE while the request is being unmarshalled on the server side. I attach the stacktrace with the exceptions. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info: