Bug 733008
Summary: | ResourceChangeScanner fails when trying to scan package from Guvnor | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [JBoss] JBoss Enterprise BRMS Platform 5 | Reporter: | Jiri Svitak <jsvitak> | ||||||
Component: | BRE (Expert, Fusion) | Assignee: | Nobody <nobody> | ||||||
Status: | VERIFIED --- | QA Contact: | Marek Baluch <mbaluch> | ||||||
Severity: | urgent | Docs Contact: | |||||||
Priority: | unspecified | ||||||||
Version: | BRMS 5.2.0.GA | CC: | manstis, mbaluch, trevor.quinn, trikkola | ||||||
Target Milestone: | --- | ||||||||
Target Release: | BRMS 5.3.0.GA | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: |
In JBoss BRMS 5.2 ResourceChangeScanner failed to scan a package in the BRMS Repository. This issue was present in BRMS 5.2 but is no longer present in BRMS 5.3.
|
Story Points: | --- | ||||||
Clone Of: | Environment: | ||||||||
Last Closed: | Type: | --- | |||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Attachments: |
|
Description
Jiri Svitak
2011-08-24 13:02:50 UTC
Created attachment 519637 [details]
Class to reproduce bug
Added link to (probable) identical JIRA issue. manstis: It seems that this is not identical issue, because fixing bug https://issues.jboss.org/browse/GUVNOR-1699 did not solve this problem. I have added link to external issues https://issues.jboss.org/browse/JBRULES-3282 https://issues.jboss.org/browse/JBRULES-3287 which were created by Geoffrey De Smet. He tried to solve them, but there is a deeper problem which should be solved by someone else who works on engine. Just for information the same problem appears for other types of resources, like XLS, CSV, BPMN and he wrote some comments on XLS scanning issue: https://bugzilla.redhat.com/show_bug.cgi?id=741219 Edson Tirelli <ed.tirelli> updated the status of jira JBRULES-3287 to Resolved Edson Tirelli <ed.tirelli> made a comment on jira JBRULES-3287 Geoffrey, I am trying to get my head around this ticket and all the related ones. I applied your test case and after removing a couple lines from the test that I think were wrong, the test no longer fails. I added the test to both master and 5.3.x branches anyway and I am closing this ticket. Please let me know if you think there is still a problem here. Edson Tirelli <ed.tirelli> updated the status of jira JBRULES-3287 to Closed Edson Tirelli <ed.tirelli> updated the status of jira JBRULES-3282 to Closed Tested using provided class (many thanks) following Edson's changes. Could not replicate issue hence believe Edson's changes have fixed. Please verify the issue on 5.3 ER4. Verified in BRMS 5.3 ER4. I have found that this was fixed just partially. The test case shows just exceptions from scanner service thread. Scanner started and after first scan it threw exception. This was fixed. Now scanner scans without exceptions, but scanner didn't have to check for changes in packages. Scanning of changes in package however doesn't work correctly now. When I have scanner service enabled I can load a package. When I make change in Guvnor manually (for example I add one rule) it behaves differently for two possibilities depending on using kbase: 1.) with incremental rebuilding of KnowledgeBase it works (property newInstance=false) 2.) with building of new KnowledgeBase each time (newInstance=true) it detects change, but it fails with exception and KnowledgeBase is empty I'll create a new test case for this issue and perhaps I'll raise a new Bugzilla too. So here are the steps for reproducing the problem: 1. Download Guvnor. Make sure that version of Guvnor and engine is the same. I have used version BRMS 5.3.0 ER4. 2. Start Guvnor and import sample 'mortgages' package. 3. Run the improved test case (see the second attached java file above). 4. You have one minute to change mortgages package. For example add a rule and build mortgages package in Guvnor. 5. Every 10s scanner polls for changes. Your change will be noticed, but KnowledgeAgent fails to build new KnowledgeBase with following exception: [2012-02-29 15:13:06,110:debug] ResourceChangeScanner attempt to scan 2 resources [2012-02-29 15:13:06,116:debug] ResourceChangeScanner thread is waiting for 10 seconds. [2012-02-29 15:13:16,116:debug] ResourceChangeScanner attempt to scan 2 resources [2012-02-29 15:13:16,121:debug] ResourceChangeScanner thread is waiting for 10 seconds. [2012-02-29 15:13:26,122:debug] ResourceChangeScanner attempt to scan 2 resources [2012-02-29 15:13:26,127:debug] ResourceChangeScanner modified resource=[UrlResource path='http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/mortgages/LATEST'] : 1330528367000 : 1330528400000 [2012-02-29 15:13:26,127:debug] ResourceChangeNotification received ChangeSet notification [2012-02-29 15:13:26,127:debug] ResourceChangeScanner thread is waiting for 10 seconds. [2012-02-29 15:13:26,127:debug] ResourceChangeNotification processing ChangeSet [2012-02-29 15:13:26,127:debug] ResourceChangeNotification ChangeSet modified resource=[UrlResource path='http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/mortgages/LATEST'] for listener=org.drools.agent.impl.KnowledgeAgentImpl@2a8ceeea [2012-02-29 15:13:26,127:debug] KnowledgeAgent received ChangeSet changed notification [2012-02-29 15:13:26,127:debug] ResourceChangeNotification thread is waiting for queue update [2012-02-29 15:13:26,127:info] KnowledgeAgent applying ChangeSet [2012-02-29 15:13:26,127:debug] KnowledgeAgent removing mappings for resource=[UrlResource path='http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/mortgages/LATEST'] with unsubscribe=false [2012-02-29 15:13:26,127:debug] KnowledgeAgent rebuilding KnowledgeBase using ChangeSet Exception in thread "Thread-4" java.lang.NullPointerException at org.drools.io.impl.ReaderResource.getInputStream(ReaderResource.java:75) at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:445) at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:638) at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:41) at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:725) at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:1018) at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:801) at org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:670) at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:201) at org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:1213) at java.lang.Thread.run(Thread.java:679) [2012-02-29 15:13:36,127:debug] ResourceChangeScanner attempt to scan 2 resources [2012-02-29 15:13:36,133:debug] ResourceChangeScanner modified resource=[UrlResource path='http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/mortgages/LATEST'] : 1330528367000 : 1330528400000 [2012-02-29 15:13:36,133:debug] ResourceChangeNotification received ChangeSet notification [2012-02-29 15:13:36,133:debug] ResourceChangeScanner thread is waiting for 10 seconds. [2012-02-29 15:13:36,133:debug] ResourceChangeNotification processing ChangeSet [2012-02-29 15:13:36,134:debug] ResourceChangeNotification ChangeSet modified resource=[UrlResource path='http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/mortgages/LATEST'] for listener=org.drools.agent.impl.KnowledgeAgentImpl@2a8ceeea [2012-02-29 15:13:36,134:debug] KnowledgeAgent received ChangeSet changed notification [2012-02-29 15:13:36,134:debug] ResourceChangeNotification thread is waiting for queue update [2012-02-29 15:13:46,134:debug] ResourceChangeScanner attempt to scan 2 resources [2012-02-29 15:13:46,140:debug] ResourceChangeScanner modified resource=[UrlResource path='http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/mortgages/LATEST'] : 1330528367000 : 1330528400000 [2012-02-29 15:13:46,140:debug] ResourceChangeNotification received ChangeSet notification [2012-02-29 15:13:46,140:debug] ResourceChangeScanner thread is waiting for 10 seconds. [2012-02-29 15:13:46,140:debug] ResourceChangeNotification processing ChangeSet [2012-02-29 15:13:46,140:debug] ResourceChangeNotification ChangeSet modified resource=[UrlResource path='http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/mortgages/LATEST'] for listener=org.drools.agent.impl.KnowledgeAgentImpl@2a8ceeea [2012-02-29 15:13:46,140:debug] KnowledgeAgent received ChangeSet changed notification [2012-02-29 15:13:46,141:debug] ResourceChangeNotification thread is waiting for queue update [2012-02-29 15:13:56,141:debug] ResourceChangeScanner attempt to scan 2 resources [2012-02-29 15:13:56,147:debug] ResourceChangeScanner modified resource=[UrlResource path='http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/mortgages/LATEST'] : 1330528367000 : 1330528400000 [2012-02-29 15:13:56,147:debug] ResourceChangeNotification received ChangeSet notification [2012-02-29 15:13:56,147:debug] ResourceChangeScanner thread is waiting for 10 seconds. [2012-02-29 15:13:56,147:debug] ResourceChangeNotification processing ChangeSet [2012-02-29 15:13:56,147:debug] ResourceChangeNotification ChangeSet modified resource=[UrlResource path='http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/mortgages/LATEST'] for listener=org.drools.agent.impl.KnowledgeAgentImpl@2a8ceeea [2012-02-29 15:13:56,147:debug] KnowledgeAgent received ChangeSet changed notification [2012-02-29 15:13:56,147:debug] ResourceChangeNotification thread is waiting for queue update I have tried to reproduce this issue with just PKG files, changing them on disk, but I was unable to reproduce exception above. Created attachment 566556 [details]
Improved test case
Hi Jiri, You talked about making an arquillian test case to reproduce this issue. Thanks :) Can you notify me with the pull request url when it's added to the pulls? https://github.com/droolsjbpm/droolsjbpm-integration/pulls Tried with that AgentTest class (the improved testcase, which isn't an arq testcase yet) with guvnor: cannot reproduce the NPE on master, nor on 5.3.x. Jiri said he can reproduce on ER5, so maybe it's fixed for ER6? I can confirm that the bug appears in BRMS 5.3 ER4 and ER5. I have not tested Drools master. Perhaps this bug was fixed by fixing 732085. I'll try to test master branch to double check that bug was fixed. I have created an automated test case for this bug, which uses the Arquillian. See https://github.com/droolsjbpm/guvnor/pull/47 However, this test case needs to be fixed, because REST client which modifies the repository is not yet able to delete asset rule2. I've partially fixed the testcase, and got it to succeed on master by manually rebuilding the package at the correct time. https://github.com/droolsjbpm/guvnor/commit/79f073360c15ddae1d280a1fd5134e3582e136b1 I 'll further look into automating it completely so we can unignore it and have a good regression test for future work. Since I can't reproduce on 5.3.x or on master, we're presuming it was fixed from ER5 to ER6. Once ER6 is build, jiri will confirm and reopen the issue if needed. Update status to ON_QA. Please verify them against ER6. Verified in BRMS 5.3.0 ER6. Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: In JBoss BRMS 5.2 ResourceChangeScanner failed to scan a package in the BRMS Repository. This issue was present in BRMS 5.2 but is no longer present in BRMS 5.3. |