Thanks. I started going down that path. It appears that even the
changeset xml file can't be found from the Guvnor. So I will need to
pass authentication with the URL given to the applyChangeset method.
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Esteban
Aliverti
Sent: Wednesday, June 30, 2010 6:35 PM
To: Rules Users List
Subject: Re: [rules-users] Drools and Guvnor 5.1M2 - Exception
beingthrownin processChangeSet
The problem seams to happen because the kagent can't access the url.
If you try to access the change set xml using a browser, does the
browser ask you for authentication? I don't know why, but guvnor protect
its urls since 5.1 I think.
So, basically, the error is that guvnor can't read from the url. The
same error happens if you provide a non existent url. I need to open a
jira for this.
As a work around, try doing this:
<change-set
xmlns='http://drools.org/drools-5.0/change-set
<
http://drools.org/drools-5.0/change-set> '
xmlns:xs='http://www.w3.org/2001/XMLSchema-instance
<
http://www.w3.org/2001/XMLSchema-instance> '
xs:schemaLocation='http://drools.org/drools-5.0/change-set
drools-change-set-5.0.xsd
<
http://drools.org/drools-5.0/change-setdrools-change-set-5.0.xsd> ' >
<add>
<resource basicAuthentication='enabled' username='admin'
password='admin'
source='http://ruleserver/drools-guvnor/org.drools.guvnor.Guvnor/package
/my.rule.package/LATEST
<
http://ruleserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.rul
e.package/LATEST> ' type='PKG' />
</add>
</change-set>
Remember to replace username and password.
Best,
2010/6/30 Jeffrey Schneller <jeffrey.schneller(a)envisa.com>
Here is the xml file I am getting:
<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
drools-change-set-5.0.xsd
<
http://drools.org/drools-5.0/change-setdrools-change-set-5.0.xsd> ' >
<add>
<resource
source='http://ruleserver/drools-guvnor/org.drools.guvnor.Guvnor/package
/my.rule.package/LATEST' type='PKG' />
</add>
</change-set>
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Esteban
Aliverti
Sent: Wednesday, June 30, 2010 3:18 PM
To: Rules Users List
Subject: Re: [rules-users] Drools and Guvnor 5.1M2 - Exception being
thrownin processChangeSet
Could you please post the xml file you are getting from
http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.rul
e.package/LATEST/ChangeSet.xml
<
http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.ru
le.package/LATEST/ChangeSet.xml> ?
Best,
2010/6/30 Jeffrey Schneller <jeffrey.schneller(a)envisa.com>
I am trying to upgrade to the 5.1M2 build from 5.0.1 and am running into
some issues. I have installed the new 5.1 Guvnor and imported the rules
from my 5.0.1 Guvnor instance.
I then removed the old 5.0.1 drools jars from my app and replaced them
with the 5.1M2 drools jars. I was also added all the dependent
libraries. The code that worked with the 5.0.1 version does not work
with the 5.1M2 version. In 5.0.1 I was constructing the xml and
streaming it into the applyChangeSet method. With 5.1M2 I am just
pointing to the change set xml file that is in the Guvnor.
I am seeing a NullPointerException being thrown in the processChangeSet
method as shown below.
Caused by: java.lang.NullPointerException
at
org.drools.agent.impl.KnowledgeAgentImpl.processChangeSet(KnowledgeAgent
Impl.java:171)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:143)
at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:130)
Did I miss something? Am I doing something wrong? Below is the code
that I have.
KnowledgeAgentConfiguration kaconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
kaconf.setProperty( "drools.agent.scanDirectories",
"true" );
kaconf.setProperty("drools.agent.newInstance",
"false");
ResourceFactory.getResourceChangeScannerService().start();
ResourceFactory.getResourceChangeNotifierService().start();
String url =
"http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.ru
le.package/LATEST/ChangeSet.xml";
KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent( "Configuration", kaconf );
kagent.setSystemEventListener(new MyDroolsListener());
try {
kagent.applyChangeSet(ResourceFactory.newUrlResource(new URL(url)));
// ERROR IS OCCURING INSIDE OF applyChangeSet
} catch (MalformedURLException e) {
e.printStackTrace();
}
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Esteban Aliverti