-
1. Re: Error 401 when a java program calls a guvnor package
doboss Dec 5, 2012 11:21 AM (in response to mister_nono)Have you turned off authentication or specified a username/password?
-
2. Re: Error 401 when a java program calls a guvnor package
doboss Dec 5, 2012 12:04 PM (in response to doboss)Not that I know how to do that... just something I've read in other places. (I am having similar problems)
Have you tried this URL: http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/myNewPackage/binary
You should be able to copy the correct URL from the Guvnor's edit tab.
-
3. Re: Error 401 when a java program calls a guvnor package
mister_nono Dec 6, 2012 2:09 AM (in response to doboss)It's ok now with the good login.
Thank
-
4. Re: Error 401 when a java program calls a guvnor package
doboss Dec 6, 2012 9:03 AM (in response to mister_nono)Would you mind sharing with me how you specified the login and password? I have not figured that part out yet.
Thanks!
-
5. Re: Error 401 when a java program calls a guvnor package
mister_nono Dec 6, 2012 10:33 AM (in response to doboss)In java code :
KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("NUMBER");
kagent.applyChangeSet(ResourceFactory.newClassPathResource("com/changeset.xml"));
In xml file :
<?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="http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/number/NUMBER"
type="PKG"
basicAuthentication="enabled"
username="****"
password="****"/>
</add>
</change-set>
Bye
-
6. Re: Error 401 when a java program calls a guvnor package
doboss Dec 6, 2012 11:58 AM (in response to mister_nono)Never mind, it looks like if can be done like this:
UrlResource resource = (UrlResource) ResourceFactory.newUrlResource(url); resource.setBasicAuthentication("enabled"); resource.setUsername("guest"); resource.setPassword("guest");
-
7. Re: Error 401 when a java program calls a guvnor package
mister_nono Dec 6, 2012 12:54 PM (in response to doboss)why not, if it works !
Bye