Hi Mark,
After a bit of debugging I managed to resolve my issue. It appears the
correct way to resolve this issue is to instantiate an instance of
PackageBuilderConfiguration and pass into the constructor a Properties
object where you specify your options.
Spring configuration:
<bean id="packageBuilderConfig" class=
"org.drools.compiler.PackageBuilderConfiguration">
<constructor-arg type="java.util.Properties">
<props>
<prop key="drools.dialect.java.compiler">JANINO</prop>
</props>
</constructor-arg>
</bean>
Next, this PackageBuilder must be set as a value in the Map that is passed
into the method createRuleExecutionSet of the Provider (
javax.rules.admin.LocalRuleExecutionSetProvider). This can be accomplished
in the Spring configuration as well using the following:
<property name="properties">
<map>
<entry key=
"javax.rules.admin.RuleExecutionSet.packageBuilderConfiguration" value-ref
="packageBuilderConfig"/>
</map>
</property>
Finally, the ruleSetProperties are passed into the createRuleExecutionSet
method:
RuleExecutionSet ruleExecutionSet = provider.createRuleExecutionSet(
sourceAsInputStream, rulesetProperties);
And voil! Drools is now using Janino. Sadly, the application server I am
deploying to seems to be having a classloader issue preventing Drools
from being able to load the org.codehaus.janino.Parser class. But that is
an issue that has nothing to do with Drools I am happy to say.
Thanks again for the help.
Chris
Christopher.Mathrusse(a)sybase.com
Sent by: rules-users-bounces(a)lists.jboss.org
06/12/2008 08:43 AM
Please respond to
Rules Users List <rules-users(a)lists.jboss.org>
To
Rules Users List <rules-users(a)lists.jboss.org>
cc
Subject
Re: [rules-users] The Eclipse JDT Core jar is not in the classpath
Hi Mark,
Thanks for the reply. I created a packagebuilder.conf file that simply had
name/value pairs in it as follows:
drools.dialect.java.compiler=JANINO
and I placed into one of each of the following locations:
WEB-INF
WEB-INF/classes
META-INF
I tried each one, one after the other but I still receive the same error
message at application startup. Do I have the entries correct? Should I be
placing this somewhere else? Is there something that I am still
overlooking?
Thanks for the help...
Chris
Mark Proctor <mproctor(a)codehaus.org>
Sent by: rules-users-bounces(a)lists.jboss.org
06/12/2008 03:43 AM
Please respond to
Rules Users List <rules-users(a)lists.jboss.org>
To
Rules Users List <rules-users(a)lists.jboss.org>
cc
Subject
Re: [rules-users] The Eclipse JDT Core jar is not in the classpath
Christopher.Mathrusse(a)sybase.com wrote:
I'm using JBoss Rules 4.01 with Spring 2.5 and I'm utilizing the JSR-94
interfaces provided by Spring Modules. When deploying my application I
receive the error:
The Eclipse JDT Core jar is not in the classpath
I've searched through the postings and found that setting the compiler to
drools.dialect.java.compiler should resolve the issue but I am having
trouble figuring out where to set this property on the JSR_94 interfaces.
I've tried passing a Map into
ruleAdministrator.getLocalRuleExecutionSetProvider(providerProperties);
with the following specified in my Spring configuration:
<prop key="drools.dialect.java.compiler">JANINO</prop>
but I believe the initialization occurs long before this point.
I've also tried dropping into the applications WEB-INF/lib directory a
copy of the jasper-compiler-jdt.jar into the WEB-INF/lib directory, which
should satisfy the dependency, but it didn't seem to resolve the issue.
Either that's the wrong classpath location, or that jasper compiler isn't
hte same thing, try the jdt.jar supplied with drools.
I would prefer it if there was some way of setting this property without
having to use the JDT libraries.
This should be possible, have you tried adding a packagebuilder.conf to
tbe WEB-INF directory as the propperties loader checks for one of those
first.
I saw that I can provide system properties to make Drools aware of the req
uested compiler setting but this is not really an option as I am running
inside of a J2EE container and I am unable to modify the settings that are
provided to the application server. Is there a default location in the
classpath that Drools looks for a properties file that I can specify these
values? Or better still, is there a way that I can supplied them to the
JSR-94 interfaces to ensure proper initialization?
no and it is for this reason that I tell people to stay away from the
abomination that is JSR94.
Thanks very much for the help.
Chris
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users