We had some problems running Drools in a Tomcat/Bonita BPM environment. At the startup of the deployed jar, we got the following exception:
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at org.eclipse.jdt.internal.compiler.parser.Parser.consumeCastExpressionWithQualifiedGenericsArray(Parser.java:2083)
at org.eclipse.jdt.internal.compiler.parser.Parser.consumeRule(Parser.java:5983)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9339)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9571)
at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9528)
at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Parser.java:8126)
at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:712)
at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:377)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:422)
at org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:389)
at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:49)
at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:408)
at org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:46)
at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:102)
at org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:1046)
at org.drools.compiler.PackageBuilder.compileRules(PackageBuilder.java:948)
at org.drools.compiler.PackageBuilder.compileAllRules(PackageBuilder.java:879)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:871)
at org.drools.compiler.PackageBuilder.addPackageFromDecisionTable(PackageBuilder.java:447)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:711)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:51)
at hu.bme.mit.sysint.mohoka.pricecalculation.PriceCalculator.readKnowledgeBase(PriceCalculator.java:122)
Environment: Windows 8.1, Java: Oracle JDK 1.7.0_55, with default config.
The Drools documentation had a note, that mentioned possible problems with the JDT compiler in J2EE environments and mentions a possible solution: using the Janino comiler. After we set the property, we got another exception in the log:
Caused by: org.drools.RuntimeDroolsException: Unable to load dialect 'org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration:mvel:org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration'
at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:321)
at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:307)
at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:192)
at org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:165)
at org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl.newKnowledgeBuilderConfiguration(KnowledgeBuilderFactoryServiceImpl.java:26)
at org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(KnowledgeBuilderFactory.java:85)
at hu.bme.mit.sysint.mohoka.pricecalculation.PriceCalculator.readKnowledgeBase(PriceCalculator.java:117)
at hu.bme.mit.sysint.mohoka.pricecalculation.PriceCalculator.calculateComputerPrice(PriceCalculator.java:37)
at hu.bme.mit.sysint.mohoka.pricecalculation.connector.ComputerPriceCalculationImpl.executeBusinessLogic(ComputerPriceCalculationImpl.java:44)
at org.bonitasoft.engine.connector.AbstractConnector.execute(AbstractConnector.java:74)
at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:70)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:141)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:124)
... 4 more
Caused by: java.lang.ClassCastException: org.drools.rule.builder.dialect.mvel.MVELDialectConfiguration cannot be cast to org.drools.compiler.DialectConfiguration
at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:316)
... 16 more
Environment: Windows 8.1, Java: Oracle JDK 1.7.0_55. Config: drools.dialect.java.compiler=JANINO
MOHOKA Team