[rules-users] KnowledgeBuilder.add(Resource, ResourceType) thread problem?

chriscarr ccarr at esrv.com
Thu Oct 20 18:03:28 EDT 2011


I have a rules server that will handle executing different flows as requests
come in.  For each thread, the following snippet is used:

final KnowledgeBuilder builder  =
KnowledgeBuilderFactory.newKnowledgeBuilder();
final Resource         resource =
ResourceFactory.newClassPathResource(bpmnFile, Foo.class);
builder.add(resource, ResourceType.BPMN2);
if (builder.hasErrors())
    System.out.println....

Unfortunately, it reports an error when there are simultaneous threads in
the "add" method of their respective builders.

This appears using Windows XP, Drools 5.1.1 and 5.2.0.Final, and either JDK
1.5 or 1.6.  Attached is a small command-line project to reproduce the
problem.

-----------
Environment
-----------

OS: Microsoft Windows XP [Version 5.1.2600]
    (C) Copyright 1985-2001 Microsoft Corp.

DOWNLOAD:  http://www.jboss.org/drools/downloads.html -->
droolsjbpm-tools-distribution-5.2.0.Final.zip

JAVA:      java version "1.6.0_24"
           Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
           Java HotSpot(TM) Client VM (build 19.1-b02, mixed mode, sharing)

           java version "1.5.0_19"
           Java(TM) 2 Runtime Environment, Standard Edition (build
1.5.0_19-b02)
           Java HotSpot(TM) Client VM (build 1.5.0_19-b02, mixed mode,
sharing)

------------------------------
Output from Drools 5.2.0.Final
------------------------------
This is the output that I was able to create on subsequent runs of the test
harness.  The errors are different combinations of (but no limited to) the
messages below.
   Message(s):
       Process 'simple bpmn process #1' [simple.flow.id.one]: Process has no
start node. {where the "process" may vary}
       Process 'simple bpmn process #2' [simple.flow.id.two]: Process has no
end node.   {where the "process" may vary}


--
View this message in context: http://drools.46999.n3.nabble.com/KnowledgeBuilder-add-Resource-ResourceType-thread-problem-tp3439140p3439140.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list