<span style="color: rgb(0, 0, 153);">     </span><span style="color: rgb(0, 0, 153);" id="result_box" class="short_text" lang="en"><span style="" title="">Hi all,<br><br>I am using Drools Guvnor </span></span><span style="color: rgb(0, 0, 153);" id="result_box" class="short_text" lang="en"><span style="" title="">as follows:</span></span><br style="color: rgb(0, 0, 153);">
<br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">1º Security configuration:</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&lt;security:identity authenticate-method=&quot;#{defaultAuthenticator.authenticate}&quot;/&gt;</span><br style="color: rgb(0, 0, 153);">
<span style="color: rgb(0, 0, 153);">&lt;security:role-based-permission-resolver enable-role-based-authorization=&quot;true&quot;/&gt;<br><br>2º User permission: an user as administrator with permissions of:<br>- Analyst for &#39;category=examples&#39; <br>
- package.developer for &#39;package=org.examples&#39;<br><br></span><span style="color: rgb(0, 0, 153);" id="result_box" class="" lang="en"><span style="" title="">What additional configuration is needed to consume a rules from an application using a</span></span> &#39;<span style="color: rgb(0, 0, 153);">Knowledge Agent&#39;?</span><br style="color: rgb(0, 0, 153);">
<br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);" id="result_box" class="short_text" lang="en"><span style="background-color: rgb(230, 236, 249);" title="">Someone has an example or tutorial to use of &#39;Knowledge Agent&#39;?</span></span><br style="color: rgb(0, 0, 153);">
<br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);" id="result_box" class="" lang="en"><span style="" title="">I hope someone can help me in this issue that is critical to use drools in a real project. I </span></span><span style="color: rgb(0, 0, 153);" id="result_box" class="short_text" lang="en"><span style="" title="">attached the related files</span></span><span style="color: rgb(0, 0, 153);">.</span><br>
<br><span style="color: rgb(0, 0, 153);">Thanks and regards,</span><br><br><div class="gmail_quote">2010/10/22 developer researcher <span dir="ltr">&lt;<a href="mailto:java.developer.researcher@gmail.com">java.developer.researcher@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><span style="color: rgb(0, 0, 153);">Hello Michael,</span><br style="color: rgb(0, 0, 153);">
<br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">I included the code for authentication but occurs a new exception. I think that is by configuration of Guvnor.</span><br style="color: rgb(0, 0, 153);">

<br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">I attached the exception and the log of guvnor. </span><span style="color: rgb(0, 0, 153);" lang="en"><span title="">I hope you can help me.</span></span><br style="color: rgb(0, 0, 153);">

<br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">Thanks and regards,</span><br><br><div class="gmail_quote">2010/10/21 Michael Anstis <span dir="ltr">&lt;<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>&gt;</span><div>
<div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi,<div><br></div><div>#2</div><div><br></div><div>You could try setting the basicAuthentication, Username and Password properties on UrlResource before adding it to the builder:-</div>

<div><br></div><div><font face="&#39;courier new&#39;, monospace">&lt;snip&gt;</font></div>
<div><font face="&#39;courier new&#39;, monospace">    builder.add(ResourceFactory.newUrlResource(url), ResourceType.PKG);</font></div><div><font face="&#39;courier new&#39;, monospace">&lt;/snip&gt;</font></div>
<div><br></div><div><div><font face="&#39;courier new&#39;, monospace">&lt;snip&gt;</font></div><div><font face="&#39;courier new&#39;, monospace">    UrlResource urlResource = </font><span style="font-family: &#39;courier new&#39;,monospace;">ResourceFactory.newUrlResource(url);</span></div>


<div><span style="font-family: &#39;courier new&#39;,monospace;">    urlResource.setBasicAuthentication(&quot;enabled&quot;);</span></div><div><span style="font-family: &#39;courier new&#39;,monospace;">    urlResource.setUsername(&quot;Smurf&quot;);</span></div>


<div><span style="font-family: &#39;courier new&#39;,monospace;">    urlResource.setPassword(&quot;Smurfy&quot;);</span></div><div><font face="&#39;courier new&#39;, monospace">    builder.add(urlResource, ResourceType.PKG);</font></div>


<div><font face="&#39;courier new&#39;, monospace">&lt;/snip&gt;</font></div><div><font face="&#39;courier new&#39;, monospace"><br></font></div>When you shift to using change-sets you should be able to embed the basic authentication in the change-set.xml file (as per my previous link) - your example code isn&#39;t using KnowledgeAgent yet; simply a URL resource.</div>


<div><br></div><div><br><div class="gmail_quote">2010/10/21 developer researcher <span dir="ltr">&lt;<a href="mailto:java.developer.researcher@gmail.com" target="_blank">java.developer.researcher@gmail.com</a>&gt;</span><div>

<div></div><div><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<span style="color: rgb(0, 0, 153);">Hello Michael and Subhas, thanks for your answers.</span><br style="color: rgb(0, 0, 153);"><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">Apparently the problem is due to permission. I am using the next configuration:</span><br style="color: rgb(0, 0, 153);">



<br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&lt;security:identity authenticate-method=&quot;#{defaultAuthenticator.authenticate}&quot;/&gt;</span><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">&lt;security:role-based-permission-resolver enable-role-based-authorization=&quot;true&quot;/&gt;</span><br style="color: rgb(0, 0, 153);">



<br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">I attached the class that use for my test, in this code not included code for authenticate. In that sense I have new questions:</span><br style="color: rgb(0, 0, 153);">



<br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">1º What is the minimal configuration of Guvnor for use the Knowledge Agent?</span><br style="color: rgb(0, 0, 153);"><br style="color: rgb(0, 0, 153);">


<span style="color: rgb(0, 0, 153);">2º What code should be included for authentication?</span><br style="color: rgb(0, 0, 153);"><br style="color: rgb(0, 0, 153);"><span style="color: rgb(0, 0, 153);">Thanks and regards,</span><br>



<br><div class="gmail_quote">2010/10/20 Subhas <span dir="ltr">&lt;<a href="mailto:subhas.sing@gmail.com" target="_blank">subhas.sing@gmail.com</a>&gt;</span><div><div></div><div><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">



Give some more details like code and jars in build path. I use KnowledgeBase and working fine for me.<br><br>Thanks,<br><font color="#888888">Subhas</font><div><div></div><div><br><br><div class="gmail_quote">On Wed, Oct 20, 2010 at 12:54 PM, java.developer.researcher <span dir="ltr">&lt;<a href="mailto:java.developer.researcher@gmail.com" target="_blank">java.developer.researcher@gmail.com</a>&gt;</span> wrote:<br>




<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div><br>
Hello,<br>
<br>
I am trying of integrate Drools Guvnor with an java web application. I am<br>
using KnowledgeAgent, but occurs the next exception when execute the code:<br>
<br>
java.lang.RuntimeException: java.io.IOException: Server returned HTTP<br>
response code: 401 for URL:<br>
<a href="http://localhost:8383/drools-guvnor/org.drools.guvnor.Guvnor/package/org.examples/org.examples" target="_blank">http://localhost:8383/drools-guvnor/org.drools.guvnor.Guvnor/package/org.examples/org.examples</a><br>





        at<br>
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:559)<br>
        at<br>
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)<br>
        at<br>
org.examples.test.TestKnowledgeAgent.getKnowledgeBase(TestKnowledgeAgent.java:63)<br>
        at<br>
org.examples.test.TestKnowledgeAgent.main(TestKnowledgeAgent.java:28)<br>
Caused by: java.io.IOException: Server returned HTTP response code: 401 for<br>
URL:<br>
<a href="http://localhost:8383/drools-guvnor/org.drools.guvnor.Guvnor/package/org.examples/org.examples" target="_blank">http://localhost:8383/drools-guvnor/org.drools.guvnor.Guvnor/package/org.examples/org.examples</a><br>





        at<br>
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)<br>
        at<br>
org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:76)<br>
        at<br>
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:512)<br>
        ... 3 more<br>
Exception in thread &quot;main&quot; java.lang.NullPointerException<br>
        at<br>
org.examples.test.TestKnowledgeAgent.main(TestKnowledgeAgent.java:37)<br>
<br>
     What is the cause of this exception? How can I solved it?<br>
<br>
Any help is welcome.<br>
<br>
</div></div>Regards,<br>
<font color="#888888">--<br>
View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/Use-Knowledge-Agent-tp1741354p1741354.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/Use-Knowledge-Agent-tp1741354p1741354.html</a><br>





Sent from the Drools - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</font></blockquote></div><br>
</div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div></div></div><br><div style="display: inline;"></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div></div></div><br></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div></div></div><br><div style="display: inline;"></div>
</blockquote></div><br><div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup {  position:absolute;  z-index:9999;  padding: 0px 0px;  margin-left: 0px;  margin-top: 0px;  width: 240px;  overflow: hidden;  word-wrap: break-word;  color: black;  font-size: 10px;  text-align: left;  line-height: 13px;}</style>