I switched to v2.0.6 from v2.0.5 and found a breaking API change. org.mvel2.compiler.ExpressionCompiler no longer has a method called setDebugSymbols. ExpressionCompiler now queries ParserContext for this setting. This affects org.drools.base.mvel.MVELCompilationUnit (line 346) from drools-core and org.drools.rule.builder.dialect.mvel.MVELDialect (line 519) from drools-compiler.
From: rules-users-bounces@lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Tuesday, January 13, 2009 11:52 AM
To: Rules Users List
Subject: Re: [rules-users] No ClassLoaders found for: String
Thanks, next release will use mvel 2.0.6.
[]s
Edson2009/1/13 Paul Sentosa <psentosa@yahoo.com>
Yes, it works with 2.0.6. Otherwise I should define the String separately (String abc = "a string"; list.add(abc); in order for the consequence to be executed correctly)
Thanks Edson!
Regards
Paul
From: Edson Tirelli <tirelli@post.com>
To: Rules Users List <rules-users@lists.jboss.org>
Sent: Tuesday, January 13, 2009 5:03:32 PM
Subject: Re: [rules-users] No ClassLoaders found for: String
Yes, I see. Can you please manually update your local mvel jar to version 2.0.6 (latest) and try again? I am talking to the MVEL author to make sure the problem is fixed in the latest version, but of course, if you can confirm this on your side, it would be best.
[]s
Edson2009/1/13 psentosa <psentosa@yahoo.com>
I'm using maven to manage my libraries, thus I add these line in my pom.xml:
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-api</artifactId>
<version>5.0.0.M4</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-core</artifactId>
<version>5.0.0.M4</version>
</dependency>
And I can see that mvel2-2.0.4 has been added, besides drools-api and core
5.0.0.M4
Thanks for the reply
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
>
>
--View this message in context: http://www.nabble.com/No-ClassLoaders-found-for%3A-String-tp21437370p21438374.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
--
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