JBoss Community

Migrate Drools 4.0.7 from JBoss 4.2.3 to JBoss7

created by Christian Wahl in Beginner's Corner - View the full discussion

Hey folks,

 

I migrate an application from JBoss 4.2.3 to JBoss 7. The application uses Drools 4.0.7. (and I´m noob to Drools and JBoss)

 

In the old JBoss version the drl files were not included in the EAR file. The conf folder was the directory for the drl files. We´d like to keep the structure in JBoss7 and use the JBoss\standalone\configuration for the files.
So I put the Drools JAR files in the lib directory. Then I configured the path to the drl files in my application to JBoss\standalone\configuration. When I start the server I get a (lot of) warning(s) like:

(alpha, beta are placeholder[company issues])

 

12:15:37,966 WARN  [org.jboss.modules] (MSC service thread 1-4) Failed to define class de.alpha.beta.model.tcws in Module "deployment.beta-ear.ear.beta-ejb.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link de/alpha/beta/model/tcws (Module "deployment.beta-ear.ear.beta-ejb.jar:main" from Service Module Loader)

    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)

    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

    at org.jboss.modules.Module.loadModuleClass(Module.java:517)

    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182)

    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

    at org.mvel.ParserContext.checkForDynsarvamicImport(ParserContext.java:128) [mvel14.jar:]

    at org.mvel.ParserContext.hasImport(ParserContext.java:163) [mvel14.jar:]

    at org.mvel.PropertyVerifier.getBeanProperty(PropertyVerifier.java:96) [mvel14.jar:]

    at org.mvel.PropertyVerifier.analyze(PropertyVerifier.java:73) [mvel14.jar:]

    at org.mvel.ExpressionCompiler.verify(ExpressionCompiler.java:257) [mvel14.jar:]

    at org.mvel.ExpressionCompiler._compile(ExpressionCompiler.java:190) [mvel14.jar:]

    at org.mvel.ExpressionCompiler.compile(ExpressionCompiler.java:31) [mvel14.jar:]

    at org.drools.rule.builder.dialect.mvel.MVELDialect.compile(MVELDialect.java:387) [drools-compiler-4.0.7.jar:4.0.7]

    at org.drools.rule.builder.dialect.mvel.MVELPredicateBuilder.build(MVELPredicateBuilder.java:69) [drools-compiler-4.0.7.jar:4.0.7]

    at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:553) [drools-compiler-4.0.7.jar:4.0.7]

    at org.drools.rule.builder.PatternBuilder.rewriteToEval(PatternBuilder.java:388) [drools-compiler-4.0.7.jar:4.0.7]

    at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:273) [drools-compiler-4.0.7.jar:4.0.7]

    at org.drools.rule.builder.PatternBuilder.buildConstraint(PatternBuilder.java:199) [drools-compiler-4.0.7.jar:4.0.7]

    at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:168) [drools-compiler-4.0.7.jar:4.0.7]

    at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:93) [drools-compiler-4.0.7.jar:4.0.7]

    at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:69) [drools-compiler-4.0.7.jar:4.0.7]

    at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:53) [drools-compiler-4.0.7.jar:4.0.7]

    at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:446) [drools-compiler-4.0.7.jar:4.0.7]

    at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:304) [drools-compiler-4.0.7.jar:4.0.7]

    at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:167) [drools-compiler-4.0.7.jar:4.0.7]

    at de.alpha.beta.config.RuleConfigHandlerBean.createRulePackage(RuleConfigHandlerBean.java:748) [beta-ejb.jar:4.2.2-b5]

    at de.alpha.beta.config.RuleConfigHandlerBean.createRuleBase(RuleConfigHandlerBean.java:672) [beta-ejb.jar:4.2.2-b5]

    at de.alpha.beta.config.RuleConfigHandlerBean.loadDefaultRules(RuleConfigHandlerBean.java:649) [beta-ejb.jar:4.2.2-b5]

    at de.alpha.beta.config.RuleConfigHandlerBean.loadDefaultRuleset(RuleConfigHandlerBean.java:159) [beta-ejb.jar:4.2.2-b5]

    at de.alpha.beta.config.RuleConfigHandlerBean.<clinit>(RuleConfigHandlerBean.java:134) [beta-ejb.jar:4.2.2-b5]

    at sun.misc.Unsafe.ensureClassInitialized(Native Method) [rt.jar:1.6.0_26]

    at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(Unknown Source) [rt.jar:1.6.0_26]

    at sun.reflect.ReflectionFactory.newFieldAccessor(Unknown Source) [rt.jar:1.6.0_26]

    at java.lang.reflect.Field.acquireFieldAccessor(Unknown Source) [rt.jar:1.6.0_26]

    at java.lang.reflect.Field.getFieldAccessor(Unknown Source) [rt.jar:1.6.0_26]

    at java.lang.reflect.Field.set(Unknown Source) [rt.jar:1.6.0_26]

    at org.jboss.seam.util.Reflections.set(Reflections.java:64) [jboss-seam.jar:2.0.3.CR1]

    at org.jboss.seam.util.Reflections.setAndWrap(Reflections.java:106) [jboss-seam.jar:2.0.3.CR1]

    at org.jboss.seam.Component.scanField(Component.java:839) [jboss-seam.jar:2.0.3.CR1]

    at org.jboss.seam.Component.initMembers(Component.java:537) [jboss-seam.jar:2.0.3.CR1]

    at org.jboss.seam.Component.<init>(Component.java:254) [jboss-seam.jar:2.0.3.CR1]

    at org.jboss.seam.Component.<init>(Component.java:217) [jboss-seam.jar:2.0.3.CR1]

    at org.jboss.seam.init.Initialization.addComponent(Initialization.java:974) [jboss-seam.jar:2.0.3.CR1]

    at org.jboss.seam.init.Initialization.installComponents(Initialization.java:911) [jboss-seam.jar:2.0.3.CR1]

    at org.jboss.seam.init.Initialization.init(Initialization.java:589) [jboss-seam.jar:2.0.3.CR1]

    at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:34) [jboss-seam.jar:2.0.3.CR1]

    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]

    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]

    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_26]

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_26]

    at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_26]

Caused by: java.lang.NoClassDefFoundError: de/alpha/beta/model/tcws (wrong name: de/alpha/beta/model/TCWS)

    at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.6.0_26]

    at java.lang.ClassLoader.defineClassCond(Unknown Source) [rt.jar:1.6.0_26]

    at java.lang.ClassLoader.defineClass(Unknown Source) [rt.jar:1.6.0_26]

    at java.security.SecureClassLoader.defineClass(Unknown Source) [rt.jar:1.6.0_26]

    at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

 

The Drools are called from the beta-ejb.jar. The directorys in my EAR file are    lib,    META-INF,   beta.war,    beta-ejb.jar,    beta-test-ejb.jar

 

I´d like to know:

1. Is it possible to use Drools 4.0.7 with JBoss 7?

2. Can configure the path where the Drools lookup the classes?

3. What the hell is wrong? It seems like the Drools tool can not find my classes, or am I wrong?

 

I googled a time and found nothing. But I think these are easy questions for the JBoss/Drools masters in this community!

 

With hope and regards,

Christian

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community