Bug 966300 - ResourceChangeScanner marks Guvnor URLResources (package source and binary) as "removed"
ResourceChangeScanner marks Guvnor URLResources (package source and binary) a...
Status: CLOSED NOTABUG
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
5.x.x
Unspecified Unspecified
unspecified Severity high
: ---
: ---
Assigned To: Jervis Liu
Lukáš Petrovický
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-05-22 21:31 EDT by Toshiya Kobayashi
Modified: 2015-12-04 10:19 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-30 07:00:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker GUVNOR-1699 Blocker Resolved ResourceChangeScanner marks Guvnor URLResources (package source and binary) as "removed" 2016-03-31 04:31 EDT
JBoss Issue Tracker GUVNOR-2014 Major Closed UrlResource.grabLastMod() fails to get Last-Modified header for Guvnor REST URLResources (package source and binary) 2016-03-31 04:31 EDT

  None (edit)
Description Toshiya Kobayashi 2013-05-22 21:31:21 EDT
Description of problem:

Platform BZ for https://issues.jboss.org/browse/GUVNOR-1699

How reproducible:

Always

Steps to Reproduce:
1. Use KnowledgeAgent with ChangeSet.xml which points at "http://localhost:8080/jboss-brms/rest/packages/mortgages/binary" or "http://localhost:8080/jboss-brms/rest/packages/mortgages/source"

<change-set xmlns='http://drools.org/drools-5.0/change-set'
    xmlns:xs='http://www.w3.org/2001/XMLSchema-instance'
    xs:schemaLocation='http://drools.org/drools-5.0/change-set http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-api/src/main/resources/change-set-1.0.0.xsd' >
    <add>
        <resource source='http://localhost:8080/jboss-brms/rest/packages/mortgages/binary' basicAuthentication='enabled' username='admin' password='admin' type="PKG"  />
    </add>
</change-set>

2. Let it scan

Actual results:

scan fails to detect the resource and assume it was removed. So empty kbase is built.

[2013-05-23 10:19:31,152:debug] KnowledgeAgent received ChangeSet changed notification
==>[BeforeChangeSetAppliedEvent: org.drools.io.impl.ChangeSetImpl@d5e92d7]
[2013-05-23 10:19:31,152:info] KnowledgeAgent applying ChangeSet
==>[BeforeChangeSetProcessedEvent: org.drools.io.impl.ChangeSetImpl@d5e92d7]
==>[BeforeResourceProcessedEvent(RESOURCE_MODIFIED): [UrlResource path='http://localhost:8080/jboss-brms/rest/packages/mortgages/binary']]
[2013-05-23 10:19:31,153:debug] KnowledgeAgent removing mappings for resource=[UrlResource path='http://localhost:8080/jboss-brms/rest/packages/mortgages/binary'] with unsubscribe=true
[2013-05-23 10:19:31,153:debug] KnowledgeAgent notifier unsubscribing to resource=[UrlResource path='http://localhost:8080/jboss-brms/rest/packages/mortgages/binary']
==>[AfterResourceProcessedEvent(RESOURCE_MODIFIED): [UrlResource path='http://localhost:8080/jboss-brms/rest/packages/mortgages/binary']]
==>[AfterChangeSetProcessedEvent: org.drools.io.impl.ChangeSetImpl@d5e92d7]
[2013-05-23 10:19:31,153:debug] KnowledgeAgent rebuilding KnowledgeBase using ChangeSet
[2013-05-23 10:19:31,154:debug] KnowledgeAgent building resource map
[2013-05-23 10:19:31,154:info] KnowledgeAgent new KnowledgeBase now built and in use
==>[KnowledgeBaseUpdatedEvent: org.drools.impl.KnowledgeBaseImpl@3bfa681c]
[2013-05-23 10:19:31,154:debug] KnowledgeAgent finished rebuilding KnowledgeBase using ChangeSet
==>[AfterChangeSetAppliedEvent: org.drools.io.impl.ChangeSetImpl@d5e92d7]

Expected results:

scan doesn't fail and is able to detect resource update as well.

Additional info:

<resource source='http://localhost:8080/jboss-brms/org.drools.guvnor.Guvnor/package/mortgages/LATEST' basicAuthentication='enabled' username='admin' password='admin' type="PKG"  />

works. But some customers prefer "http://localhost:8080/jboss-brms/rest/packages/mortgages/binary" because it makes package building happen as well.
Comment 1 Toshiya Kobayashi 2013-05-22 23:17:34 EDT
GUVNOR-1699 has been fixed for Guvnor 5.4.0 but this use case doesn't work yet.

I have filed https://issues.jboss.org/browse/GUVNOR-2014 about the detail.
Comment 2 JBoss JIRA Server 2013-05-22 23:27:27 EDT
Toshiya Kobayashi <tkobayas@redhat.com> made a comment on jira GUVNOR-2014

Attached a reproducer which works with mortgages sample.
Comment 6 Jervis Liu 2013-07-30 06:57:14 EDT
I dont think this bug is relevant to 6.0. The whole build system is changed, as well as the REST API. For example, we do not provide REST API for package based resources (we do not have "package" anymore in 6.0): URL http://localhost:8080/jboss-brms/rest/packages/mortgages/binary
Comment 7 Lukáš Petrovický 2013-07-30 07:00:23 EDT
Thanks for the info, closing.
Comment 8 JBoss JIRA Server 2013-08-25 12:07:48 EDT
Demian Calcaprina <calcacuervo@gmail.com> made a comment on jira GUVNOR-2014

Just sent a pull request in the following ticket to fix it.
https://issues.jboss.org/browse/DROOLS-240
Comment 9 JBoss JIRA Server 2015-12-04 10:19:44 EST
Toni Rikkola <toni@rikkola.net> updated the status of jira GUVNOR-2014 to Closed

Note You need to log in before you can comment on or make changes to this bug.