Bug 966300 - ResourceChangeScanner marks Guvnor URLResources (package source and binary) as "removed"
Summary: ResourceChangeScanner marks Guvnor URLResources (package source and binary) a...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Business Central
Version: 5.x.x
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Jervis Liu
QA Contact: Lukáš Petrovický
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-23 01:31 UTC by Toshiya Kobayashi
Modified: 2018-12-01 14:46 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2013-07-30 11:00:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker GUVNOR-1699 0 Blocker Resolved ResourceChangeScanner marks Guvnor URLResources (package source and binary) as "removed" 2016-03-31 08:31:14 UTC
Red Hat Issue Tracker GUVNOR-2014 0 Major Closed UrlResource.grabLastMod() fails to get Last-Modified header for Guvnor REST URLResources (package source and binary) 2016-03-31 08:31:14 UTC

Description Toshiya Kobayashi 2013-05-23 01:31:21 UTC
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-23 03:17:34 UTC
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-23 03:27:27 UTC
Toshiya Kobayashi <tkobayas> made a comment on jira GUVNOR-2014

Attached a reproducer which works with mortgages sample.

Comment 6 Jervis Liu 2013-07-30 10:57:14 UTC
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 11:00:23 UTC
Thanks for the info, closing.

Comment 8 JBoss JIRA Server 2013-08-25 16:07:48 UTC
Demian Calcaprina <calcacuervo> 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 15:19:44 UTC
Toni Rikkola <toni> 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.