This content has been marked as final.
Show 3 replies
-
1. Re: Problem injecting drools WorkingMemory
sjmenden Dec 7, 2006 5:19 PM (in response to sjmenden)I made some progress but now getting massive exceptions. I changed the components.xml to look like the drools example one:
components.xml... <component name="ruleBase" class="org.jboss.seam.drools.RuleBase"> <property name="ruleFiles">purchasingRules.drl</property> </component> <component name="purchasingRulesMemory" class="org.jboss.seam.drools.ManagedWorkingMemory"> <property name="ruleBase">#{ruleBase}</property> </component> ...
But now I'm getting a ClassCastException, and I have verified my jars exactly(crosses fingers) mirror the ones in the example. I'm running SEAM CR2 with JBoss 4.0.517:16:25,918 ERROR [STDERR] StringTemplate: problem parsing group <unknown>: java.lang.ClassCastException: antlr.CommonToken cannot be cast to antlr.Token 17:16:25,919 ERROR [STDERR] java.lang.ClassCastException: antlr.CommonToken cannot be cast to antlr.Token 17:16:25,919 ERROR [STDERR] at antlr.CharScanner.makeToken(CharScanner.java:173) 17:16:25,920 ERROR [STDERR] at org.antlr.stringtemplate.language.GroupLexer.mID(GroupLexer.java:333) 17:16:25,920 ERROR [STDERR] at org.antlr.stringtemplate.language.GroupLexer.nextToken(GroupLexer.java:103) 17:16:25,920 ERROR [STDERR] at antlr.TokenBuffer.fill(TokenBuffer.java:69) 17:16:25,920 ERROR [STDERR] at antlr.TokenBuffer.LA(TokenBuffer.java:80) 17:16:25,920 ERROR [STDERR] at antlr.LLkParser.LA(LLkParser.java:52) 17:16:25,920 ERROR [STDERR] at antlr.Parser.match(Parser.java:210) 17:16:25,921 ERROR [STDERR] at org.antlr.stringtemplate.language.GroupParser.group(GroupParser.java:117) 17:16:25,921 ERROR [STDERR] at org.antlr.stringtemplate.StringTemplateGroup.parseGroup(StringTemplateGroup.java:754) 17:16:25,921 ERROR [STDERR] at org.antlr.stringtemplate.StringTemplateGroup.<init>(StringTemplateGroup.java:264) 17:16:25,921 ERROR [STDERR] at org.antlr.stringtemplate.StringTemplateGroup.<init>(StringTemplateGroup.java:244) 17:16:25,921 ERROR [STDERR] at org.drools.semantics.java.RuleBuilder.<clinit>(Unknown Source) 17:16:25,921 ERROR [STDERR] at org.drools.compiler.PackageBuilder.addRule(Unknown Source) 17:16:25,922 ERROR [STDERR] at org.drools.compiler.PackageBuilder.addPackage(Unknown Source) 17:16:25,922 ERROR [STDERR] at org.jboss.seam.drools.RuleBase.compileRuleBase(RuleBase.java:52) 17:16:25,922 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 17:16:25,922 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 17:16:25,922 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 17:16:25,922 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597) 17:16:25,923 ERROR [STDERR] at org.jboss.seam.util.Reflections.invoke(Reflections.java:18) ...
-
2. Re: Problem injecting drools WorkingMemory
gavin.king Dec 7, 2006 8:21 PM (in response to sjmenden)There is an example application in the examples/drools directory.
-
3. Re: Problem injecting drools WorkingMemory
sjmenden Dec 8, 2006 11:22 AM (in response to sjmenden)I am following the example as closely as I possibly can. I can not track seam to track down this problem.
Here is the directory structure of the drools example deployed and my application deployed:
JBoss- seam
EAR contents:drwxr-xr-x 3 root root 4096 Dec 8 11:00 drools drwxr-xr-x 4 root root 4096 Dec 8 11:00 jboss-seam-drools-exp.war -rw-r--r-- 1 root root 3005 Dec 8 11:00 jboss-seam-drools.jar -rw-r--r-- 1 root root 627241 Dec 8 11:00 jboss-seam.jar drwxr-xr-x 2 root root 4096 Dec 8 11:00 lib drwxr-xr-x 2 root root 4096 Dec 8 11:00 META-INF -rw-r--r-- 1 root root 923 Dec 8 11:00 numberguess.drl -rw-r--r-- 1 root root 1026 Dec 8 11:00 pageflow.jpdl.xml
drools/lib:-rw-r--r-- 1 root root 443432 Dec 8 11:00 antlr-2.7.6.jar -rw-r--r-- 1 root root 546498 Dec 8 11:00 antlr-3.0ea8.jar -rw-r--r-- 1 root root 36846 Dec 8 11:00 commons-jci-core-1.0-406301.jar -rw-r--r-- 1 root root 10802 Dec 8 11:00 commons-jci-janino-2.4.3.jar -rw-r--r-- 1 root root 207723 Dec 8 11:00 commons-lang-2.1.jar -rw-r--r-- 1 root root 26202 Dec 8 11:00 commons-logging-api-1.0.4.jar -rw-r--r-- 1 root root 635207 Dec 8 11:00 drools-compiler-3.0.5.jar -rw-r--r-- 1 root root 550976 Dec 8 11:00 drools-core-3.0.5.jar -rw-r--r-- 1 root root 383546 Dec 8 11:00 janino-2.4.3.jar -rw-r--r-- 1 root root 358843 Dec 8 11:00 stringtemplate-2.3b6.jar
lib:jbpm-3.1.2.jar
My Purchasing App
EAR contents:drwxr-xr-x 3 root root 4096 Dec 8 11:11 drools drwxr-xr-x 4 root root 4096 Dec 8 11:11 purchasing.jar drwxr-xr-x 4 root root 4096 Dec 8 11:11 purchasing.war -rw-r--r-- 1 root root 619971 Dec 8 11:11 jboss-seam.jar -rw-r--r-- 1 root root 600277 Dec 8 11:11 jbpm-3.1.2.jar drwxr-xr-x 2 root root 4096 Dec 8 11:11 META-INF -rw-r--r-- 1 root root 359 Dec 8 11:11 purchasingRules.drl
drools/lib:-rw-r--r-- 1 root root 443432 Dec 8 11:11 antlr-2.7.6.jar -rw-r--r-- 1 root root 546498 Dec 8 11:11 antlr-3.0ea8.jar -rw-r--r-- 1 root root 36846 Dec 8 11:11 commons-jci-core-1.0-406301.jar -rw-r--r-- 1 root root 10802 Dec 8 11:11 commons-jci-janino-2.4.3.jar -rw-r--r-- 1 root root 26202 Dec 8 11:11 commons-logging-api-1.0.4.jar -rw-r--r-- 1 root root 635207 Dec 8 11:11 drools-compiler-3.0.5.jar -rw-r--r-- 1 root root 550976 Dec 8 11:11 drools-core-3.0.5.jar -rw-r--r-- 1 root root 383546 Dec 8 11:11 janino-2.4.3.jar -rw-r--r-- 1 root root 358843 Dec 8 11:11 stringtemplate-2.3b6.jar
purchasing.war/WEB-INF/lib:-rw-r--r-- 1 root root 24432 Dec 8 11:11 el-api.jar -rw-r--r-- 1 root root 97471 Dec 8 11:11 el-ri.jar -rw-r--r-- 1 root root 5096 Dec 8 11:11 jboss-seam-debug.jar -rw-r--r-- 1 root root 70709 Dec 8 11:11 jboss-seam-ui.jar -rw-r--r-- 1 root root 291366 Dec 8 11:11 jsf-facelets.jar
There are a few difference in location, like I have some libs in WEB-INF/lib whereas drools has it in <EAR dir>/lib
I don't think this matters though because I have the correct paths in my application.xml. My application deploys fine, but the first time I try to access a page which accesses drools I get:17:16:25,918 ERROR [STDERR] StringTemplate: problem parsing group <unknown>: java.lang.ClassCastException: antlr.CommonToken cannot be cast to antlr.Token 17:16:25,919 ERROR [STDERR] java.lang.ClassCastException: antlr.CommonToken cannot be cast to antlr.
Do you guys have any pointers whatsoever as to the means that I can debug this problem. I will, as a last resort, take the drools example and copy all of my files to it and see if that works, but right now I am running a seam-gen project that has a little different dir structure.