JBoss Drools Scala

I'm trying to implement a sample of integration between JBoss Drools framework and Scala and I've found an issue I cannot solve. When I try to compile, the scala compiler just outputs an error saying that KnowledgeBuilderFactory is broken... Thanks in advance.

Answers


This error is caused by missing class/jar/dependency. You need to get all dependencies (jars) on to your classpath. If you are using the Eclipse zip project from that page you are not provided with these jars by default. Take a look at .classpath file:

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
        <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Drools 5.1.1"/>
        <classpathentry kind="lib" path="/Users/claytonrl/Development/org.eclipse.jdt.core_3.5.2.v_981_R35x.jar"/>
        <classpathentry kind="lib" path="/Users/claytonrl/Software/drools-5.1.1-bin/lib/antlr-2.7.6.jar"/>
        <classpathentry kind="lib" path="/Users/claytonrl/Software/drools-5.1.1-bin/lib/antlr-runtime-3.1.3.jar"/>
        <classpathentry kind="lib" path="/Users/claytonrl/Software/drools-5.1.1-bin/lib/mvel2-2.0.16.jar"/>
        <classpathentry kind="lib" path="/Users/claytonrl/Software/drools-5.1.1-bin/lib/xstream-1.3.1.jar"/>
        <classpathentry kind="output" path="bin"/>
</classpath>

Most likely you don't have this directory /Users/claytonrl/Software/ on your computer and all those drools jars in it. If so download those from maven repository and put them in lib directory.

As suggested here adding this libraryDependencies += "com.sun.xml.bind" % "jaxb-xjc" % "2.2.4-1" dependency to your SBT should help in this exact case.


Need Your Help

IIS Virtual directory

asp.net iis

I try to route my PDF files trough my global.asax to check accessrights.

2D array C++ operator []

c++ arrays

I have a 2D array, when I want to assign a value to a cell, it assigns the same value to the opposite cell.