Drools flow web console (5.1.M1) deployment in JBoss
by satjo
Could some one share the experience in getting the Drools Flow 5.1 web
console working in JBoss?
I downloaded the “Standalone Guvnor with JBoss AS” (Drools 5.1.0.M1 Guvnor
Standalone) from the download site.
As it did not have the gwt-console war files
(gwt-console-server-drools-{version}.war and
gwt-console-drools-{version}.war) in the Standalone download, I built them
from source code and deployed in JBoss.
I uploaded a test rule flow in Guvnor’s default package and rebuilt the
package.
After log into gwt-console, when I click on process definition, I see a
HTTP 500 error ‘class com.google.gwt.http.client.RequestException', ‘ Could
not initialize stateful knowledge session: null’.
Any comments on the required steps for viewing the process definitions are
appreciated.
satjo
--
View this message in context: http://www.nabble.com/Drools-flow-web-console-%285.1.M1%29-deployment-in-...
Sent from the drools - user mailing list archive at Nabble.com.
15 years
ConcurrentModificationException during runtime at org.drools.reteoo.ClassObjectTypeConf.getMatchingObjectTypes
by karthizap
I am using Drools-core.jar(version-5.0.0.CR1) and getting the following
exception. I could see similar stacktrace reported with
JIRA-1888(https://jira.jboss.org/jira/browse/JBRULES-1888) and its marked as
closed. Fix related to this Jira is not available (Rete.java) in the Drools
5.0.1 and 5.1.0 source code/drools-core jar files.
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
entryPoints = Collections.synchronizedMap((Map<EntryPoint,
EntryPointNode>) in.readObject());
ruleBase = ((DroolsObjectInputStream)in).getRuleBase();
super.readExternal( in );
}
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:841)
at java.util.HashMap$ValueIterator.next(HashMap.java:871)
at
org.drools.reteoo.ClassObjectTypeConf.getMatchingObjectTypes(ClassObjectTypeConf.java:171)
at
org.drools.reteoo.ClassObjectTypeConf.getObjectTypeNodes(ClassObjectTypeConf.java:163)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:143)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1066)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1022)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:810)
Please let me know the correct fix for this problem.
--
View this message in context: http://old.nabble.com/ConcurrentModificationException-during-runtime-at-o...
Sent from the drools - user mailing list archive at Nabble.com.
15 years
MVEL and Maps
by Leonardo Gomes
Hello,
I'm feeding my working memory with Maps (unfortunately, this is a
requirement and I can't use beans).
To access the values in this maps I use the following MVEL expression :
Map ( this["airportCode"] == "GIG"
, this["numberOfPassengers"] > "1"
, this["class"] memberOf ("BUSINESS", "FIRST") )
And it works fine, except for dates where I get a ClassCastException,
even tough I'm using the right pattern:
Map ( this["departureDate"] > "07-Nov-2009" ) --- fails
Is there anything I need to do to make the dynamic cast of dates work,
in this particular case?
--
Morever, I get NPEs if there's no value for a given key. For example,
the expression Map ( this ["name"] == 'Leonardo' ) would fail if
there's no entry with "name" as the key.
Any help is welcome!
Thanks in advance,
Leo.
15 years
Inconsistent behavior between LHS and RHS ...
by Javier Vera Gomez
Hi,
I've been using drools 4.07 for a while. I have found a weird case. It
seems that when evaluating the LHS some fact is true but the RHS probes
it wasn't actually true.
The example code is at the end. It is very weird to me I have no clue
about how to solve this or what could be happening!
rule "A-Rule"
no-loop true
ruleflow-group "validate-task"
salience -9999999
when
>$task : Task( type == "Creacio_Profile_Radius" )
>eval($task.getParameter("PRIMARYDNS")==null)
then
>System.out.println(">>>DBGPar0:
"+$task.getTechnicalParams().get(0).getName());
>System.out.println(">>>DBGPar1:
"+$task.getTechnicalParams().get(1).getName());
>System.out.println("Getparam PRIMARYDNS:
"+$task.getParameter("PRIMARYDNS"));
end
further explanation:
The Task class has a List<Parameter> technicalParams, originally the
eval part was:
not(Parameter (name=="PRIMARYDNS") from $task.technicalParams())
it didn't work and I coded this "getParameter" method just to make some
tests. So, it seems the collection appears "empty" to the LHS but in
fact it isnt!
any clue?
thanks a lot,
Javier
15 years
Re: [rules-users] [droolsflow] Code-based constraints for EventWait nodes - is this possible?
by Alan.Gairey@tessella.com
Kris,
Thanks yes - the null check fixes the NPE I was seeing.
Unfortunately, I now have a more difficult problem. In my work item
handler, I use the following code to get the ID of a work item in the rule
flow (i.e. the .rf file itself) given a
org.drools.runtime.process.WorkItem instance:
private long getCurrentNodeId(WorkItem workItem) {
ProcessInstance processInstance =
ksession.getProcessInstance(workItem.getProcessInstanceId());
if (processInstance instanceof WorkflowProcessInstanceImpl) {
Collection<NodeInstance> nodeInstances =
((WorkflowProcessInstanceImpl) processInstance).getNodeInstances();
for (NodeInstance nodeInstance : nodeInstances) {
System.out.println(String.format("Node instance: %s",
nodeInstance));
if (nodeInstance instanceof WorkItemNodeInstance) {
WorkItemNodeInstance workItemNodeInstance =
(WorkItemNodeInstance) nodeInstance;
if (workItemNodeInstance.getWorkItem() == workItem) {
return workItemNodeInstance.getNodeId();
}
}
}
}
throw new RuntimeException(String.format("Error determining node
ID for work item: %s", workItem.toString()));
}
The work item in the attached test case, the first time it executes sets a
property on a fact in memory that causes a subsequent Split node to send
the flow to an Event Wait. The code in the overall main() method (in
PersistenceTest.java) then updates the fact in memory so that the Event
Wait's constraint is satisfied, and the work item node is executed again.
The second time around, it sets the property on the fact in memory so that
the subsequent Split node sends the flow to its end. (I hope this makes
sense; looking at the rule flow in the test case should show you what I'm
trying to do.)
If I execute the test case with my session created using the code:
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
everything works as I would expect, and the output from the
System.out.println() statement in my getCurrentNodeId() method above is:
Node instance:
org.drools.workflow.instance.node.WorkItemNodeInstance@125d568
Node instance:
org.drools.workflow.instance.node.WorkItemNodeInstance@37a04c
However, if I use JPA persistence:
StatefulKnowledgeSession ksession =
JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
then the RuntimeException in getCurrentNodeId() is thrown, and the output
is:
Node instance:
org.drools.workflow.instance.node.WorkItemNodeInstance@2209db
Node instance:
org.drools.workflow.instance.node.MilestoneNodeInstance@d8fd1a
Somehow it seems as though the node instance isn't quite synchronised with
the overall state when using JPA persistence.
Any help you could give me here would be very much appreciated.
Regards,
Alan
Kris Verlaenen <kris.verlaenen(a)cs.kuleuven.be>
30/10/2009 20:10
To
Alan.Gairey(a)tessella.com
cc
Subject
Re: [rules-users] [droolsflow] Code-based constraints for EventWait nodes
- is this possible?
Alan,
Thanks, this indeed seems to be the issue. I have changed this on
trunk. Does adding this null check solve your issue?
Thx,
Kris
Quoting Alan.Gairey(a)tessella.com:
> Kris,
>
> Some more information: the NullPointerException from GetObjectCommand
> is
> thrown by the line:
>
>
>
((StatefulKnowledgeSessionImpl)ksession).session.getExecutionResult().getResults().put(
>
> this.outIdentifier,
> object );
>
> Method getExecutionResult() is returning null. Debugging my test
> case, I
> also notice that this.outIdentifier is also null.
>
> I then had a look at the GetObjectsCommand class; in its execute
> method,
> there is a line similar to that above. However, it is contained
> within an
> if block that checks this.outIdentifier is not null:
>
> if ( this.outIdentifier != null ) {
> List objects = new ArrayList( col );
>
>
>
((StatefulKnowledgeSessionImpl)ksession).session.getExecutionResult().getResults().put(
>
> this.outIdentifier, objects );
> }
>
> If something similar was done in GetObjectCommand, presumably this
> would
> fix my problem?
>
> Hope this is of some use - regards,
>
> Alan
>
>
>
>
> Alan.Gairey(a)tessella.com
> Sent by: rules-users-bounces(a)lists.jboss.org
> 29/10/2009 17:35
> Please respond to
> Rules Users List <rules-users(a)lists.jboss.org>
>
>
> To
> Kris Verlaenen <kris.verlaenen(a)cs.kuleuven.be>
> cc
> Rules Users List <rules-users(a)lists.jboss.org>
> Subject
> Re: [rules-users] [droolsflow] Code-based constraints for EventWait
> nodes
> - is this possible?
>
>
>
>
>
>
>
> Kris,
>
> Thanks - making the class SimpleFact serializable fixed that error.
>
> However, I now have a new problem: I have a rule flow containing a
> work
> item - the handler attempts to update the SimpleFact instance in
> memory
> before completing the task. The code in the executeWorkItem method is
> as
> follows:
>
> Collection<FactHandle> factHandles =
> ksession.getFactHandles(new
> ObjectFilter() {
> public boolean accept(Object object) {
> return (object instanceof SimpleFact);
> }
> });
> for (Iterator<FactHandle> iterator = factHandles.iterator();
>
> iterator.hasNext(); ) {
> FactHandle factHandle = iterator.next();
> SimpleFact fact = (SimpleFact)
> ksession.getObject(factHandle);
>
> fact.setStatus("Error");
> ksession.update(factHandle, fact);
> }
>
> workItemManager.completeWorkItem(workItem.getId(), null);
>
> The call to getObject() causes the following exception to be thrown:
>
>
> java.lang.NullPointerException
> at
>
org.drools.command.runtime.rule.GetObjectCommand.execute(GetObjectCommand.java:35)
>
>
> at
>
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:254)
>
>
> at
>
org.drools.command.impl.CommandBasedStatefulKnowledgeSession.getObject(CommandBasedStatefulKnowledgeSession.java:369)
>
>
> at
>
com.test.StatusChangeWorkItemHandler.executeWorkItem(StatusChangeWorkItemHandler.java:37)
>
>
> ...
>
> I've attached another test case to illustrate the problem.
>
>
>
> Once again, my sincere thanks for helping me with this.
>
> Regards,
>
> Alan
>
>
>
> Kris Verlaenen <kris.verlaenen(a)cs.kuleuven.be>
> 29/10/2009 12:00
>
>
> To
> Alan.Gairey(a)tessella.com
> cc
> Rules Users List <rules-users(a)lists.jboss.org>
> Subject
> Re: [rules-users] [droolsflow] Code-based constraints for EventWait
> nodes
> - is this possible?
>
>
>
>
>
>
>
>
> Alan,
>
> The cause of the rollback of the transaction is this:
> Caused by: java.io.NotSerializableException: com.test.SimpleFact
>
> The reason is that, if you use persistence for your session, the
> persister will try to save all runtime state of the engine. This
> does
> not only include process instances, but also rule-related state. By
> default, this also includes the data inserted in the memory. We
> support
> two strategies for storing this data: serialization of the data
> (default) or JPA-based storage of entities (by reference). In this
> case, the persister is trying to serialize the test object you
> inserted
> and fails. Making it serializable should fix this.
>
> Kris
>
> Quoting Alan.Gairey(a)tessella.com:
>
> > Kris,
> >
> > I've attached a simple test case (transaction manager, data
> source,
> > etc.
> > are configured via Spring). The error is thrown on line:
> >
> > ksession.insert(new SimpleFact());
> >
> > If this line is commented out, the rule flow executes without
> error.
> >
> >
> >
> > Many thanks for looking at this.
> >
> > Regards,
> >
> > Alan
> >
> >
> >
> >
> > Kris Verlaenen <kris.verlaenen(a)cs.kuleuven.be>
> > 28/10/2009 10:40
> >
> > To
> > Alan.Gairey(a)tessella.com
> > cc
> > Rules Users List <rules-users(a)lists.jboss.org>
> > Subject
> > Re: [rules-users] [droolsflow] Code-based constraints for
> EventWait
> > nodes
> > - is this possible?
> >
> >
> >
> >
> >
> >
> > Alan,
> >
> > Could you send me the entire output / stack trace (as the rollback
> > of
> > the transaction is usually caused by another exception)?
> >
> > Or a simple test case that shows the error, so I can take a look?
> >
> > Thx,
> > Kris
> >
> > Quoting Alan.Gairey(a)tessella.com:
> >
> > > Kris,
> > >
> > > After posting my last question, I quickly came to the same
> > conclusion
> > > as
> > > you, so I'm now using a rule-based constraint in my EventWait
> > node.
> > >
> > > This however has presented a different problem. If I create my
> > > session
> > > from JPAKnowledgeService, then when I try to insert my fact into
> > the
> > >
> > > session, I get the following error:
> > >
> > > bitronix.tm.internal.BitronixRollbackException: transaction was
> > > marked as
> > > rollback only and has been rolled back
> > > at
> > >
> >
> bitronix.tm.BitronixTransaction.commit(BitronixTransaction.java:153)
> > > at
> > >
> >
>
bitronix.tm.BitronixTransactionManager.commit(BitronixTransactionManager.java:96)
> > > at
> > >
> >
>
org.drools.persistence.session.SingleSessionCommandService.execute(SingleSessionCommandService.java:258)
> > > at
> > >
> >
>
org.drools.command.impl.CommandBasedStatefulKnowledgeSession.insert(CommandBasedStatefulKnowledgeSession.java:305)
> > > (Everything works fine if I create my session from the knowledge
> > base
> > > -
> > > i.e. with no state persistence.)
> > > Prior to using a rule-based constraint (with no call to
> > > CommandBasedStatefulKnowledgeSession.insert), the session
> created
> > > from
> > > JPAKnowledgeService worked OK.
> > > I'm using the default JPA configuration from the Drools
> > documentation
> > >
> > > (persisting to H2 database, etc.).
> > > Any ideas what might be causing the problem?
> > > Many thanks,
> > > Alan
> > >
> > >
> > >
> > >
> > > Kris Verlaenen <kris.verlaenen(a)cs.kuleuven.be>
> > > 23/10/2009 03:00
> > >
> > > To
> > > Rules Users List <rules-users(a)lists.jboss.org>,
> > > Alan.Gairey(a)tessella.com
> > > cc
> > > Rules Users List <rules-users(a)lists.jboss.org>
> > > Subject
> > > Re: [rules-users] [droolsflow] Code-based constraints for
> > EventWait
> > > nodes
> > > - is this possible?
> > >
> > >
> > >
> > >
> > >
> > >
> > > No, the constraint of an EventWait node (or the State node in
> > Drools
> > > 5.1) can only be rule-based. The reason for this is that the
> rule
> > > engine knows when to re-evaluates rules (based on the evailable
> > > input).
> > > If you would use a code-based constraint, the engine would have
> > no
> > > idea
> > > when this code constraint might become true (if it was false at
> > the
> > > start). Only constant re-evaluation of the code constraint
> could
> > > achieve this (which would be tremendously inefficient). Could
> you
> > > explain why you would like to have this behaviour? Maybe there
> is
> > > an
> > > alternative way to model this.
> > >
> > > To change the value of a variable from inside the process (using
> > an
> > > action), simply use kcontext.setVariable(name, value). We do
> not
> > > recommend manually changing the value of a process variable from
> > > outside
> > > the engine. Again, could you explain why you would like to have
> > > this
> > > functionality?
> > >
> > > Kris
> > >
> > > Quoting Alan.Gairey(a)tessella.com:
> > >
> > > > Can the constraint for an EventWait node in a flow be
> code-based
> > > > (rather
> > > > than rule-based)? The Eclipse plug-in (v 5.0.1) doesn't allow
> > this
> > > to
> > > > be
> > > > specified, unlike say for a Split node, although the relevant
> > XML
> > > can
> > > > of
> > > > course be edited.
> > > > Trying to load such a process flow results in a
> > > NullPointerException,
> > > >
> > > > because the constraint is always interpreted as a rule.
> > > >
> > > > Ideally what I'd like to do is have an EventWait node where
> the
> > > > constraint
> > > > tests the value of a process variable. This then leads me to
> > > another
> > > >
> > > > question; is there a way of setting the value of a process
> > > variable
> > > > via
> > > > the Drools Flow API?
> > > >
> > > > Thanks in advance for any help,
> > > >
> > > > Alan
> > > > Tessella plc
> > > > 26 The Quadrant, Abingdon Science Park, Abingdon, Oxfordshire,
> > > OX14
> > > > 3YS
> > > > E: Alan.Gairey(a)tessella.com, T: +44 (0)1235 555511, F: +44
> > (0)1235
> > > > 553301
> > > > www.tessella.com Registered in England No. 1466429
> > > >
> > > > This message is commercial in confidence and may be
> privileged.
> > It
> > > is
> > > >
> > > > intended for the addressee(s) only. Access to this message by
> > > anyone
> > > > else
> > > > is unauthorized and strictly prohibited. If you have received
> > this
> > > > message
> > > > in error, please inform the sender immediately. Please note
> that
> > > > messages
> > > > sent or received by the Tessella e-mail system may be
> monitored
> > > and
> > > > stored
> > > > in an information retrieval system.
> > > >
> > >
> > >
> > >
> > >
> > > Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
> > >
> > >
> >
> >
> >
> >
> > Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
> >
> >
>
>
>
>
> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
> [attachment "drools-persistence-test.zip" deleted by Alan
> Gairey/Tessella]
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
15 years
Fusion [Error]- java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be cast to org.drools.common.EventFactHandle
by Chetan Mahadev
Hi I am getting the following error while inserting into the entrypoint.
rule "Check if EligibleAlert is an Signature Event"
agenda-group "enrichment"
auto-focus true
no-loop true
when
$list : EventSignatureList();
$p : EligibleAlert($a : alert, $a.eventSignatureProcessingStatus!="TRUE"
);
eval((ifMatchesSyslog($list.getAllSyslogMnemonics(), $a)!=null) )
then
try{
WorkingMemoryEntryPoint eventsignaturestream =
drools.getEntryPoint("EVENT SIGNATURE STREAM") ;
eventsignaturestream.insert($p);
} catch(Exception e)
{
log.error("[EventSignatureRules] - exception in Check if
EligibleAlert is an Signature Event alert[ids=" + $p.getAlert().getId() +
"][error:" + e.toString() + "]");
}
end
And I am creating the session this way:
*
knowledgeBaseConfig =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
knowledgeBaseConfig.setOption( EventProcessingOption.STREAM );
kBase = KnowledgeBaseFactory.newKnowledgeBase( knowledgeBaseConfig
);
kBase.addKnowledgePackages(knowledgeBuilder.getKnowledgePackages());
KnowledgeSessionConfiguration knowledgeSessionConfig =
KnowledgeBaseFactory.newKnowledgeSessionConfiguration();
((SessionConfiguration) knowledgeSessionConfig).setClockType(
ClockType.REALTIME_CLOCK );
kBase.newStatefulKnowledgeSession(knowledgeSessionConfig,null);*
I get the Following error when my rule fires:
2009-11-09 15:02:00,675 FATAL pool-2-thread-1 LogStream -
java.lang.ClassCastException: org.drools.common.DefaultFactHandle cannot be
cast to org.drools.common.EventFactHandle
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.base.evaluators.AfterEvaluatorDefinition$AfterEvaluator.evaluateCachedRight(AfterEvaluatorDefinition.java:321)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.rule.VariableRestriction.isAllowedCachedRight(VariableRestriction.java:116)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.rule.VariableConstraint.isAllowedCachedRight(VariableConstraint.java:112)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.common.DefaultBetaConstraints.isAllowedCachedRight(DefaultBetaConstraints.java:200)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.reteoo.JoinNode.assertObject(JoinNode.java:172)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:42)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.reteoo.PropagationQueuingNode$AssertAction.execute(PropagationQueuingNode.java:326)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.reteoo.PropagationQueuingNode.propagateActions(PropagationQueuingNode.java:221)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.reteoo.PropagationQueuingNode$PropagateAction.execute(PropagationQueuingNode.java:394)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1486)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:158)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:122)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
pnoc.alertProcessor.Rule_Check_if_EligibleAlert_is_an_Signature_Event_0.consequence(Rule_Check_if_EligibleAlert_is_an_Signature_Event_0.java:16)
2009-11-09 15:02:00,676 FATAL pool-2-thread-1 LogStream - at
pnoc.alertProcessor.Rule_Check_if_EligibleAlert_is_an_Signature_Event_0ConsequenceInvoker.evaluate(Rule_Check_if_EligibleAlert_is_an_Signature_Event_0ConsequenceInvoker.java:24)
Pls help!
Regds
Chetan
15 years
Drools Flow : Persistence :- Getting Null Pointer Exception in JPAWorkItemManager.java
by Pardeep.Ruhil@lntinfotech.com
Hi,
When I try to run a sample test case using drools-persistence.jar it works
successfully.
But when I try to include the persistence in my OFBiz application, I am
getting null pointer exception in class JPAWorkItemManager.java.
java.lang.NullPointerException
at
org.drools.persistence.processinstance.JPAWorkItemManager.completeWorkItem(
JPAWorkItemManager.java:85).
Null Pointer is because of getting EntityManager object as NULL. In the
below line of JPAWorkItemManager.java
EntityManager em = (EntityManager) this.workingMemory
.getEnvironment().get( EnvironmentName.ENTITY_MANAGER );
the em is null.
Because of this I am getting Null Pointer exception when it try to run the
code
if (workItemInfo == null) {
workItemInfo = em.find(WorkItemInfo.class, id);
}
Can you tell me why I getting NPE when I try to run the jar file in my
application.
While the code run successfully when I try to run sample test case for
that.
Please help me to get through the situation.
Thanks & Regards
Pardeep Ruhil
L&T Infotech Ltd
Mumbai
Ph: +919820283884
Larsen & Toubro Infotech Ltd.
www.Lntinfotech.com
This Document is classified as:
L&T Infotech Proprietary L&T Infotech Confidential L&T Infotech
Internal Use Only L&T Infotech General Business
This Email may contain confidential or privileged information for the
intended recipient (s) If you are not the intended recipient, please do
not use or disseminate the information, notify the sender and delete it
from your system.
______________________________________________________________________
15 years
Mvel and multithreading
by Grigoriev, Grigoriy
Hello,
I have a project, that uses Drools 5.0.1. I have a class, called RuleFlowProcessor, that's used to apply some of my rules to the objects.
The instances of RuleFlowProcessor with the identical configuration should be used by different threads, and i use following mechanism:
I initialize one instance of RuleFlowProcessor, and the threads take copy of this instance, calling the 'clone()' method, which is not synchronized, and in which I just create new instance of
RuleFlowProcessor and init it, using the same data.
And therefore I get an exception:
Exception in thread "Thread-91" [Error: incomplete statement: (possible use of reserved keyword as identifier: )]
[Near : {... globals != empt ....}]
^
[Line: 0, Column: 0]
at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:153)
at org.mvel2.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:44)
at org.mvel2.MVEL.eval(MVEL.java:514)
although, all the resources (.drl and .rf files) are parsed perfectly, when I use just one thread.
In actions of my ruleflow, the dialect: 'mvel' was set by default, if I set dialect to 'java' without modifying any code, the error doesn't occur.
The full stacktrace is in attach. I can send the project, that reproduces the problem, if needed.
Best regards,
Grigoriy Grigoriev.
15 years
Re: [rules-users] Fwd: Build package 'default' Guvnor
by Eugenio Abello
Dear satjo, if you try it but I had no success. This step carry out:
1) Create the files users.properties, roles.properties in \drools-5.1.0.M1-
guvnor-standalone\jboss-4.2.3.GA <http://jboss-4.2.3.ga/>\server\default\conf.
also create the file 'testDS1-ds.xml' in \default\deploy
2) Create 'default' package in Guvnor, http://localhost:8080/drools-guvnor
,
user=krisv , pass= mypassword. OK
3) From eclipse add hellow_world.rf to Guvnor to 'default' package, OK
4) Build package 'default' , THE FOLLOWING delivery errors:
2009-10-28 11:18:43,859 INFO [STDOUT] DEBUG 28-10 11:18:43,859
(ServiceImplementation.java:loadRuleAsset:495) Package: default, asset:
hellow_world. Load time taken for asset: 906
2009-10-28 11:19:04,843 INFO [STDOUT] ERROR 28-10 11:19:04,843
(RepositoryServiceServlet.java:doUnexpectedFailure:76)
java.lang.NullPointerException
2009-10-28 11:19:04,843 ERROR [STDERR]
com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public
abstract org.drools.guvnor.client.rpc.BuilderResult[]
org.drools.guvnor.client.rpc.RepositoryService.buildPackage(java.lang.String,java.lang.String,boolean)
throws com.google.gwt.user.client.rpc.SerializableException' threw an
unexpected exception: java.lang.NullPointerException
2009-10-28 11:19:04,843 ERROR [STDERR] at
com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
2009-10-28 11:19:04,843 ERROR [STDERR] at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
2009-10-28 11:19:04,843 ERROR [STDERR] at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:164)
2009-10-28 11:19:04,843 ERROR [STDERR] at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
2009-10-28 11:19:04,843 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
2009-10-28 11:19:04,843 ERROR [STDERR] at
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:53)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
2009-10-28 11:19:04,843 ERROR [STDERR] at
java.lang.Thread.run(Thread.java:619)
2009-10-28 11:19:04,843 ERROR [STDERR] Caused by:
java.lang.NullPointerException
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.drools.compiler.ProcessBuilder.buildProcess(ProcessBuilder.java:118)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.drools.compiler.ProcessBuilder.addProcessFromFile(ProcessBuilder.java:222)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:468)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.drools.compiler.PackageBuilder.addRuleFlow(PackageBuilder.java:440)
2009-10-28 11:19:04,843 ERROR [STDERR] at org.drools.guvnor
.server.contenthandler.RuleFlowHandler.compile(RuleFlowHandler.java:167)
2009-10-28 11:19:04,843 ERROR [STDERR] at org.drools.guvnor
.server.builder.ContentPackageAssembler.buildAsset(ContentPackageAssembler.java:197)
2009-10-28 11:19:04,843 ERROR [STDERR] at org.drools.guvnor
.server.builder.ContentPackageAssembler.buildPackage(ContentPackageAssembler.java:184)
2009-10-28 11:19:04,843 ERROR [STDERR] at org.drools.guvnor
.server.builder.ContentPackageAssembler.<init>(ContentPackageAssembler.java:104)
2009-10-28 11:19:04,843 ERROR [STDERR] at org.drools.guvnor
.server.builder.ContentPackageAssembler.<init>(ContentPackageAssembler.java:117)
2009-10-28 11:19:04,843 ERROR [STDERR] at org.drools.guvnor
.server.ServiceImplementation.buildPackage(ServiceImplementation.java:1434)
2009-10-28 11:19:04,843 ERROR [STDERR] at org.drools.guvnor
.server.ServiceImplementation.buildPackage(ServiceImplementation.java:1415)
2009-10-28 11:19:04,843 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2009-10-28 11:19:04,843 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
2009-10-28 11:19:04,843 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2009-10-28 11:19:04,843 ERROR [STDERR] at
java.lang.reflect.Method.invoke(Method.java:597)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
2009-10-28 11:19:04,843 ERROR [STDERR] at
org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
2009-10-28 11:19:04,859 ERROR [STDERR] at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
2009-10-28 11:19:04,859 ERROR [STDERR] at
org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:157)
2009-10-28 11:19:04,859 ERROR [STDERR] at
org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
2009-10-28 11:19:04,859 ERROR [STDERR] at
org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
2009-10-28 11:19:04,859 ERROR [STDERR] at
org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
2009-10-28 11:19:04,859 ERROR [STDERR] at
org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
2009-10-28 11:19:04,859 ERROR [STDERR] at org.drools.guvnor
.server.ServiceImplementation_$$_javassist_7.buildPackage(ServiceImplementation_$$_javassist_7.java)
2009-10-28 11:19:04,859 ERROR [STDERR] at org.drools.guvnor
.server.RepositoryServiceServlet.buildPackage(RepositoryServiceServlet.java:206)
2009-10-28 11:19:04,859 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2009-10-28 11:19:04,859 ERROR [STDERR] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
2009-10-28 11:19:04,859 ERROR [STDERR] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2009-10-28 11:19:04,859 ERROR [STDERR] at
java.lang.reflect.Method.invoke(Method.java:597)
2009-10-28 11:19:04,859 ERROR [STDERR] at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
2009-10-28 11:19:04,859 ERROR [STDERR] ... 27 more
Thanks
> You need to create a new 'default' package (i.e, not the 'defauktPackage'
> that comes with Guvnor) and upload your ruleflow.
>
>
>
> Eugenio Abello wrote:
> >
> > Dear, I made new tests, and also fails to 'defaultPackage'. This made:
> >
> > 1) Create the files users.properties, roles.properties in
> > \drools-5.1.0.M1-
> > guvnor-standalone\jboss-4.2.3.GA
> > <http://jboss-4.2.3.ga/>\server\default\conf.
> >
> > also create the file 'testDS1-ds.xml' in \default\deploy
> >
> > 2) Start the jboss.
> >
> > 3) http://localhost:8080/
> > <http://localhost:8080/drools-guvnor>drools<
> http://localhost:8080/drools-guvnor>
> > -
> > <http://localhost:8080/drools-guvnor><
> http://localhost:8080/drools-guvnor>
> > guvnor <http://localhost:8080/drools-guvnor>. when he asks "This looks
> > like
> > a brand new repository. Would you like to install a sample repository?"
> I
> > respond "No thanks"
> >
> > 4) From eclipse add hellow_world.rf to Guvnor to 'defaultPackage'
> package,
> > OK
> >
> > 5) Build package 'default' , and delivers the same error:
> >
> >
> > 2009-11-03 12:22:47,765 DEBUG [com.arjuna.ats.jta.logging.loggerI18N]
> > [com.arjuna.ats.internal.jta.recovery.info.secondpass] Local
> > XARecoveryModule - second pass
> > 2009-11-03 12:24:05,031 INFO [STDOUT] ERROR 03-11 12:24:05,031
> > (RepositoryServiceServlet.java:doUnexpectedFailure:76)
> > java.lang.NullPointerException
> > 2009-11-03 12:24:05,031 ERROR [STDERR]
> > com.google.gwt.user.server.rpc.UnexpectedException: Service method
> 'public
> > abstract org.drools.guvnor.client.rpc.BuilderResult[]
> >
> org.drools.guvnor.client.rpc.RepositoryService.buildPackage(java.lang.String,java.lang.String,boolean)
> > throws com.google.gwt.user.client.rpc.SerializableException' threw an
> > unexpected exception: java.lang.NullPointerException
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:164)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > org.jboss.seam.web.ContextFilter$1.process(ContextFilter.java:42)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.seam.servlet.ContextualHttpServletRequest.run(ContextualHttpServletRequest.java:53)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > org.jboss.seam.web.ContextFilter.doFilter(ContextFilter.java:37)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > java.lang.Thread.run(Thread.java:619)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] Caused by:
> > java.lang.NullPointerException
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > org.drools.compiler.ProcessBuilder.buildProcess(ProcessBuilder.java:118)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.drools.compiler.ProcessBuilder.addProcessFromFile(ProcessBuilder.java:222)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:468)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > org.drools.compiler.PackageBuilder.addRuleFlow(PackageBuilder.java:440)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.drools.guvnor.server.contenthandler.RuleFlowHandler.compile(RuleFlowHandler.java:167)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.drools.guvnor.server.builder.ContentPackageAssembler.buildAsset(ContentPackageAssembler.java:197)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.drools.guvnor.server.builder.ContentPackageAssembler.buildPackage(ContentPackageAssembler.java:184)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.drools.guvnor.server.builder.ContentPackageAssembler.<init>(ContentPackageAssembler.java:104)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.drools.guvnor.server.builder.ContentPackageAssembler.<init>(ContentPackageAssembler.java:117)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.drools.guvnor.server.ServiceImplementation.buildPackage(ServiceImplementation.java:1434)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.drools.guvnor.server.ServiceImplementation.buildPackage(ServiceImplementation.java:1415)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > java.lang.reflect.Method.invoke(Method.java:597)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:77)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.seam.security.SecurityInterceptor.aroundInvoke(SecurityInterceptor.java:157)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.drools.guvnor.server.ServiceImplementation_$$_javassist_3.buildPackage(ServiceImplementation_$$_javassist_3.java)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> org.drools.guvnor.server.RepositoryServiceServlet.buildPackage(RepositoryServiceServlet.java:206)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > java.lang.reflect.Method.invoke(Method.java:597)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] at
> > com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:527)
> > 2009-11-03 12:24:05,031 ERROR [STDERR] ... 27 more
> > 2009-11-03 12:24:47,765 DEBUG [com.arjuna.ats.arjuna.logging.arjLogger]
> > Periodic recovery - first pass <mar, 3 nov 2009 12:24:47>
> >
> > Thn
> > Kris
> >
> >
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Fwd%3A-Build-package-%27default%27-Guvnor-tp2618193...
> Sent from the drools - user mailing list archive at Nabble.com.
>
>
>
> ------------------------------
>
> Message: 3
> Date: Sat, 7 Nov 2009 20:19:22 -0800
> From: Wishing Carebear <wishing.carebear(a)gmail.com>
> Subject: [rules-users] some pointers for solution
> To: rules-users(a)lists.jboss.org
> Message-ID:
> <27407ce90911072019s6f348333je82e4908b108dd21(a)mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hello:
> There are n selection criteria from s1 .. sn for each item i1.. in. Each
> item can have a subset of criteria which applies to them.
>
> The end user, can choose a subset of criteria like c1 and c5 and only the
> item that has c1 and c5 valid should be returned. For example: if item i1
> and i2 have criterias valid for c1, c2, c5, c6, c8 since the request is
> only
> for criteria c1 and c5, i1 and i2 must be returned.
>
> Is it possible to write a rule using drools for this requirement.
>
> Thanks for your help and time,
> cabear
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.jboss.org/pipermail/rules-users/attachments/20091107/4e5daaf...
>
> ------------------------------
>
> Message: 4
> Date: Sun, 8 Nov 2009 01:08:22 -0800 (PST)
> From: Greg Barton <greg_barton(a)yahoo.com>
> Subject: Re: [rules-users] some pointers for solution
> To: Rules Users List <rules-users(a)lists.jboss.org>
> Message-ID: <252810.954.qm(a)web81508.mail.mud.yahoo.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> There are a couple of ways to do this. I'm sure there's a bit more clean
> way than the example I'm providing, but this should get you in the right
> direction. It's not 100% rules, because it involves a bit of java
> collections trickery. (See attached project,
> collection_DroolsCriteriaMatch.tar.gz)
>
> The heart of it is a single rule:
>
> rule "Match"
> when
> d : Data()
> q : Query( size <= d.size )
> Number( intValue == q.size )
> from accumulate(
> Criteria( this memberOf d, this memberOf q ),
> init( int total = 0; ),
> action( total ++; ),
> reverse( total --; ),
> result( total )
> )
> then
> System.out.println("Match: " + d + " and " + q) ;
> end
>
> The Data object holds data to be queried, Query objects are asserted to
> match the Data, and Criteria objects can be contained in either. (With the
> aforementioned collections trickery that if a Criteria is contained in a
> Query it can be found in a Data object, but the reverse isn't true. See the
> Query.contains(Object) method for how that's implemented.)
>
> So the rule above basically says "There's a Data object, and all of the
> Query objects Criteria are contained in the Data object."
>
> There's an alternate way of doing this using eval and a bit more java fu.
> See the eval_DroolsCriteriaMatch.tar.gz project attached. This one's
> probably not optimal, though, as it's basically a brute force check of all
> Data objects against the asserted Query.
>
> I tried for a while to get a solution working with different criteria types
> from both Data and Query objects being asserted into working memory, but I
> couldn't get the accumulate syntax right. Anyone know of a way to do that?
> (I figure that would get a "pure rules" solution.)
>
> --- On Sat, 11/7/09, Wishing Carebear <wishing.carebear(a)gmail.com> wrote:
>
> > From: Wishing Carebear <wishing.carebear(a)gmail.com>
> > Subject: [rules-users] some pointers for solution
> > To: rules-users(a)lists.jboss.org
> > Date: Saturday, November 7, 2009, 10:19 PM
> > Hello:
> > There are n selection criteria from s1 .. sn for each
> > item i1.. in. Each item can have a subset of criteria which
> > applies to them.
> > ?
> > The end user, can choose a subset of criteria like c1
> > and c5 and only the item that has c1 and c5 valid should be
> > returned. For example: if item i1 and i2 have criterias
> > valid for c1, c2, c5, c6, c8 since the request is only for
> > criteria c1 and c5, i1 and i2 must be returned.
> >
> > ?
> > Is it possible to write a rule using drools for this
> > requirement.
> > ?
> > Thanks for your help and time,
> > cabear
> >
> > -----Inline Attachment Follows-----
> >
> > _______________________________________________
> > rules-users mailing list
> > rules-users(a)lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
>
>
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: collection_DroolsCriteriaMatch.tar.gz
> Type: application/x-gzip
> Size: 5760 bytes
> Desc: not available
> Url :
> http://lists.jboss.org/pipermail/rules-users/attachments/20091108/f76ced1...
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: eval_DroolsCriteriaMatch.tar.gz
> Type: application/x-gzip
> Size: 4837 bytes
> Desc: not available
> Url :
> http://lists.jboss.org/pipermail/rules-users/attachments/20091108/f76ced1...
>
> ------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
> End of rules-users Digest, Vol 36, Issue 37
> *******************************************
>
15 years
Class loader problem
by Hemanth kumar
hi,
Im working on a sample test project.
In that im dynamically creating a class ( fact) and compiling it.
here is my test project
--------------------------------------------------------------------------------------
mainJavaclass
public void runRule()
{
try {
System.out.println("\nRunning rule\n");
// go !
URL[] urls = new URL[]{ new
URL("file://"+path) };
URLClassLoader ucl = new
URLClassLoader(urls);
Class<?> clazz =
ucl.loadClass("test.Message");
Object classObj = clazz.newInstance();
Method method =
clazz.getDeclaredMethod("setMessage", new Class[]{String.class});
//System.out.println("facts loaded\n");
method.invoke(classObj, new
Object[]{"Hello"});
log.info("==== Calling Rule Runner ======");
Collection facts = new ArrayList();
facts.add(classObj);
// Load and fire our rules files against the
data
new
RuleRunner().runStatelessRules(RULES_FILES, null, facts, null, null,
logger);
}
catch (Throwable t) {
t.printStackTrace();
}
}
----------------------------------------------------------------------
Fact
package test;
public class Message{
private String message;
public String getMessage(){
return this.message;
}
public void setMessage(String message) {
this.message = message;
}
}
------------------------------------------------------------------------
sample rule
package test
import test.Message;
rule "Your First Rule"
dialect "mvel"
when
m:Message(message != "Good Bye" )
then
System.out.println("First Rule fired "+m.message );
modify(m){ message = "Good Bye"};
end
-----------------------------------------------------------------
http://old.nabble.com/file/p26160051/console.PNG console.PNG
what happens is when i was running the project inside eclipse IDE it works
fine but when i hosted in tomcat and calling from outside ide the rule is
not getting fired.
I think the dyanamically loaded class is not recognised by the rule engine.
suggest me any ideas or post an working example
Hemanth
--
View this message in context: http://old.nabble.com/Class-loader-problem-tp26160051p26160051.html
Sent from the drools - user mailing list archive at Nabble.com.
15 years