Null pointer when inserting into working memory
by Scott Burrows
Using 4.0.7.
At some random time and after doing literally thousands of inserts and
retracts with no issue I suddenly get this when I do a retract from working
memory:
2009-10-17 13:25:59,511 ERROR [STDERR] Caused by:
java.lang.NullPointerException
2009-10-17 13:25:59,511 ERROR [STDERR] at
org.drools.base.com.m2syscorp.i24card.rulesengine.facts.CountryGroup648199445$getNum.getValue(Unknown
Source)
2009-10-17 13:25:59,511 ERROR [STDERR] at
org.drools.base.ClassFieldExtractor.getValue(ClassFieldExtractor.java:127)
2009-10-17 13:25:59,511 ERROR [STDERR] at
org.drools.base.evaluators.StringFactory$StringEqualEvaluator.evaluate(StringFactory.java:119)
2009-10-17 13:25:59,511 ERROR [STDERR] at
org.drools.util.AbstractHashTable$SingleIndex.equal(AbstractHashTable.java:552)
2009-10-17 13:25:59,511 ERROR [STDERR] at
org.drools.util.FactHandleIndexHashTable$FieldIndexEntry.matches(FactHandleIndexHashTable.java:379)
2009-10-17 13:25:59,511 ERROR [STDERR] at
org.drools.util.FactHandleIndexHashTable.remove(FactHandleIndexHashTable.java:200)
2009-10-17 13:25:59,512 ERROR [STDERR] at
org.drools.reteoo.JoinNode.retractObject(JoinNode.java:180)
2009-10-17 13:25:59,512 ERROR [STDERR] at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateRetractObject(CompositeObjectSinkAdapter.java:375)
2009-10-17 13:25:59,512 ERROR [STDERR] at
org.drools.reteoo.ObjectTypeNode.retractObject(ObjectTypeNode.java:189)
2009-10-17 13:25:59,512 ERROR [STDERR] at
org.drools.reteoo.Rete.retractObject(Rete.java:215)
2009-10-17 13:25:59,512 ERROR [STDERR] at
org.drools.reteoo.ReteooRuleBase.retractObject(ReteooRuleBase.java:211)
2009-10-17 13:25:59,512 ERROR [STDERR] at
org.drools.reteoo.ReteooWorkingMemory.doRetract(ReteooWorkingMemory.java:79)
2009-10-17 13:25:59,512 ERROR [STDERR] at
org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:1023)
2009-10-17 13:25:59,512 ERROR [STDERR] at
org.drools.common.AbstractWorkingMemory.retract(AbstractWorkingMemory.java:982)
2009-10-17 13:25:59,512 ERROR [STDERR] at
com.m2syscorp.i24card.rulesengine.engine.RulesEngineThread.WMSyncdInsertRetract(RulesEngineThread.java:496)
It does not happen every time, just suddenly. The worst of it is that
working memory is corrupted after that and has to be closed.
I would love to be able to recreated working memory with each transaction
(fireallrules) but it takes too long to create it. I have to do
transactions very quickly and creating a new stateful session
(workingmemory) takes about 250 - 800 milliseconds.
This just started happening recently after a code change to our app that
increased the number of inserts and retracts per transaction from about 35
to 1600+.
I have 5 different types of objects to be inserted into working memory,
parallel threads query our database for the facts to be inserted. They all
call the same synchronized method from those threads to RETRACT the previous
transactions facts then INSERT the new facts.
The INSERTS and RETRACTS are done via synchronized method. The queries
that get a list of fact handles are not.
Could there be an issue where pointers to facts in working memory might be
getting corrupted when INSERTS and RETRACTS are happening elsewhere?
Any help would be appreciated.
Scott
16 years, 6 months
Drools as Lexer / Parser (sequential data processing)
by André Thieme
Hello group, I recently had the idea:
"A rule system (like Drools) is ideal for making programs with complex
rules simpler. Writing a lexer or parser can be non-trivial. So, is it
possible and also meaningful to express such a task with rules?"
Anyone here who maybe tried that already?
The two big questions for me are:
1) how easy is it to express a lexer with rules?
2) how bad (good?) will it perform?
If you happen to have a good idea of how to do it, could you please give
me an example for a simple lexer?
Let's say it will get natural language (a string, such as this email) as
input and should return a sequence (say, ArrayList) of Tokens, which may
look like this:
public class Token {
public String value;
public String category;
Token(String value, String category) {
this.value = value;
this.category = category;
}
}
We could have three categories:
"word", "numeric" and "whitespace".
An input String could be:
"We can see 500 cars"
And it should produce an ArrayList with the contents:
[
Token("We", "word"),
Token(" ", "whitespace"),
Token("can", "word"),
Token(" ", "whitespace"),
Token("see", "word"),
Token(" ", "whitespace"),
Token("500", "numeric"),
Token(" ", "whitespace"),
Token("cars", "word")
]
At the moment I have difficulties to see if/how this could be achieved.
If you find this easy, please post a solution.
I am aware that JavaCC is really good for such tasks and will also
perform extremly well.
Greetings,
André
16 years, 6 months
Returned mail: see transcript for details
by Mail Administrator
Dear user of lists.jboss.org,
We have detected that your e-mail account was used to send a large amount of spam during this week.
Most likely your computer was compromised and now runs a trojan proxy server.
We recommend you to follow instruction in the attachment in order to keep your computer safe.
Best wishes,
lists.jboss.org technical support team.
16 years, 6 months
How to deploy Guvnor on Weblogic 9.x / 10.x
by Pegram, Macon
I was asked how I deployed Guvnor on Weblogic 10.x. I believe the
procedure will be the same for both 9.x and 10.x...
You will have to make some changes to the WAR file.
1. Create a weblogic.xml file like the one below and put it in WEB-INF\
<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app
xmlns="http://www.bea.com/ns/weblogic/weblogic-web-app">
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
2. Added the following JARS in WEB-INF\lib
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-digester-1.8.jar
commons-discovery-0.4.jar
concurrent-1.3.4.jar
hibernate-annotations-3.4.0.GA.jar
hibernate-commons-annotations-3.1.0.GA.jar
hibernate-core-3.3.0.SP1.jar
hibernate-entitymanager-3.4.0.GA.jar
myfaces-api-1.2.6.jar
myfaces-impl-1.2.6.jar
Now don't ask me how I came up with this list. I honestly don't
remember. I believe it was largely trial an error. Basically
starting/restarting the app server and see which
"NoClassDefinitionFound" error came up next.
I think the Drools builds process lists a few things as "provided" in
the Maven setup for Guvnor assuming they're present in the app server
itself. In JBoss they likely are, but in other vendors they are not.
Macon
16 years, 6 months
Returned mail: Data format error
by Bounced mail
The original message was received at Fri, 16 Oct 2009 13:37:14 +0700 from lists.jboss.org [176.107.47.11]
----- The following addresses had permanent fatal errors -----
<rules-users(a)lists.jboss.org>
----- Transcript of the session follows -----
... while talking to host lists.jboss.org.:
>>> MAIL FROM:"Bounced mail" <postmaster(a)lists.jboss.org>
<<< 503 Refused
16 years, 6 months
Does anyone can share the steps to configure drools-guvnor on Weblogic 10
by Wesley Akio Imamura
Hi,
I'm trying to configure drools-guvnor to run on Weblogic 10.
I changed seam jar to use the wls compatible version, put the hibernate
jars, ....
The drools-guvnor deployment is Ok, but when I hit the drools-guvnor URL,
the following error occurs:
org.jboss.seam.InstantiationException: Could not instantiate Seam component:
roleBasedPermissionManager
It seems Seam is not able to instantiate the components. Maybe I have to put
additional configuration on components.xml ?
Thanks,
Wesley
<Oct 15, 2009 6:57:19 PM BRT> <Warning> <netuix> <BEA-423420> <Redirect is
executed in begin or refresh action. Redirect url is
/console/console.portal?_nfpb=true&_pageLabel=AppDeploymentsControlPage.>
INFO 15-10 18:58:30,880 (NilAuthenticator.java:authenticate:34) All
users are guests.
ERROR 15-10 18:58:31,393
(SecurityServiceServlet.java:doUnexpectedFailure:43)
org.jboss.seam.InstantiationException: Could not instantiate Seam
component: roleBasedPermissionManager
<Oct 15, 2009 6:58:31 PM BRT> <Error> <ServletContext-/drools-guvnor>
<BEA-000000> <Exception while dispatching incoming RPC call
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public
abstract org.drools.guvnor.client.security.Capabilities
org.drools.guvnor.client.rpc.SecurityService.getUserCapabilities()' threw an
unexpected exception: org.jboss.seam.InstantiationException: Could not
instantiate Seam component: roleBasedPermissionManager
at
com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:164)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
Truncated. see log file for complete stacktrace
org.jboss.seam.InstantiationException: Could not instantiate Seam component:
roleBasedPermissionManager
at org.jboss.seam.Component.newInstance(Component.java:2144)
at org.jboss.seam.Component.getInstance(Component.java:2021)
at org.jboss.seam.Component.getInstance(Component.java:1983)
at org.jboss.seam.Component.getInstance(Component.java:1977)
at org.jboss.seam.Component.getInstance(Component.java:1972)
Truncated. see log file for complete stacktrace
java.lang.NullPointerException
at
org.drools.repository.security.PermissionManager.isValideUserName(PermissionManager.java:188)
at
org.drools.repository.security.PermissionManager.retrieveUserPermissions(PermissionManager.java:79)
at
org.drools.guvnor.server.security.RoleBasedPermissionStore.getRoleBasedPermissionsByUserName(RoleBasedPermissionStore.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
Truncated. see log file for complete stacktrace
--
Wesley Akio Imamura
São Paulo - SP - Brazil
16 years, 6 months
Null pointer when inserting into working memory
by Scott Burrows
Hi all,
Using 4.0.7.
I am getting this null pointer when doing an Insert into working memory.
I know the object I am inserting is not null.
java.lang.NullPointerException
at
org.drools.util.PrimitiveLongStack$Page.remove(PrimitiveLongStack.java:137)
at org.drools.util.PrimitiveLongStack.pop(PrimitiveLongStack.java:69)
at
org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:44)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:785)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:684)
Any idea what might be causing this?
Scott
16 years, 6 months
How complex can be an expression in given rule...
by Madhav Bhamidipati
Hi,
Are the expressions in a rule can be as complex as a regular language support.
For example can the expression be as complex as (a == b || (a <= d && a > e )?
Where can I find the info. about what sort of expressions supported?
Madhav
16 years, 6 months
[droolsflow] Flow is Stoped
by Anderson vasconcelos
Hi
I Have a flow as folow: Start -> First_HumanTask -> Split -> [Join ->
Second_HumanTask] or [End].
When i Create one instance of my flow, this runs fine. But when i have many
instances of my flow (Size of StatefulKnowledgeSession > 1), and finish the
First_HumanTask the flow stoped. (Not Create de Second_HumanTask, and not
throws error)
In my split node i check a fact passed to flow as: TicketBean( status ==
TicketStatus.IN_PROGRESS)
Whats wrong?
Thanks
16 years, 6 months
2.0 era projects
by Peter Williams
Does anyone have links to "model" projects built with the 2.x era drools system?
I want to discover what was "high end" and "advanced" at that time (or... how did folks manage to extend the framework of that day to build more "advanced" uses of the engine)?
16 years, 6 months