Any particular place you get the NPE?<br><br>Is variable &quot;url&quot; null?<br><br><div class="gmail_quote">On 14 August 2012 16:18, Rana <span dir="ltr">&lt;<a href="mailto:ven12344@yahoo.com" target="_blank">ven12344@yahoo.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Having trouble getting the URL, getting null when getting the ChangeSet file.<br>
Please let me know what is the problem.<br>
<br>
<br>
ResourceChangeScannerConfiguration conf =<br>
ResourceFactory.getResourceChangeScannerService().newResourceChangeScannerConfiguration();<br>
                conf.setProperty(&quot;drools.resource.scanner.interval&quot;, &quot;60&quot;);<br>
                <a href="http://log.info" target="_blank">log.info</a>(&quot;Drools Resource Scanner is set to 60 seconds&quot;);<br>
                ResourceFactory.getResourceChangeScannerService().configure(conf);<br>
                ResourceFactory.getResourceChangeScannerService().start();<br>
                <a href="http://log.info" target="_blank">log.info</a>(&quot;Drools Resource Change Scanner Service has started&quot;);<br>
                ResourceFactory.getResourceChangeNotifierService().start();<br>
                <a href="http://log.info" target="_blank">log.info</a>(&quot;Drools Resource Change Notifier Service has started&quot;);<br>
<br>
                URL url =<br>
this.getClass().getResource(&quot;/src/main/resources/DroolsChangeSet.xml&quot;);<br>
                URLClassLoader customURLClassloader = new URLClassLoader(new URL[]<br>
{url }, this.getClass().getClassLoader());<br>
                KnowledgeBuilderConfiguration kbuilderConfig =<br>
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null,<br>
customURLClassloader);<br>
//              KnowledgeBuilder kbuilder =<br>
KnowledgeBuilderFactory.newKnowledgeBuilder(kbuilderConfig);<br>
                KnowledgeBaseConfiguration kbaseConfig =<br>
KnowledgeBaseFactory.newKnowledgeBaseConfiguration(null,<br>
customURLClassloader);<br>
                kbaseConfig.setOption( EventProcessingOption.STREAM );<br>
                kbaseConfig.setOption( MultithreadEvaluationOption.YES );<br>
//              kbaseConfig.setOption( MaxThreadsOption.get(2) );<br>
                kbase = KnowledgeBaseFactory.newKnowledgeBase(kbaseConfig);<br>
<br>
                // create a knowledge agent<br>
                KnowledgeAgentConfiguration aconf =<br>
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();<br>
                aconf.setProperty(&quot;drools.agent.scanDirectories&quot;, &quot;true&quot;);<br>
                aconf.setProperty(&quot;drools.agent.newInstance&quot;, &quot;false&quot;);<br>
//              KnowledgeAgent kAgent =<br>
KnowledgeAgentFactory.newKnowledgeAgent(&quot;Drools Knowledge Agent&quot;, null,<br>
aconf);<br>
                KnowledgeAgent kagent =<br>
KnowledgeAgentFactory.newKnowledgeAgent(&quot;Drools Knowledge Agent&quot;, kbase,<br>
aconf, kbuilderConfig);<br>
                kagent.applyChangeSet(ResourceFactory.newUrlResource(url));<br>
                <a href="http://log.info" target="_blank">log.info</a>(&quot;Knowledge Agent Created for all the Drools Files&quot;);<br>
<br>
            // load up the knowledge base<br>
            kbase = kagent.getKnowledgeBase();<br>
<br>
Thanks.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Getting-Null-pointer-exception-for-applying-change-set-tp4019117.html" target="_blank">http://drools.46999.n3.nabble.com/Getting-Null-pointer-exception-for-applying-change-set-tp4019117.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
</blockquote></div><br>