[rules-users] urlResource, applyChangeset and authentication error

Esteban Aliverti esteban.aliverti at gmail.com
Tue Jan 3 12:16:23 EST 2012


Where do you have your 'rules' directory? Are you sure it is in the
classpath?
Did you try this?

kagent.applyChangeSet(
ResourceFactory.newClassPathResource("rules/ChangeSet.xml"));

(Without the initial '/')

Best Regards,

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Esteban Aliverti
- Developer @ http://www.plugtree.com
- Blog @ http://ilesteban.wordpress.com


On Tue, Jan 3, 2012 at 5:21 PM, kachaps4u <kachanAnidharan at gmail.com> wrote:

> /@Esteban-
> I have created an xml file with resource added with authentication like
> below and put it in rules/ChangeSet.xml:/
>
> 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/org.drools.guvnor.Guvnor/package/pop.blah.test/CAR
> '
> type='PKG'
>         basicAuthentication="enabled" username="jboss"
>         password="jboss"/>
>    </add>
> </change-set>
>
> /And also edited the code to add classPath resource like this below:/
>
>
> kagent.applyChangeSet(
> ResourceFactory.newClassPathResource("/rules/ChangeSet.xml"));
>
>
> /Now its giving me this error:/
>
> 2012:01:03 11:01:375:info] ResourceChangeNotification created
> [2012:01:03 11:01:375:info] ResourceChangeScanner reconfigured with
> interval=60
> [2012:01:03 11:01:375:info] ResourceChangeScanner created with default
> interval=60
> [2012:01:03 11:01:375:debug] ResourceChangeNotification monitor added
> monitor=org.drools.io.impl.ResourceChangeScannerImpl at 177b3cd
> [2012:01:03 11:01:375:debug] KnowledgeAgent building resource map
> [2012:01:03 11:01:375:info] KnowledegAgent has started listening for
> ChangeSet notifications
> [2012:01:03 11:01:375:info] KnowledgeAgent created, with configuration:
> monitorChangeSetEvents=true scanResources=true scanDirectories=true
> newInstance=true
> [2012:01:03 11:01:406:exception]
> java.lang.RuntimeException: Unable to parse ChangeSet
>        at
>
> org.drools.agent.impl.KnowledgeAgentImpl.getChangeSet(KnowledgeAgentImpl.java:393)
>        at
>
> org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:168)
>        at pop.blah.test.CarApp.main(CarApp.java:16)
> Caused by: java.io.FileNotFoundException: '/rules/ChangeSet.xml' cannot be
> opened because it does not exist
>        at
>
> org.drools.io.impl.ClassPathResource.getInputStream(ClassPathResource.java:116)
>        at
> org.drools.io.impl.ClassPathResource.getReader(ClassPathResource.java:163)
>         at
>
> org.drools.agent.impl.KnowledgeAgentImpl.getChangeSet(KnowledgeAgentImpl.java:391)
>        ... 2 more
> [2012:01:03 11:01:406:exception]
> java.lang.RuntimeException: Unable to parse ChangeSet
>        at
>
> org.drools.agent.impl.KnowledgeAgentImpl.getChangeSet(KnowledgeAgentImpl.java:397)
>        at
>
> org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:168)
>        at pop.blah.test.CarApp.main(CarApp.java:16)
> [2012:01:03 11:01:406:info] KnowledgeAgent applying ChangeSet
> Exception in thread "main" java.lang.NullPointerException
>        at
>
> org.drools.agent.impl.KnowledgeAgentImpl.processChangeSet(KnowledgeAgentImpl.java:215)
>        at
>
> org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:183)
>        at
>
> org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:168)
>        at pop.blah.test.CarApp.main(CarApp.java:16)
>
>
> Its file not found! I don't understand why there is file not found? Please
> help.
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/urlResource-applyChangeset-and-authentication-error-tp3629051p3629542.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120103/dcb40f8b/attachment.html 


More information about the rules-users mailing list