drools-solver -- logger error (slf4j binding)?
by Andrew Waterman
Hi,
I'm using the drools-solver.M5 build through Maven and have gotten the
following error while running my project:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for
further details.
I've checked my dependency graph, and drools-solver references the
sl4j-api, but no implementation. I checked the mvnrepository, and
there are several other slf4j related projects. What is the preferred
binding for JDK1.6?
best wishes,
Andrew
---------------------------------
Andrew Waterman
San Cristóbal de las Casas, Chiapas, Mexico
+52 1 967 107 5902
+1 510 342 5693
17 years
Help on using Drools with embedded objects
by Divya Rajendranath
Hi,
I am planning to use Drools - JBoss Rules Engine. My requirement is to
disburse mails from my application to different groups based on various
criteria. I want to use Drools here.
My object structure is as follows:
class A{
String B = "";
B b;
C c;
}
Hence Obj A has embedded objects within it, and obj B and C further has
embedded objects.
class B {
String X;
Z z;
}
class Z{
String t;
String s;
}
The decision on sending the mails based on the fields in embedded objects of
A. I pass instance of A to Drools
Format of drl file:
package...;
import ..;
rule "Test"
when $a:A(B(Z(s == "testvalue")))
then
$a.setSomething();
update($a);
end
I wanted to know if this (accessing fields in embedded/child object) is
feasible with Drools.
I get an error saying "UNable to compile myfile.drl when i try to fo this.
Could some one look into this issue and let me know the reason for this ?
Thanks
-D
17 years
Creating objects in WHEN clause
by David Boaz
In my application, we often compare the fact's field values against a known
object. For example:
WHEN person(height> new Quantity(2, "m")) // the height is greater than 2
meters.
will DROOLS create a "singleton" Quantity object, or will it create one
object for each fact evaluation?
We consider using anoter approach, using GLOBALS. Then, the Quantity object
will be created applicatively, and passed by the API to the engine.
something like:
GLOBAL Quantity 2meters
WHEN person(height > 2meters)
But this approach is combersom, because the rule author has to define part
of the information in the calling application, and part in the rule.
Do you have a good practice how to handle these situations?
Thanks, David
--
View this message in context: http://www.nabble.com/Creating-objects-in-WHEN-clause-tp22207616p22207616...
Sent from the drools - user mailing list archive at Nabble.com.
17 years
Drools-Smooks Data Loader
by Dave Macpherson
I'm trying to use Smooks to populate my Drools internal data model as per the blog posting at http://blog.athico.com/2008/07/drools-smooks-data-loader.html, but it's not quite working out for me.
In that posting, there is the following line of code:
DroolsSmooks loader = new DroolsSmooks( session, smooks, conf );
I believe this line is a typo (there is no class that I can find called "DroolsSmooks", but I'm not sure what it should be. I've found a test case online that refers to a class called "DroolsSmooksStatelessSession", but that doesn't resolve the reference either.
Does anyone have a sample program that uses the Smooks data loader that I can follow and get working?
Regards,
Dave
17 years
NPE in JavaDialectConfiguration
by cyclemenow
I am getting a NullPointerException while trying to call:
RuleAgent ruleAgent = RuleAgent.newRuleAgent(prop);
The exception looks like this:
13:15:08,754 ERROR [STDERR] org.drools.RuntimeDroolsException: Unable to
load dialect
'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java'
13:15:08,755 ERROR [STDERR] at
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:160)
13:15:08,755 ERROR [STDERR] at
org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfiguration.java:146)
13:15:08,755 ERROR [STDERR] at
org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:121)
13:15:08,755 ERROR [STDERR] at
org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:98)
13:15:08,755 ERROR [STDERR] at
org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:124)
13:15:08,755 ERROR [STDERR] at
org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:86)
13:15:08,755 ERROR [STDERR] at
org.drools.compiler.SourcePackageProvider.loadPackage(SourcePackageProvider.java:22)
....
13:15:08,766 ERROR [STDERR] Caused by: java.lang.NullPointerException
13:15:08,766 ERROR [STDERR] at
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfiguration.java:89)
13:15:08,766 ERROR [STDERR] at
org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java:52)
13:15:08,766 ERROR [STDERR] at
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:156)
I've made sure the eclipse compiler is definitely in the classpath. I am
able to load that class in my code that calls into drools.
I tracked this down to the line in the code excerpt below from
JavaDialectConfiguration.java that calls getClassLoader(). getClassLoader()
is returning a null.
I was then able to pull some info from the documentation for the Java1.5
getClassLoader() method:
"
Returns the class loader for the class. Some implementations may use null to
represent the bootstrap class loader. This method will return null in such
implementations if this class was loaded by the bootstrap class loader.
If a security manager is present, and the caller's class loader is not null
and the caller's class loader is not the same as or an ancestor of the class
loader for the class whose class loader is requested, then this method calls
the security manager's checkPermission method with a
RuntimePermission("getClassLoader") permission to ensure it's ok to access
the class loader for the class.
If this object represents a primitive type or void, null is returned.
"
It isn't a permissions problem, since that exception isn't thrown. The
error is clearly a null pointer, and stepping through the code after
attaching source also shows that getClassLoader() is returning a null.
Okay, so sometimes it can return null, but how do I get my code to work? Is
there a work around?
I'm running inside of Eclipse Ganymede, using JBoss 4.2.2.GA, Drools 4.0.7
and Java 1.5 running on MacOSX 10.5.
Thank you in advance for your help,
Matthew
-------code excerpt
/**
* Set the compiler to be used when building the rules semantic code
blocks.
* This overrides the default, and even what was set as a system
property.
*/
public void setCompiler(final int compiler) {
// check that the jar for the specified compiler are present
if ( compiler == ECLIPSE ) {
try {
problem line here: getClass().getClassLoader().loadClass(
"org.eclipse.jdt.internal.compiler.Compiler" );
} catch ( ClassNotFoundException e ) {
throw new RuntimeException( "The Eclipse JDT Core jar is not
in the classpath" );
}
} else if ( compiler == JANINO ){
try {
getClass().getClassLoader().loadClass(
"org.codehaus.janino.Parser" );
} catch ( ClassNotFoundException e ) {
throw new RuntimeException( "The Janino jar is not in the
classpath" );
}
}
--
View this message in context: http://www.nabble.com/NPE-in-JavaDialectConfiguration-tp22255233p22255233...
Sent from the drools - user mailing list archive at Nabble.com.
17 years
Working with compiled packages
by Dan Seaver
Drools 5.0 - I'm planning on using compiled rule packages in our J2EE
production environment. I'm very interested in performance. I assume that
once a package is loaded, it doesn't matter if or how it was compiled, so
the primary concern is in the load time (unless there are other issues I'm
unaware of?)
Any difference between Janino builds versus Eclipse builds?
Which compiler does Guvnor use?
Is the high speed drools serialization being used for building / loading
binary packages?
Any faster technique for loading a binary package than using:
KnowledgeBuilder builder = KnowledgeBuilderFactory.newKnowledgeBuilder();
builder.add(ResourceFactory.newInputStreamResource(inStream),
ResourceType.PKG);
if (builder.hasErrors()) {
logger.error(builder.getErrors());
return;
}
rulePackage.Base = KnowledgeBaseFactory.newKnowledgeBase(config);
rulePackage.Base.addKnowledgePackages(builder.getKnowledgePackages());
Thanks in advance for any illumination.
Dan
--
View this message in context: http://www.nabble.com/Working-with-compiled-packages-tp22256636p22256636....
Sent from the drools - user mailing list archive at Nabble.com.
17 years
How to set JANINO compiler with Drools5 M5
by Shigeaki Wakizaka
Hi.
I'm kind of new to Drools5.0.
Could I ask you guys how to set JANINO compiler with recent API?
I just run the sample drl with EclipseIDE, which is download from drools
site, and then
the error occured- The Eclipse JDT Core jar is not in the classpath.
So, I just want to know why this happens and how to set another compiler
to retry.
Thanks in advance.
waki
17 years
Deploying BRMS on WAS 6.1
by Prachi Patil
Hi,
I am a newbier to Drools.
The BRMS war file is downloaded from
http://download.jboss.org/drools/release/4.0.7.19894.GA/drools-4.0.7-brms.zi
p
The deploy goes fine with no errors on WAS 6.1, but the when I hit the url
http://localhost:9081/drools-jbrms/index.jsp
I get an exception on the console as
[drools-jbrmsEAR#drools-jbrms.war] [/drools-jbrms] [Servlet.LOG]: Exception
while dispatching incoming RPC call: java.lang.NullPointerException
at
org.jboss.seam.remoting.gwt.GWTToSeamAdapter.callWebRemoteMethod(GWTToSeamAd
apter.java:67)
at
org.jboss.seam.remoting.gwt.GWTRemoteServiceServlet.processCall(GWTRemoteSer
viceServlet.java:290)
at
org.jboss.seam.remoting.gwt.GWTRemoteServiceServlet.doPost(GWTRemoteServiceS
ervlet.java:172)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:9
66)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:9
07)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.
java:145)
at org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
at
org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServle
tRequest.java:46)
at org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstance
Wrapper.java:190)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.
java:130)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain
.java:87)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterMana
ger.java:701)
at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterMana
ger.java:646)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.
java:475)
at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrappe
r.java:463)
at
com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129)
at
com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238)
at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811)
at
com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(Ht
tpInboundLink.java:465)
at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(Ht
tpInboundLink.java:394)
at
com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLRea
dCallback.java:102)
at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioRea
dCompletionListener.java:152)
at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java
:213)
at
com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFutu
re.java:195)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741
)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
Can anybody please help?
Thanks !
17 years