Edson Tirelli-3 wrote:
>
> What MVEL version are you using?
>
> []s
> Edson
>
> 2009/1/13 psentosa <
psentosa@yahoo.com>
>
>>
>> Hallo,
>>
>> I have a rule like this, defined in Guvnor:
>> when
>> Activity ( $date : date, workingTime > 240)
>>
>> then
>> System.out.println("Working time limit has been reached");
>> violatedRegulation.add(new String("regulation.general.working1"));
>>
>>
>> violatedRegulation is a List<String> which I set as a global because
>> later
>> on I will extract the content of that list which is a key defined in a
>> properties file
>>
>> ksession.setGlobal("violatedRegulation", violatedRegulation);
>> ksession.executeObject(activity);
>>
>>
>> but then I got the following exception:
>> 15:52:59,687 INFO [STDOUT] Working time limit has been reached
>> 15:52:59,687 ERROR [MyExceptionInterceptor] [Error: could not create
>> constructor: No ClassLoaders found for: String ]
>> [Near : {... Unknown ....}]
>> ^
>> org.drools.runtime.rule.ConsequenceException: [Error: could not create
>> constructor: No ClassLoaders found for: String ]
>> [Near : {... Unknown ....}]
>> ^
>> at
>>
>> org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
>> at
>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:918)
>> at
>> org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:871)
>> at
>> org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1035)
>> at
>>
>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:612)
>> at
>>
>> org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:589)
>> at
>>
>> org.drools.impl.StatelessKnowledgeSessionImpl.executeObject(StatelessKnowledgeSessionImpl.java:158)
>> ..................
>>
>> Caused by: [Error: could not create constructor: No ClassLoaders found
>> for:
>> String ]
>> [Near : {... Unknown ....}]
>> ^
>> at
>>
>> org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeObjectCreation(ReflectiveAccessorOptimizer.java:805)
>> at
>>
>> org.mvel2.optimizers.dynamic.DynamicOptimizer.optimizeObjectCreation(DynamicOptimizer.java:80)
>> at
>>
>> org.mvel2.ast.NewObjectNode.getReducedValueAccelerated(NewObjectNode.java:148)
>> at
>> org.mvel2.compiler.ExecutableAccessor.getValue(ExecutableAccessor.java:37)
>> at
>>
>> org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.getMethod(ReflectiveAccessorOptimizer.java:590)
>> at
>>
>> org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:285)
>> at
>>
>> org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:134)
>> at
>>
>> org.mvel2.optimizers.dynamic.DynamicOptimizer.optimizeAccessor(DynamicOptimizer.java:61)
>> at
>> org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:127)
>> at org.mvel2.MVELRuntime.execute(MVELRuntime.java:91)
>> at
>> org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:101)
>> at org.mvel2.MVEL.executeExpression(MVEL.java:1025)
>> at
>> org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:89)
>> at
>> org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:909)
>> ... 97 more
>> Caused by: java.lang.ClassNotFoundException: No ClassLoaders found for:
>> String
>> at
org.jboss.mx.loading.LoadMgr3.beginLoadTask(LoadMgr3.java:306)
>> at
>>
>>
org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:521)
>> at
>>
>> org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:415)
>> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
>> at java.lang.Class.forName0(Native Method)
>> at java.lang.Class.forName(Class.java:164)
>> at org.mvel2.util.ParseTools.createClass(ParseTools.java:458)
>> at org.mvel2.util.ParseTools.findClass(ParseTools.java:796)
>> at
>>
>> org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileConstructor(ReflectiveAccessorOptimizer.java:832)
>> at
>>
>> org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeObjectCreation(ReflectiveAccessorOptimizer.java:799)
>> ... 110 more
>>
>> Any help would be very appreciated
>>
>> ps: the very same rule worked with drools 4.0.7
>>
>> Regards
>>
>>
>>
>>
>> --
>> View this message in context:
>>
http://www.nabble.com/No-ClassLoaders-found-for%3A-String-tp21437370p21437370.html
>> Sent from the drools - user mailing list archive at
Nabble.com.
>>
>> _______________________________________________
>> rules-users mailing list
>>
rules-users@lists.jboss.org
>>
https://lists.jboss.org/mailman/listinfo/rules-users
>>
>
>
>
> --
> Edson Tirelli
> JBoss Drools Core Development
> JBoss, a division of Red Hat @
www.jboss.com
>
> _______________________________________________
> rules-users mailing list
>
rules-users@lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--