在升级jboss测试Drools时,Eclipse后台报以下错误:
org.drools.RuntimeDroolsException: Unable to load dialect 'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'
at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:160)
at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:146)
at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:121)
at org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:98)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:124)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:86)
at com.sample.DecisionTableTest.readDecisionTable(DecisionTableTest.java:58)
at com.sample.DecisionTableTest.main(DecisionTableTest.java:35)
Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in the classpath
at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:91)
at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:52)
at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:156)
... 7 more
原因是缺少包:org.eclipse.jdt.core_3.5.2.v_981_R35x.jar
加上后出现另一个错误: wrong class format
Exception in thread "main" java.lang.RuntimeException: wrong class format
jboss7运行在jdk8中,drtools版本为为5.3.1,因为drtools6以下不兼容JDK8,所以有两种解决方法:换JDK、升级drtools或者升级jdt core版本,第一次涉及项目方案设计不可行,我试比较简单的第三种,将org.eclipse.jdt.core_3.5.2.v_981_R35x.jar换成org.eclipse.jdt.core-3.8.2.v20130121.jar,再次运行后没有报错