OK, in which case I don&#39;t believe there is an alternative to what you are attempting.<br><br>Technology aside the requirement is the same:-<br><ul><li>Download remote resource (JARs in your case)<br></li><li>Add resource to local environment (JARs to required classpath in your case)<br>
</li></ul>My advice would have been:-<br><ul><li>Use the REST API to retrieve a list of assets.</li><li>Iterate list identifying which assets are model JARs</li><li>Iterate JAR list and use REST API to download binary</li>
</ul>How you add the binary to your classpath is up to you.<br><br>This is obviously what you are doing.<br><br><div class="gmail_quote">2012/1/25 Voradov <span dir="ltr">&lt;<a href="mailto:madalin100884@yahoo.com">madalin100884@yahoo.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit" valign="top">Hi, the context is that somebody else creates the fact models and puts them there along with the rules.<br>
<br>I have to create a knowledge agent without knowing the rules and jars, but only knowing the links to those PKG.<br><br>The classloader will be used later for constructing facts in an automated fashion (something like genarating java code) and which need to be tested by the knowledge agent.<br>
<br>How should I fulfill this remote class loading of the jar files?<div class="im"><br><br><span style="color:rgb(0,0,255);font-family:arial black"><font><span style="color:rgb(0,0,0)"></span></font></span><br><br>--- On <b>Wed, 1/25/12, manstis [via Drools] <i>&lt;<a href="http://user/SendEmail.jtp?type=node&amp;node=3687677&amp;i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>&gt;</i></b> wrote:<br>
</div><blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px"><div class="im"><br>From: manstis [via Drools]
 &lt;<a href="http://user/SendEmail.jtp?type=node&amp;node=3687677&amp;i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a>&gt;<br>Subject: Re: [rules-users] unable to update the changes (guvnor rules) to application using changeset<br>
To: &quot;Voradov&quot; &lt;<a href="http://user/SendEmail.jtp?type=node&amp;node=3687677&amp;i=2" rel="nofollow" link="external" target="_blank">[hidden email]</a>&gt;<br></div>Date: Wednesday, January 25, 2012, 3:17 PM<br>
<br><div><div class="im">

        Why not just ensure the model JARs uploaded to Guvnor are also on the KA&#39;s classpath?<br><br>This of course assumes you have the JARs in the first place, and they are not added remotely to Guvnor by another user, in a different location.<br>

<br>If this is however the case then you&#39;d have the same problem whether using KA or not; i.e. needing JARs you don&#39;t have.<br><br></div><div>2012/1/25 Voradov <span dir="ltr">&lt;<a rel="nofollow" link="external">[hidden email]</a>&gt;</span><div>
<div class="h5"><br>
<blockquote style="border-left:2px solid #cccccc;padding:0 1em"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font:inherit" valign="top">Hi, exactly, this is the issue:<br>
I have a remote Guvnor server, not a local one and I had tried to set up a changeset.xml with PKG type links to the remote contained packages, in order to load in a local running agent those packages.<br><br>But it was not enough.<br>

When loading the packages, it does not know to load also the jar files, so because of this, somehow the jars should be added in the classpath. At this moment i ended by filling the classpath of my local running eclipse with all the local jars in order to create a running knowledge agent.<br>

<br>I can use REST protocol to get all packages, and from there to obtain the URL of the contained jars from each package and to programmatically download locally the jars in a folder and after that, for each of them to do something like this <br>

<table><tbody><tr><td><code></code><br></td><td><code>URL jarURL = </code><code>this</code><code>.getClass().getResource(SomeExternalJar.jar);</code></td></tr></tbody></table><br><code>URLClassLoader ucl = </code><code>new</code> <code>URLClassLoader(</code><code>new</code> <code>URL[]{jarURL}, </code><code>this</code><code>.getClass().getClassLoader());</code><br>

<br>But my question is if I cannot somehow avoid this and make it easier. <br><br>So, the main question is: when having a remote guvnor having set packages with rules and fact models, how can I create a local knowledge agent and to fill it with some required fact models and rules from that remote guvnor server? <br>

<br>At the first glace, I had expected when filling the knowledge agent with a remote package, along with the test cases and rules, also the jar files to be loaded,
 but it seems not.<br><br>At this moment I cannot see any other option, than this one. I had read the entyre documentation, but i did not find something like this explained. Could you help me?  Do you have an idea about how to do this more easier than presented above?<br>

<span style="color:rgb(0,0,255);font-family:arial black"><font><span style="color:rgb(0,0,0)"><br>Madalin Gavrilescu</span></font><br></span><br><br>--- On <b>Wed, 1/25/12, manstis [via Drools] <i>&lt;<a rel="nofollow" href="http://user/SendEmail.jtp?type=node&amp;node=3687625&amp;i=0" link="external" target="_blank">[hidden email]</a>&gt;</i></b> wrote:<br>

<blockquote style="border-left:2px solid #cccccc;padding:0 1em"><br>From: manstis [via Drools] &lt;<a rel="nofollow" href="http://user/SendEmail.jtp?type=node&amp;node=3687625&amp;i=1" link="external" target="_blank">[hidden email]</a>&gt;<br>

Subject: Re: [rules-users] unable to update the changes (guvnor rules) to application using changeset<br>To: &quot;Voradov&quot; &lt;<a rel="nofollow" href="http://user/SendEmail.jtp?type=node&amp;node=3687625&amp;i=2" link="external" target="_blank">[hidden email]</a>&gt;<br>

Date: Wednesday, January 25, 2012, 2:48 PM<br><br><div><div>

        What is it you are trying to achieve?<br><br>If the change set contains DRL items the Classes used therein will need to be on your client-side classpath (as explained in Esteban&#39;s blog). If you want to use rules authored in Guvnor and Types declared in (or uploaded to) Guvnor you should use the PKG resource type in your change-set and build the package in Guvnor. I don&#39;t believe you should need to use a custom class loader *unless* you really want only the DRL in your change-set but your model classes only in Guvnor.<br>


<br></div><div><div><div>On 25 January 2012 12:27, Voradov <span dir="ltr">&lt;<a rel="nofollow" link="external">[hidden email]</a>&gt;</span> wrote:<br></div></div><blockquote style="border-left:2px solid #cccccc;padding:0 1em">

<div><div>
Hi, Esteban, Hi srinivasasanda.<br>
<br>
My opinion regarding the issue posted by srinivasasanda is the following:<br>
<br>
Having the changeset filled with DRL&#39;s taken from local jBoss application<br>
and using it in a java local running knowledge agent which has not added<br>
into the classpath the fact models will fail, of course with that<br>
/&quot;java.lang.RuntimeException: KnowledgeAgent exception while trying to<br>
deserialize KnowledgeDefinitionsPackage&quot;./<br>
<br>
On the other hand, when having changeset.xml set as:<br>
/&lt;add&gt;<br>
        &lt;resource source=&#39;file:D:\rulemaster.drl&#39; type=&#39;DRL&#39; /&gt;<br>
   &lt;/add&gt;/<br>
is working because it seems that the fact models used in defining those<br>
packages are in the classpath.<br>
<br>
REST protocol is used correctly in the changeset.xml.<br>
<br>
The problem with remotely loading pkg\drl files using REST is that you<br>
should somehow specify a custom classloader, like this:<br>
<br>
/KnowledgeBaseConfiguration kbaseConfig =<br>
KnowledgeBaseFactory.newKnowledgeBaseConfiguration(null,<br>
*customClassLoader*);<br>
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(kbaseConfig);<br>
//kbase with custom classloader<br>
KnowledgeAgentConfiguration aconf =<br>
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();<br>
aconf.setProperty(&quot;drools.agent.useKBaseClassLoaderForCompiling&quot;, &quot;true&quot;);<br>
KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent(&quot;test<br>
agent&quot;, kbase, aconf);<br>
 kagent.applyChangeSet(ResourceFactory.newFileResource(changeSetFile));/<br>
<br>
My question is: is there any possibility to create the classloader identical<br>
to the remote classloader used by guvnor? if yes, could you please show us<br>
exactly how to load remotelly from guvnor?<br>
<br>
Here, at<br>
<a rel="nofollow" href="http://ilesteban.wordpress.com/2010/06/22/knowledge-agent-custom-class-loaders/" link="external" target="_blank">http://ilesteban.wordpress.com/2010/06/22/knowledge-agent-custom-class-loaders/</a><br>


<a rel="nofollow" href="http://ilesteban.wordpress.com/2010/06/22/knowledge-agent-custom-class-loaders/" link="external" target="_blank">http://ilesteban.wordpress.com/2010/06/22/knowledge-agent-custom-class-loaders/</a><br>


there is described how to create a custom classloader, but it is not<br>
specified how to create it based on the Guvnor&#39;s jar files already existing<br>
there.<br>
<span><font color="#888888"><br>
<br>
--<br>
View this message in context: <a rel="nofollow" href="http://drools.46999.n3.nabble.com/unable-to-update-the-changes-guvnor-rules-to-application-using-changeset-tp3652824p3687543.html" link="external" target="_blank">http://drools.46999.n3.nabble.com/unable-to-update-the-changes-guvnor-rules-to-application-using-changeset-tp3652824p3687543.html</a><br>



</font></span></div></div><div><div><div><div>Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
</div></div><a rel="nofollow" link="external">[hidden email]</a><br>
<a rel="nofollow" href="https://lists.jboss.org/mailman/listinfo/rules-users" link="external" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>
<br>_______________________________________________
<br>rules-users mailing list
<br><a rel="nofollow" link="external">[hidden email]</a>
<br><a rel="nofollow" href="https://lists.jboss.org/mailman/listinfo/rules-users" link="external" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
        
        <br>
        <br>
        <hr color="#cccccc" size="1" noshade>
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a rel="nofollow" href="http://drools.46999.n3.nabble.com/unable-to-update-the-changes-guvnor-rules-to-application-using-changeset-tp3652824p3687590.html" link="external" target="_blank">http://drools.46999.n3.nabble.com/unable-to-update-the-changes-guvnor-rules-to-application-using-changeset-tp3652824p3687590.html</a>
        </div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from unable to update the changes (guvnor rules) to application using changeset, <a rel="nofollow" link="external">click here</a>.<br>
                <a rel="nofollow" href="http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&amp;id=instant_html%21nabble%3Aemail.naml&amp;base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespace&amp;breadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" style="font:9px serif" link="external" target="_blank">NAML</a>
        </div></div></blockquote></td></tr></tbody></table>
        
<br><hr align="left" width="300">
View this message in context: <a rel="nofollow" href="http://drools.46999.n3.nabble.com/unable-to-update-the-changes-guvnor-rules-to-application-using-changeset-tp3652824p3687625.html" link="external" target="_blank">Re: [rules-users] unable to update the changes (guvnor rules) to application using changeset</a><div>

<div><br>
Sent from the <a rel="nofollow" href="http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html" link="external" target="_blank">Drools: User forum mailing list archive</a> at Nabble.com.<br></div></div><br>_______________________________________________<br>


rules-users mailing list<br>
<a rel="nofollow" link="external">[hidden email]</a><br>
<a rel="nofollow" href="https://lists.jboss.org/mailman/listinfo/rules-users" link="external" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div></div></div><div><div class="h5"><br>
<br>_______________________________________________
<br>rules-users mailing list
<br><a rel="nofollow" link="external">[hidden email]</a>
<br><a rel="nofollow" href="https://lists.jboss.org/mailman/listinfo/rules-users" link="external" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
        
        <br>
        <br>
        <hr color="#cccccc" size="1" noshade>
        </div></div><div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif"><div><div class="h5">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                </div></div><a rel="nofollow" href="http://drools.46999.n3.nabble.com/unable-to-update-the-changes-guvnor-rules-to-application-using-changeset-tp3652824p3687649.html" link="external" target="_blank">http://drools.46999.n3.nabble.com/unable-to-update-the-changes-guvnor-rules-to-application-using-changeset-tp3652824p3687649.html</a>
        </div><div class="im">
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from unable to update the changes (guvnor rules) to application using changeset, <a rel="nofollow" link="external">click here</a>.<br>
                <a rel="nofollow" href="http://drools.46999.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&amp;id=instant_html%21nabble%3Aemail.naml&amp;base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.InstantMailNamespace&amp;breadcrumbs=instant+emails%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" style="font:9px serif" link="external" target="_blank">NAML</a>
        </div></div></div></blockquote></td></tr></tbody></table><div class="HOEnZb"><div class="h5">
        
<br><hr align="left" width="300">
View this message in context: <a href="http://drools.46999.n3.nabble.com/unable-to-update-the-changes-guvnor-rules-to-application-using-changeset-tp3652824p3687677.html" target="_blank">Re: [rules-users] unable to update the changes (guvnor rules) to application using changeset</a><br>

Sent from the <a href="http://drools.46999.n3.nabble.com/Drools-User-forum-f47000.html" target="_blank">Drools: User forum mailing list archive</a> at Nabble.com.<br></div></div><br>_______________________________________________<br>

rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">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><br>