Re: [rules-users] ClassLoader parameter and Init function of RuleBaseConfiguration

2011-11-11 Thread ssprick
Thank you so much Thomas! There indeed was an old 5.1 jar in another
subproject left on the classpath. 

--
View this message in context: 
http://drools.46999.n3.nabble.com/ClassLoader-parameter-and-Init-function-of-RuleBaseConfiguration-tp3489741p3499642.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] ClassLoader parameter and Init function of RuleBaseConfiguration

2011-11-11 Thread Swindells, Thomas
No such method errors and the like when playing around with classloaders 
normally means that somewhere you have the same jar in the classpath with 
different versions, you may well then be loading the classes from different 
jars depending on which classloader you are using. Make sure that you 
definitely don't have any of the old 5.1 jars anywhere that could be being 
loaded by mistake.

Thomas

> -Original Message-
> From: rules-users-boun...@lists.jboss.org [mailto:rules-users-
> boun...@lists.jboss.org] On Behalf Of ssprick
> Sent: 11 November 2011 07:45
> To: rules-users@lists.jboss.org
> Subject: Re: [rules-users] ClassLoader parameter and Init function of
> RuleBaseConfiguration
>
> *push*
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/ClassLoader-parameter-and-Init-
> function-of-RuleBaseConfiguration-tp3489741p3499019.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users


**
This message is confidential and intended only for the addressee. If you have 
received this message in error, please immediately notify the 
postmas...@nds.com and delete it from your system as well as any copies. The 
content of e-mails as well as traffic data may be monitored by NDS for 
employment and security purposes. To protect the environment please do not 
print this e-mail unless necessary.

NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, 
United Kingdom. A company registered in England and Wales. Registered no. 
3080780. VAT no. GB 603 8808 40-00
**

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] ClassLoader parameter and Init function of RuleBaseConfiguration

2011-11-10 Thread ssprick
*push*

--
View this message in context: 
http://drools.46999.n3.nabble.com/ClassLoader-parameter-and-Init-function-of-RuleBaseConfiguration-tp3489741p3499019.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] ClassLoader parameter and Init function of RuleBaseConfiguration

2011-11-08 Thread ssprick
Hello everyone,

I'm struggling with the following error after updating from Drools 5.1M1 to
5.3Final when handing over a URLClassloader as a parameter for
RuleBaseConfiguration. The URL of the classLoader points to Jar file
containing the facts.

ERROR JobRunShell - Job TIQRULES_PROJECT4.TIQRULES_PROJECT4 threw an
unhandled Exception: 
java.lang.NoSuchMethodError:
org.drools.RuleBaseConfiguration.([Ljava/lang/ClassLoader;)V
at
de.tiq.rules.drools.DroolsEngine.createKnowledgeBase(DroolsEngine.java:263)
at
de.tiq.rules.drools.DroolsEngine.run(DroolsEngine.java:95)
at
de.tiq.rules.TIQRulesEngine.executeRuleResource(TIQRulesEngine.java:178)
at
de.tiq.quartz.QuartzTaskExecutor.execute(QuartzTaskExecutor.java:173)
at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)
ERROR ErrorLogger - Job (TIQRULES_PROJECT4.TIQRULES_PROJECT4 threw an
exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested
exception: java.lang.NoSuchMethodError:
org.drools.RuleBaseConfiguration.([Ljava/lang/ClassLoader;)V]
at org.quartz.core.JobRunShell.run(JobRunShell.java:210)
at
org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:546)
Caused by: java.lang.NoSuchMethodError:
org.drools.RuleBaseConfiguration.([Ljava/lang/ClassLoader;)V
at
de.tiq.rules.drools.DroolsEngine.createKnowledgeBase(DroolsEngine.java:263)
at
de.tiq.rules.drools.DroolsEngine.run(DroolsEngine.java:95)
at
de.tiq.rules.TIQRulesEngine.executeRuleResource(TIQRulesEngine.java:178)
at
de.tiq.quartz.QuartzTaskExecutor.execute(QuartzTaskExecutor.java:173)
at org.quartz.core.JobRunShell.run(JobRunShell.java:199)

This is the part of the code where the ClassLoader is given as a parameter:
/**
* create a knowledge base of a given rule resource
* 
 * @param ruleResource
*the rule resource
* @return the created knowledge base
*/
private KnowledgeBase createKnowledgeBase(IRuleResource
ruleResource) {
   if (ruleResource == null) {
   throw new
NullPointerException("ruleResource is null");
   }
   KnowledgeBase kbase;
   ClassLoader[] arrayOfClassLoaders = new
ClassLoader[1];
   arrayOfClassLoaders[0] =
currProject.getFactsClassLoader();
   final KnowledgeBaseConfiguration kbaseconfig
= new RuleBaseConfiguration(currProject.getFactsClassLoader());
   kbase =
KnowledgeBaseFactory.newKnowledgeBase(kbaseconfig);
  
kbase.addKnowledgePackages(ruleResource.getKnowledgePackages(kbase));
   return kbase;
}

This is what getFactsClassLoader does:
public ClassLoader getFactsClassLoader() {
try {
if (factsClassLoader == null) {
URL jarURL;

jarURL = getExecuteJarFile().toURI().toURL();

factsClassLoader = new URLClassLoader(new URL[] { jarURL },
Thread.currentThread()
.getContextClassLoader());
}
return factsClassLoader;
} catch (final MalformedURLException e) {
throw new RuntimeException(e);
}
}

Thx in advance for any hint on solving the mentioned problem!





--
View this message in context: 
http://drools.46999.n3.nabble.com/ClassLoader-parameter-and-Init-function-of-RuleBaseConfiguration-tp3489741p3489741.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users