Speed up inserting of rules into knowledge base
by Piotr Jedrychowski
Hello.
I'm loading a big amount of rules during starting of JBoss (20000
rules). All rules (in string format) are available before JBoss startup
- they are stored into database. Rules are loaded one by one and it
takes about 90 minutes. I want to speed up this process. Is there
something like "bulk load" for inserting rules into knowledge base or
another smart way to fast loading a big amount of rules?
I'm using:
1) Drools 5.1
2) JBoss 4.2.3
My source code looks like this:
String rule = ...
Resource resource = ResourceFactory.newReaderResource(new
StringReader(rule));
KnowledgeBuilder knowledgeBuilder =
KnowledgeBuilderFactory.newKnowledgeBuilder();
knowledgeBuilder.add(resource, ResourceType.DRL);
knowledgeBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());
Regards,
Piotr
13 years, 7 months
Mythic Game Project Addition Artificial Intelligence and Quest System Components
by Mark Proctor
http://blog.athico.com/2011/01/mythic-game-project-addition-artificial.html
"In this project, we describe the design decisions and principles behind
the arti cial intelligence (AI) for a multiplayer online role playing
game, and our use of an expert system to implement it. We explain how we
organize AI rules into les, how those rules are assembled from a
database, how AI is assigned to entities, the di erent types of AI, the
di erent phases of AI, and how we manage facts used by AI. We also
review some of the history behind the Mythic project, where it is
headed, what an expert system is and why we chose to use one for our
project. The result of our project is a design that allows us to have
diverse AI behavior and exibility to reuse code to create new behaviors,
but may prove to be ineffcient if implemented on systems with many
players or many instances of AI running."
13 years, 8 months
StatefulKnowledgeSession Vs StatefulSession
by DeepakA
I used a KnowledgeBuilder ro read the resources (DSL & DSLR files)
Then created a KnowledgeBase and created a StatefulKnowledgeSession out of
the KnowledgeBase.
The StatefulKnowledgeSession was used to start the process and fire all
rules.
Then I realized I was not able to access the RuleBase from
StatefulKnowledgeSession.
So, now I create a RuleBase, then a PackageBuilder, add the resources to the
packageBuilder, then add the
package to the RuleBase and create a StatefulSession out of the RuleBase.
This statefulsession is used to start the process and fire all rules.
Can someone explain to me whats the difference in the above 2 methods of
firing the rules.
Whats the difference between StatefulKnowledgeSession & StatefulSession.
--
View this message in context: http://old.nabble.com/StatefulKnowledgeSession-Vs-StatefulSession-tp26511...
Sent from the drools - user mailing list archive at Nabble.com.
13 years, 8 months
WorkflowProcessInstance in DRL
by Gareth Evans
Hello,
I am having some problems using WorkflowProcessInstance in rules. I
have searched and not been able to find an answer to my question.
I am attempting to use rule flows to define business processes and
rules both in ruleflow groups to be executed on demand of the process
and outside of a ruleflow group for "global" rules and to potentially
direct the ruleflow(/process) is to run. Many of these processes are
comprised of subprocesses which I have been using sub flows to model.
I have used flow variables to store some minimal information about the
process such as what the process ID corresponds to in the existing
data model I am working with. My intent was so that I could use a
single rule flow group in many rule flows to extract information from
the database for the corresponding process ID in the working memory
(this extraction would also depend on other facts in the working
memory).
I've inserted the WorkflowProcessInstance by using an action node in
the "parent" process and it seems to work fine. My problem arises when
I am then in a "child" process/subflow and try to invoke this single
rule flow group with a different process ID in the flow variable,
there are no activations. I think this happens because the
WorkflowProcessInstance has not been updated in working memory so it
will not know that there might be a new process ID stored in the flow
variable (it has the same name in both flows as it is meant to
represent the same thing).
If I insert the WorkflowProcessInstance again in the sub flow I get
activations in the rule flow group for facts in the working memory
associated with both the parent and child sub flow which almost makes
sense except for this:
"We have added special logic to make sure that a variable
processInstance of type WorkflowProcessInstance will only match to the
current process instance and not to other process instances in the
Working Memory."
It seems that it is matching both instances of
WorkflowProcessInstance. I use the convention of starting variable
names from the LHS of a rule with a $ but I have tested it without and
I get the same result. Is this expected behaviour?
An alternative I've been trying to figure out is how to update the
WorkflowProcessInstance in working memory in the child process. Since
it is actually a different object I'm unsure how to do this. Should I
retract all instances and then insert the current? Is there a way to
do this more cleanly than looking through all working memory objects
and checking their type in an action node?
Finally (or perhaps firstly...), am I going about this correctly?
Cheers,
Gareth
13 years, 8 months
Re: [rules-users] Starting engine using fireUntilHalt and inserting no facts results in 50% CPU usage
by Greg Barton
I was going to look at this at some point. I guess that point will be tonight. :)
GreG
On Oct 25, 2010, at 15:02, Edson Tirelli <tirelli(a)post.com> wrote:
No worries, it is a good starting point anyway. Hopefully someone
can continue from there or I will eventually fix it. Just a lot of
stuff in my plate already that have priority over this.
Edson
2010/10/25 mardo <mardo(a)abicola.de>:
Unfortunately no, I just had a look how it was implemented (like
http://tutorials.jenkov.com/java-concurrency/thread-signaling.html#missedsig
nals) -> missed signals and noticed that it somehow didn't work as intended.
But no idea how to directly correct it, sorry.
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Montag, 25. Oktober 2010 21:30
To: Rules Users List
Subject: Re: [rules-users] Starting engine using fireUntilHalt and inserting
no facts results in 50% CPU usage
Do you have a solution/patch for it?
Edson
2010/10/25 mardo <mardo(a)abicola.de>:
Luckily just stumbled upon this mail...
You can take a look at
http://drools-java-rules-engine.46999.n3.nabble.com/fireUntilHalt-and-OSGi-C
PU-load-td1022352.html
where I already provided a minimal example (don't know if it covers all
cases) and tracked it down to missedNotifyAll in DefaultAgenda
cheers
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Montag, 25. Oktober 2010 21:17
To: Rules Users List
Subject: Re: [rules-users] Starting engine using fireUntilHalt and
inserting
no facts results in 50% CPU usage
This is clearly a regression as Drools should be not be using busy
waits in fireUntilHalt(). It should use monitors and locks as it was
doing before.
Can anyone open a JIRA? also, if anyone would be willing to take
investigate and fix this one, it would really help. Otherwise, I will
add it to my queue.
Thanks,
Edson
2010/10/25 Norman C <rent_my_time(a)yahoo.com>:
Note that the 100% CPU issue with fireUntiHalt is only with the 5.1
version of
Drools. In 5.0.x, CPU is close to 0% when there are no rules to fire. I
saw
this when I was testing upgrading to 5.1.
Norman
----- Original Message ----
From: jschmied <nabble(a)juergenschmied.de>
To: rules-users(a)lists.jboss.org
Sent: Sun, October 24, 2010 4:06:02 AM
Subject: Re: [rules-users] Starting engine using fireUntilHalt and
inserting no
facts results in 50% CPU usage
Hi!
fireUntilHalt uses one processor with 100%. You have a dualcore, so it's
50%. It's by design like this.
You can:
- Call fireAllRules after every insert if you have no ruleflow.
- Use fireAllRules in a loop with a small sleep and check for the end of
the
ruleflow in the loop:
while (prc.getState() == ProcessInstance.STATE_ACTIVE) {
Threads.sleep(20);
ksession.fireAllRules();
}
with both methods you get a low cpu load.
bye
juergen
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Starting-engine-using-fi
reUntilHalt-and-inserting-no-facts-results-in-50-CPU-usage-tp1760370p1761821
.html
Sent from the Drools - User mailing list archive at Nabble.com.
_______________________________________________
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
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
_______________________________________________
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
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
_______________________________________________
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
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
13 years, 8 months
[Urgent] Error in ontext assist in DSLR Editor
by hamza bakkali
Hi All,
I have been using drools 4 for couple of months now and I am starting to get
the hang of it. We recently decided to move to Dools 5 with Eclipse 3.4.2
(Ganymede).
We unfortunately hit a major 'show stopper' (for us). In the DSLR editor:
Context Assist + space + enter removes/replaces the whole line, not only the
place holder.
In other words:
DSL:
[*][]Log : {msg}=System.out.println("{msg}");
[*][]id1="some id label"
DSLR:
rule "MyRule"
when
then
end
If I Press L , control space --> the line Log:{msg} appears in the context
menu. Hit enter I get
Log :{msg}
Now, If want to replace msg by id1. I position the cursor in the {msg}, hit
ctrl space, id1 shows in the list. I hit enter the whole line disappear, and
I am left with
id1
instead of
Log : id1
Is this a setting somewhere in eclipse itself?? I doubt it.
The same thing use to work as expected in Drools 4.
thanks.
13 years, 8 months
Drools Execution Server - SOAP Support / XML Format
by Miguel Fernando Cabrera
Hello to all,
Right now I am testing Drools Execution Server 5.1.1
I already made it work with Jboss and ran the test using the restful
interface (I used the Poster firefox extension).
Now I was checking if I could create a SOAP Service. On the documentation
is not even mentioned [1] . So I kept looking. On the Weblog of Lucas
Amador, I found this article[2] (it was written some months ago but compared
to the documentation it looks updated) and it says:
"If you want to have SOAP support, you need to create your custom Drools
Policy." (Whathever that means).
However, I see some example of Soap endpoint "out-of-the-box" in this post
of Salaboy [3]. I tried to reproduce those configuration but I failed to do
so because it on the webpage showing the available services
(in my case http://localhost:8080/drools-5.1.1-server/kservice/ ) the Soap
endpoint never shows up.
Here is the camel-server.xml (http://pastebin.com/Hf0yvNHQ) and the
knowledge-services.xml (http://pastebin.com/jqrUS9aK). They are both very
basic, they are small modification to the default ones.
So, rounding up, my question is, does Drools Execution Server 5.1.1 supports
Soap endpoints? if so, based on the configuration files what am I doing
wrong?
And additional question is, where I can find the XML serialization format.
For example, when using the test that comes with drools-server (REST end
point) I sent the following xml:
<batch-execution lookup="ksession1">
<insert out-identifier="person1" return-object="true">
*<org.test.Message>*
* <text>Wepaje</text>*
* </org.test.Message*>
</insert>
</batch-execution>
What if for example org.test.Message contains other complex object (with
properties and so on). How the XML should look like?
Thanks in advance for your help
[1]
http://downloads.jboss.com/drools/docs/5.1.1.34858.FINAL/drools-integrati...
[2]
http://lucazamador.wordpress.com/2010/07/20/drools-server-configuration-u...
[3]
http://salaboy.wordpress.com/2010/11/24/drools-server-drools-grid-for-rem...
--
Miguel Fernando Cabrera Granados
http://mfcabrera.com
"A los hombres fuertes les pasa lo que a los barriletes; se elevan cuando es
mayor el viento que se opone a su ascenso." - José Ingenieros
13 years, 8 months
Drools planner & Scala
by Adam Warski
Hello,
I'm using Planner in a Scala program and it almost works without problems; the only one is in implementing the Solution interface, as it uses raw (erased) version of Score, which is normally generic (Score<S extends Score>). Scala generally doesn't like raw types and in most cases it's impossible to extend/implement interfaces which use them. A work-around is to introduce an "adapter" in Java, which you can later extend in Scala:
public abstract class ScalaSolution implements Solution {
public Score getScore() { return getScoreScala(); }
public abstract Score<?> getScoreScala();
public void setScore(Score score) { setScoreScala(score); }
public abstract void setScoreScala(Score<?> score);
}
and then in Scala:
class Schedule(...) extends ScalaSolution {
var score: Score[_] = _
def setScoreScala(score: Score[_]) = { this.score = score }
def getScoreScala = score
...
}
So the fix is to replace the raw Score type with Score<?>. Maybe it would be possible to apply that in the code? I tried it locally and it compiles without problems.
And a side question: do you have any plans on implementing multithreading in planner? So that several moves could be explored concurrently? I saw there's an open Jira issue for some time, but it didn't have any timeframe information.
--
Adam Warski
http://www.warski.org
http://www.softwaremill.eu
13 years, 8 months
Re: [rules-users] How to modify changeset.xml in guvnor
by kenichiwa
Maybe this will clarify things....
For this code:
...
...
...
String urlString =
"http://localhost:9080/drools-guvnor/org.drools.guvnor.Guvnor/package/defa...";
URL url = new URL(urlString);
KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent("TestAgent");
UrlResource urlResource = (UrlResource)ResourceFactory.newUrlResource(url);
urlResource.setBasicAuthentication("enabled");
urlResource.setUsername("admin");
urlResource.setPassword("");
kagent.applyChangeSet(urlResource);
KnowledgeBase kbase = kagent.getKnowledgeBase();
...
...
...
I am getting this exception:
[12/3/10 15:54:58:059 MST] 0000001d SystemOut O [2010:12:337
15:12:59:debug] KnowledgeAgent building resource map
[12/3/10 15:54:58:059 MST] 0000001d SystemOut O [2010:12:337
15:12:59:info] KnowledgeAgent created, with configuration:
monitorChangeSetEvents=true scanResources=true scanDirectories=true
newInstance=true
[12/3/10 15:54:58:059 MST] 00000027 SystemOut O [2010:12:337
15:12:59:info] KnowledegAgent has started listening for ChangeSet
notifications
[12/3/10 15:54:58:090 MST] 0000001f SystemOut O INFO 03-12 15:54:58,074
(NilAuthenticator.java:authenticate:51) All users are guests.
[12/3/10 15:54:58:090 MST] 0000001f SystemOut O INFO 03-12 15:54:58,090
(RepositoryServlet.java:allowUser:129) admin authenticated for rest api
[12/3/10 15:54:58:090 MST] 0000001f SystemOut O INFO 03-12 15:54:58,090
(PackageDeploymentServlet.java:a:136) PackageName: defaultPackage
[12/3/10 15:54:58:090 MST] 0000001f SystemOut O INFO 03-12 15:54:58,090
(PackageDeploymentServlet.java:a:137) PackageVersion: LATEST
[12/3/10 15:54:58:090 MST] 0000001f SystemOut O INFO 03-12 15:54:58,090
(PackageDeploymentServlet.java:a:138) PackageIsLatest: true
[12/3/10 15:54:58:090 MST] 0000001f SystemOut O INFO 03-12 15:54:58,090
(PackageDeploymentServlet.java:a:139) PackageIsSource: false
[12/3/10 15:55:18:934 MST] 0000001d SystemOut O [2010:12:337
15:12:934:info] KnowledgeAgent applying ChangeSet
[12/3/10 15:55:18:934 MST] 0000001d SystemOut O [2010:12:337
15:12:934:debug] KnowledgeAgent notifier subscribing to
resource=[UrlResource
path='http://localhost:9080/drools-guvnor/org.drools.guvnor.Guvnor/package/defa...']
[12/3/10 15:55:18:934 MST] 0000001d SystemOut O [2010:12:337
15:12:934:debug] ResourceChangeNotification subscribing
listener=org.drools.agent.impl.KnowledgeAgentImpl@3cec3cec to
resource=[UrlResource
path='http://localhost:9080/drools-guvnor/org.drools.guvnor.Guvnor/package/defa...']
[12/3/10 15:55:18:949 MST] 0000001d SystemOut O [2010:12:337
15:12:949:debug] KnowledgeAgent rebuilding KnowledgeBase using ChangeSet
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O [2010:12:337
15:12:965:exception]
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O
java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:664)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:889)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:704)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:584)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:185)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:168)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
com.mycompany.myapp.test.controllers.TestDroolsController.testDrools(TestDroolsController.java:41)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
java.lang.reflect.Method.invoke(Method.java:600)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:471)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:408)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
[12/3/10 15:55:18:965 MST] 0000001d SystemOut O at
javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1661)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1595)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.ui.preauth.AbstractPreAuthenticatedProcessingFilter.doFilterHttp(AbstractPreAuthenticatedProcessingFilter.java:69)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:932)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:500)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O Caused by:
java.io.IOException: Server returned HTTP response code: 401 for URL:
http://localhost:9080/drools-guvnor/org.drools.guvnor.Guvnor/package/defa...
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1308)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.drools.io.impl.UrlResource.grabStream(UrlResource.java:210)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.drools.io.impl.UrlResource.getInputStream(UrlResource.java:146)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:652)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O ... 63 more
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O [2010:12:337
15:12:980:debug] KnowledgeAgent obtaining pkg resource=[UrlResource
path='http://localhost:9080/drools-guvnor/org.drools.guvnor.Guvnor/package/defa...']
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O [2010:12:337
15:12:980:exception]
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O
java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:914)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:704)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:584)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:185)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:168)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.mycompany.myapp.test.controllers.TestDroolsController.testDrools(TestDroolsController.java:41)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
java.lang.reflect.Method.invoke(Method.java:600)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:471)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:408)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:771)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
javax.servlet.http.HttpServlet.service(HttpServlet.java:718)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1661)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1595)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.ui.preauth.AbstractPreAuthenticatedProcessingFilter.doFilterHttp(AbstractPreAuthenticatedProcessingFilter.java:69)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:908)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:932)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:500)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:864)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:186)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:272)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O Caused by:
java.lang.NullPointerException
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O at
org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:906)
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O ... 62 more
[12/3/10 15:55:18:980 MST] 0000001d SystemOut O [2010:12:337
15:12:980:info] KnowledgeAgent new KnowledgeBase now built and in use
[12/3/10 15:55:18:996 MST] 0000001d SystemOut O [2010:12:337
15:12:996:debug] KnowledgeAgent finished rebuilding KnowledgeBase using
ChangeSet
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/How-to-modify-changes...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 8 months
Problem persisting human tasks
by raic
Hi,
I'm having problems using drools flow persistance with human tasks. I'm
using drools server.
On one hand, I have my test application, which starts a MinaTaskServer for
registering human tasks, and then, the application generates JSON commands
for executing a flow with human tasks on the execution server.
Without using flow persistence, this is working ok, i'm able to retrieve the
pending tasks and completing them without problems.
When I try to configure flow persistence on the execution server, i can
start the process, the tasks are registered ok and drools flow tables are
generated in my database (processinstanceinfo,sessioninfo,workiteminfo...)
with the correct flow information. The problem appears when i retrieve a
pending task, and then, i want to complete it. It seems that the
communication between MinaTaskServer and ExecutionServer is not ok.
The error i'm getting is the following:
[2010:11:327 18:11:661:debug] Message receieved on client :
EventTriggerResponse
[2010:11:327 18:11:661:debug] Arguments :
[org.drools.task.event.EventPayload@1b2df13]
Task completed 1
[2010:11:327 18:11:661:debug] Message receieved on client :
EventTriggerResponse
[2010:11:327 18:11:661:debug] Arguments :
[org.drools.task.event.EventPayload@1f7c6e1]
Task completed 1
[2010:11:327 18:11:770:debug] Message receieved on client : GetTaskResponse
[2010:11:327 18:11:770:debug] Arguments : [org.drools.task.Task@d17fbb51]
[2010:11:327 18:11:770:exception] Uncaught exception on client
java.lang.IllegalStateException: EntityManager is closed
at org.hibernate.ejb.EntityManagerImpl.getSession(EntityManagerImpl.java
:66)
at
org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:182)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:358)
at $Proxy132.find(Unknown Source)
at
org.drools.persistence.processinstance.JPAWorkItemManager.completeWorkItem(JPAWorkItemManager.java:88)
at
org.drools.process.workitem.wsht.WSHumanTaskHandler$GetCompletedTaskResponseHandler.execute(WSHumanTaskHandler.java:250)
at
org.drools.task.service.TaskClientHandler.messageReceived(TaskClientHandler.java:80)
at
org.drools.task.service.mina.MinaTaskClientHandler.messageReceived(MinaTaskClientHandler.java:47)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:713)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
at
org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:375)
at
org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:229)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:793)
at
org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
at
org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)
at
org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:638)
at
org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:598)
at
org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:587)
at
org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:61)
at
org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:969)
at
org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source
)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source)
at java.lang.Thread.run(Unknown Source)
And here is my configuration:
knowledge-services.xml (spring configuration)
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:drools="http://drools.org/schema/drools-spring"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://drools.org/schema/drools-spring
http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-containe...">
<bean id="ds"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/drools_flow" />
<property name="username" value="user" />
<property name="password" value="pass" />
</bean>
<drools:connection id="connection1" type="local" />
<drools:execution-node id="node1" connection="connection1" />
<drools:kbase id="kbProcessWorkItems" node="node1">
<drools:resources>
<drools:resource type="CHANGE_SET"
source="classpath:changeset.xml"/>
</drools:resources>
</drools:kbase>
<bean id="myEmf"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="ds" />
<property name="persistenceUnitName"
value="org.drools.persistence.jpa.local" />
</bean>
<bean id="txManager"
class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="myEmf" />
</bean>
<drools:kstore id="kstore1" />
<drools:ksession id="ksession1" type="stateful" kbase="kbProcessWorkItems"
node="node1">
<drools:configuration>
<drools:jpa-persistence>
<drools:transaction-manager ref="txManager" />
<drools:entity-manager-factory ref="myEmf" />
<drools:variable-persisters>
<drools:persister for-class="javax.persistence.Entity"
implementation="org.drools.persistence.processinstance.persisters.JPAVariablePersister"/>
</drools:variable-persisters>
</drools:jpa-persistence>
</drools:configuration>
</drools:ksession>
</beans>
And here my persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd
http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
<persistence-unit name="org.drools.persistence.jpa.local"
transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>org.drools.persistence.session.SessionInfo</class>
<class>org.drools.persistence.processinstance.ProcessInstanceInfo</class>
<class>org.drools.persistence.processinstance.WorkItemInfo</class>
<class>org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo</class>
<class>org.drools.persistence.processinstance.variabletypes.JPAPersistedVariable</class>
<!-- my persistent variables -->
<class>com.sample.bussiness.model.ClientModel</class>
<properties>
<property name="hibernate.dialect"
value="org.hibernate.dialect.MySQL5Dialect"/>
<property name="hibernate.max_fetch_depth" value="3" />
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="false" />
</properties>
</persistence-unit>
</persistence>
I've seen some examples that uses bitronix but i'm not using it, i don't
know if that is the problem...
Some ideas?
Thanks
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Problem-persisting-hu...
Sent from the Drools - User mailing list archive at Nabble.com.
13 years, 8 months