Sign in
Google apps
Main menu
Post a Comment On:
Step by Step Tutorials
"JBoss Drools - Guvnor - 401 Error"
No comments yet. -
1 – 0 of 0
I have been mentioned about JBoss Drools in my
previous post
. (JBoss Drools Step By Step)
If you got Server returned HTTP response code: 401 for URL: http://localhost:8080/drools-guvnor exception then you have to do this :
Create a change-set.xml file and fill with the code below.
<?xml version="1.0" encoding="UTF-8"?>
<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='classpath:spring/payment_rules.drl' type='DRL' /-->
<resource source='http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/com.sample/LATEST.drl'
type='DRL' basicAuthentication="enabled" username="admin" password="admin" />
</add>
</change-set>
Then use this Java Code to access knowledgeBase :
private static KnowledgeBase readKnowledgeBaseByAgent() { KnowledgeAgent agent = KnowledgeAgentFactory.newKnowledgeAgent("LocalAgent"); URL url = null;//This url is written inside the change-set.xml// String ruleUrl = "http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/com.sample/LATEST.drl"; String changeSetPath = "change-set.xml"; agent.applyChangeSet(ResourceFactory.newClassPathResource(changeSetPath)); return agent.getKnowledgeBase(); }
And no more 401 Error :)
posted by NurettinYAKIT at
07:14
on 23 Nov 2010
Leave your comment
You can use some HTML tags, such as
<b>, <i>, <a>
This blog does not allow anonymous comments.
Google Account
You will be asked to sign in after submitting your comment.
Please prove you're not a robot
"JBoss Drools - Guvnor - 401 Error"
No comments yet. -