Augusto
Augusto

Reputation: 1336

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.

Upvotes: 0

Views: 681

Answers (1)

yǝsʞǝla
yǝsʞǝla

Reputation: 16422

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.

Upvotes: 1

Related Questions