[droolsflow] JPAVariablePersister Crashing SQL Server RPC?
by Bill Tarr
Has anyone successfully used JPAVariablePersister on Sql Server? The quick hits are we are running MSSQL 2008, and after introducing JPAVariablePersister (which is described very well in http://blog.athico.com/2009/09/drools-flow-variable-persistence.html) every time I run my test case, the DB becomes non-responsive, returning from any JDBC pings:
java.sql.SQLException: I/O Error: DB server closed connection.
You can't even connect through MSSQL Management Studios, looks like RPC service has gone down. Haven't been able to do much troubleshooting yet (slow going when you need to get a DBA to reboot your sever every time.)
I've already tested out the JPAKnowledgeService with some success. Setting up my session with the following code, I can see the SessionInfo, ProcessInstanceInfo, ProcessInstanceInfo_eventTypes tables storing data, looks pretty solid, and I can grab the processes again.
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.drools.persistence.jpa");
env = KnowledgeBaseFactory.newEnvironment();
env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
session = JPAKnowledgeService.newStatefulKnowledgeSession(knowledgeBase, null, env);
Map<String, Object> parameterMap = new HashMap<String, Object>();
parameterMap.put("claim", claim);
processInstance = session.startProcess(CLAIMS_DEMO, parameterMap);
I want to store my variable separately though, as we already have them as Hibernate DTOs. So I added the following code, as well as adding JPAVariablePersister to my persistence.xml.
VariablePersistenceStrategyFactory.getVariablePersistenceStrategy()
.setPersister("javax.persistence.Entity",
"org.drools.persistence.processinstance.persisters.JPAVariablePersister");
The code appears to run through. This time, I can see data in the SessionInfo, ProcessInstanceInfo, ProcessInstanceInfo_eventTypes tables, as well as additional data in VariableInstanceInfo, and my two entities (Claim, which has a List of Role.) The data looks pretty good, and my process logs hit the expected nodes.
Anyway, I'll post more as I learn it. Let me know if anyone else is running into this.
Thanks!
Bill
15 years, 2 months
How to run drools-guvnor 5.0 on Weblogic 11g
by Wesley Akio Imamura
Enable jsf shared libraries on Weblogic and put the following Seam 2.1.2
libs in drools-guvnor.war/WEB-INF/lib:
/jboss-seam-2.1.2/lib:
asm.jar
cglib.jar
commons-logging.jar
hibernate.jar
hibernate-annotations.jar
hibernate-commons-annotations.jar
hibernate-entitymanager.jar
log4j.jar
--
Wesley Akio Imamura
São Paulo - SP - Brazil
15 years, 2 months
Creating rules from an UI
by Leonardo Gomes
Hi Guys,
I have an UI that allows users to create rules in admin interface of my
application. I'm thinking about generating drl text out of the UI state (I'd
have an object model that would be populated by it), but was wondering if
there would be a way to programmatically create the rules instead of having
this object->drl step.
Advice is welcome!
Thanks in advance.
Leo.
15 years, 2 months
Oracle Database to store rules in Guvnor
by Ambika Goel
Hi All,
I am using Oracle database to store rules repository via apache jackrabbit in Guvnor. I have made relevant changes in repository.xml.
When I use this repository.xml in Jboss, the Guvnor.html loads after around 2 hrs of processing.
And in the server.log I can see
java.sql.SQLException: IOException: Connection reset by peer: socket write error
Can anyone please tell me why it's taking so much time for the Guvnor.html to load?
15 years, 2 months
Message could not be delivered
by The Post Office
���/`V�$-���d�����-�F
�Lg�� ���J^3Vt��,�I-|>��R�����&��\]h!�����3�|������c�\��B� �w���T�?�
����j���<^mZ�������!�����m�
��
R��
����B
u�F�R�c�m�{�X;�O�OG���j�����LJK^#MtM�YryS��1���gP����M}��F���CV�2��H
�0���s�I;�w����
h��q��zv�
k���j�[dZ;�1�
O_�f�e�Bl��a��R;��F&�}L�.
��\�>��ZPp!���SxX�A��'wn��iHl�uU��k,�,�s�CV�����WYz���,[$�)�a����h������]��N��D�_"E'�����n�{�bZ��q�4Gn����r
�yeKF��X�#�G�.-�*����`�Fv�����F,��c9Icg.(
>�J�Kw�n�������1
N�jN(
����_��:�
/�
[D�5<84�XN����?�c.�4�p w��Y���|���h:
�T���Be8�T{NM�{_&�r��Q<:�&I?�2a�����v����^���}��U�k:�,$�0H):��Q���:2��iu9�8D<;Ag�����D`�����h��Uw^I[>'[�A
��fn��U3�����j�~u��-e���
P���0H��Xns^����uG��5&�r]�H���7�e�vAeH<��J��u�s��qk{�T����~,�d,�M���B
���f�:���^�z)����
g�B\���]�uZ�_��uE����k�2
�3�4�sA��i��.��3pi-���96�N�L����#��Zb�����
Z�7
�J���h��Y&E2u�������v��h�������W�DS���S�>[D�>H��Pi�~�n�8��_����D�G9�?�����Om{t*���{�e�p�
��V&�3pj���U��w�.�7���Q
l:?��vB �{���;����]b�
?����%O%���}>#��hbV���BTy��.���������o���O`xz�9�P�$�8��2[d�������;��b9B�b5'��F�����'F\~s*A�������v�����R��
��.AharW����
�{��7b��L��Q"7�aI�7�[�Y���������f
15 years, 2 months
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
15 years, 2 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é
15 years, 2 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.
15 years, 2 months