I found that if you explicitly import the class, it can resolve the issue - instead of
relying on package imports.
Mark
On 18 Nov 2013, at 18:31, Mark Proctor <mproctor(a)codehaus.org> wrote:
I think it depends on the system. When we have symbols it attempts to
see if they are classes are not, on some systems the file system does not recognise type
and can get confused.
Mark
On 18 Nov 2013, at 15:17, Alexander Herwix <alex(a)herwix.com> wrote:
> I actually got it to compile and work by prefixing the new var with $. Maybe it's
a bug where the parser/compiler messes up, when a variable has no prefix and the same name
as a class but in lowercase?! Is this even possible?
>
> Anyway if someone has a similar problem, maybe this helps :)
>
> Cheers, Alex
>
>
> Am 18.11.2013 um 14:13 schrieb Martin Minka <martin.minka(a)gmail.com>:
>
>> I had similar problem and it was solved in 6.0.0.CR5.
>>
>>
>> 2013/11/18 Alexander Herwix <alex(a)herwix.com>
>> Hey guys,
>>
>> using Drools 6 RC4. I have a simple rule which should cast an object into a
specialized object (if it is indeed a specialization) and insert that into the session.
>>
>> rule "Obj is SpecialObject"
>> salience 201
>> when
>>
>> $mainObj : MainObj(obj.class == SpecialObject.class, $obj : obj)
>> then
>> System.out.println("Obj is SpecialObj");
>>
>> SpecialObj specialObj = (SpecialObj) $obj;
>> insert(specialObj);
>> end
>>
>> This rule doesn't even compile and I get a nasty error: NoClassDefFoundError:
com/iterranux/droolsjbpmHumanTask/domain/team__I (wrong name:
com/iterranux/droolsjbpmHumanTask/domain/Team__I).
>>
>> I mean it looks like the Class is present, but somehow it's lowercased
somewhere. It's weird I can use some other obj but this doesn't work. Anyone seen
something like this before? Maybe some other way to do what I want to do? I tried to
declare a trait and don that obj with that but same result.
>>
>> Another question would be if it is really necessary to insert the object as a new
fact, or could I access the nested property directly in a rule and typecast it there
somehow?
>>
>> Cheers, Alex
>>
>> Error java.lang.RuntimeException: Reloading agent exited via exception, please
raise a jira
>> | Error at
org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:104)
>> | Error at
sun.instrument.TransformerManager.transform(TransformerManager.java:188)
>> | Error at
sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424)
>> | Error at java.lang.ClassLoader.defineClass1(Native Method)
>> | Error at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
>> | Error at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
>> | Error at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
>> | Error at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
>> | Error at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
>> | Error at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
>> | Error at java.security.AccessController.doPrivileged(Native Method)
>> | Error at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
>> | Error at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
>> | Error at
groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:648)
>> | Error at
groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:758)
>> | Error at
groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:746)
>> | Error at java.lang.Class.forName0(Native Method)
>> | Error at java.lang.Class.forName(Class.java:266)
>> | Error at
org.drools.core.common.ProjectClassLoader.loadClass(ProjectClassLoader.java:80)
>> | Error at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
>> | Error at java.lang.Class.forName0(Native Method)
>> | Error at java.lang.Class.forName(Class.java:266)
>> | Error at
org.mvel2.ParserConfiguration.checkForDynamicImport(ParserConfiguration.java:163)
>> | Error at
org.mvel2.ParserConfiguration.hasImport(ParserConfiguration.java:191)
>> | Error at org.mvel2.ParserContext.hasImport(ParserContext.java:360)
>> | Error at
org.mvel2.compiler.AbstractParser.createPropertyToken(AbstractParser.java:1341)
>> | Error at
org.mvel2.compiler.AbstractParser.nextToken(AbstractParser.java:846)
>> | Error at
org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:128)
>> | Error at
org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62)
>> | Error at org.mvel2.MVEL.analyze(MVEL.java:680)
>> | Error at
org.mvel2.compiler.PropertyVerifier.getMethod(PropertyVerifier.java:536)
>> | Error at
org.mvel2.compiler.PropertyVerifier.analyze(PropertyVerifier.java:120)
>> | Error at
org.mvel2.compiler.ExpressionCompiler.verify(ExpressionCompiler.java:381)
>> | Error at
org.mvel2.compiler.ExpressionCompiler._compile(ExpressionCompiler.java:273)
>> | Error at
org.mvel2.compiler.ExpressionCompiler.compile(ExpressionCompiler.java:62)
>> | Error at org.mvel2.MVEL.analyze(MVEL.java:680)
>> | Error at org.mvel2.MVEL.analyze(MVEL.java:685)
>> | Error at
org.drools.compiler.rule.builder.dialect.mvel.MVELExprAnalyzer.analyzeExpression(MVELExprAnalyzer.java:114)
>> | Error at
org.drools.compiler.rule.builder.dialect.mvel.MVELDialect.analyzeBlock(MVELDialect.java:539)
>> | Error at
org.drools.compiler.rule.builder.dialect.mvel.MVELConsequenceBuilder.build(MVELConsequenceBuilder.java:130)
>> | Error at
org.drools.compiler.rule.builder.RuleBuilder.build(RuleBuilder.java:103)
>> | Error at
org.drools.compiler.compiler.PackageBuilder.addRule(PackageBuilder.java:3160)
>> | Error at
org.drools.compiler.compiler.PackageBuilder.compileRules(PackageBuilder.java:1047)
>> | Error at
org.drools.compiler.compiler.PackageBuilder.compileAllRules(PackageBuilder.java:952)
>> | Error at
org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.buildRules(CompositeKnowledgeBuilderImpl.java:231)
>> | Error at
org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.buildPackages(CompositeKnowledgeBuilderImpl.java:86)
>> | Error at
org.drools.compiler.compiler.CompositeKnowledgeBuilderImpl.build(CompositeKnowledgeBuilderImpl.java:75)
>> | Error at
org.drools.compiler.kie.builder.impl.AbstractKieModule.buildKnowledgePackages(AbstractKieModule.java:201)
>> | Error at
org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:39)
>> | Error at
org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:305)
>> | Error at
org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:187)
>> | Error at
com.iterranux.droolsjbpmCore.runtime.build.impl.KieModuleBuilder.buildKmoduleForGrailsModule(KieModuleBuilder.java:127)
>> | Error at
com.iterranux.droolsjbpmCore.runtime.build.impl.KieModuleBuilder.buildKmoduleForGrailsModule(KieModuleBuilder.java:148)
>> | Error at
com.iterranux.droolsjbpmCore.runtime.build.impl.KieModuleBuilder$buildKmoduleForGrailsModule.call(Unknown
Source)
>> | Error at
DroolsjbpmCoreGrailsPlugin$_closure7.doCall(DroolsjbpmCoreGrailsPlugin.groovy:386)
>> | Error at sun.reflect.GeneratedMethodAccessor992.invoke(Unknown Source)
>> | Error at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> | Error at java.lang.reflect.Method.invoke(Method.java:601)
>> | Error at
org.springsource.loaded.ri.OriginalClassInvoker.invoke(OriginalClassInvoker.java:47)
>> | Error at
org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1283)
>> | Error at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
>> | Error at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
>> | Error at
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
>> | Error at
groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
>> | Error at
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
>> | Error at groovy.lang.Closure.call(Closure.java:411)
>> | Error at
DroolsjbpmCoreGrailsPlugin$_closure7.call(DroolsjbpmCoreGrailsPlugin.groovy)
>> | Error at
org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.invokeOnChangeListener(DefaultGrailsPlugin.java:767)
>> | Error at
org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.notifyOfEvent(DefaultGrailsPlugin.java:716)
>> | Error at
org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.notifyOfEvent(DefaultGrailsPlugin.java:731)
>> | Error at
org.codehaus.groovy.grails.plugins.AbstractGrailsPluginManager.informOfClassChange(AbstractGrailsPluginManager.java:406)
>> | Error at
org.codehaus.groovy.grails.plugins.AbstractGrailsPluginManager.informOfFileChange(AbstractGrailsPluginManager.java:367)
>> | Error at
org.codehaus.groovy.grails.compiler.GrailsProjectWatcher.informPluginManager(GrailsProjectWatcher.java:243)
>> | Error at
org.codehaus.groovy.grails.compiler.GrailsProjectWatcher.access$400(GrailsProjectWatcher.java:46)
>> | Error at
org.codehaus.groovy.grails.compiler.GrailsProjectWatcher$1.onChange(GrailsProjectWatcher.java:154)
>> | Error at
org.codehaus.groovy.grails.compiler.DirectoryWatcher.fireOnChange(DirectoryWatcher.java:174)
>> | Error at
org.codehaus.groovy.grails.compiler.DirectoryWatcher.run(DirectoryWatcher.java:156)
>> | Error at
org.codehaus.groovy.grails.compiler.GrailsProjectWatcher.run(GrailsProjectWatcher.java:178)
>> | Error at java_lang_Runnable$run.call(Unknown Source)
>> | Error at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
>> | Error at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
>> | Error at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
>> | Error at
org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess.startProjectWatcher(ForkedGrailsProcess.groovy:702)
>> | Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> | Error at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>> | Error at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> | Error at java.lang.reflect.Method.invoke(Method.java:601)
>> | Error at
org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
>> | Error at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
>> | Error at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
>> | Error at
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
>> | Error at
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
>> | Error at
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1030)
>> | Error at
groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
>> | Error at
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
>> | Error at
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
>> | Error at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
>> | Error at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
>> | Error at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
>> | Error at
org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess$_setupReloading_closure16.doCall(ForkedGrailsProcess.groovy:691)
>> | Error at
org.codehaus.groovy.grails.cli.fork.ForkedGrailsProcess$_setupReloading_closure16.doCall(ForkedGrailsProcess.groovy)
>> | Error at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> | Error at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>> | Error at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> | Error at java.lang.reflect.Method.invoke(Method.java:601)
>> | Error at
org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1254)
>> | Error at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
>> | Error at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
>> | Error at
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
>> | Error at
groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
>> | Error at
groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
>> | Error at groovy.lang.Closure.call(Closure.java:411)
>> | Error at groovy.lang.Closure.call(Closure.java:405)
>> | Error at groovy.lang.Closure.run(Closure.java:492)
>> | Error at java.lang.Thread.run(Thread.java:722)
>> | Error Caused by: org.springsource.loaded.ReloadException: Problem defining
class com.iterranux.droolsjbpmHumanTask.domain.team__I
>> | Error at
org.springsource.loaded.TypeRegistry.defineClass(TypeRegistry.java:1076)
>> | Error at
org.springsource.loaded.ReloadableType.rewriteCallSitesAndDefine(ReloadableType.java:807)
>> | Error at
org.springsource.loaded.ReloadableType.<init>(ReloadableType.java:151)
>> | Error at
org.springsource.loaded.TypeRegistry.addType(TypeRegistry.java:889)
>> | Error at
org.springsource.loaded.agent.SpringLoadedPreProcessor.preProcess(SpringLoadedPreProcessor.java:246)
>> | Error at
org.springsource.loaded.agent.ClassPreProcessorAgentAdapter.transform(ClassPreProcessorAgentAdapter.java:102)
>> | Error ... 114 more
>> | Error Caused by: java.lang.reflect.InvocationTargetException
>> | Error at sun.reflect.GeneratedMethodAccessor62.invoke(Unknown Source)
>> | Error at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>> | Error at java.lang.reflect.Method.invoke(Method.java:601)
>> | Error at
org.springsource.loaded.TypeRegistry.defineClass(TypeRegistry.java:1071)
>> | Error ... 119 more
>> | Error Caused by: java.lang.NoClassDefFoundError:
com/iterranux/droolsjbpmHumanTask/domain/team__I (wrong name:
com/iterranux/droolsjbpmHumanTask/domain/Team__I)
>> | Error at java.lang.ClassLoader.defineClass1(Native Method)
>> | Error at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
>> | Error at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
>> | Error ... 123 more
>> _______________________________________________
>> rules-users mailing list
>> rules-users(a)lists.jboss.org
>>
https://lists.jboss.org/mailman/listinfo/rules-users
>>
>> _______________________________________________
>> rules-users mailing list
>> rules-users(a)lists.jboss.org
>>
https://lists.jboss.org/mailman/listinfo/rules-users
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users