Re: [rules-users] Memory issues

2011-07-14 Thread Jeffrey Schneller
Wolfgang -

 

Thanks for your response.  I have removed the KnowledgeAgent and changed
to build the KnowledgeBase without the use of an agent.  The
ChangeSetXML contains just the compiled binary because there is another
process which pulls the compiled binary from the Guvnor.  This allows
the business users to update the rules in the Guvnor and test in a
staging application.  When the rules are ready to be moved to
production, a process is kicked off that pulls all the binaries from the
Guvnor.  This allows the business to know exactly when the rules were
moved to production and by who [in case there was a problem].

 

Thanks again.

 

 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: Thursday, July 14, 2011 5:04 AM
To: Rules Users List
Subject: Re: [rules-users] Memory issues

 

Hi,

it's still guesswork in parts - circumstantial evidence at best.

The purpose of a KnowledgeAgent is to monitor resources for building a
KnowledgeBase, typically by periodic inspection of certain parts of the
file system and reacting to updates. But you set all scan.X properties
to false, turning the feature completely off.

This means that you use a KnowledgeAgent merely as a convenience tool
for creating a rule base. This is a sign of laziness (one of the three
great virtues of a programmer
<http://c2.com/cgi/wiki?LazinessImpatienceHubris> ) but even it must be
exercised with care.  However: why does the change Set XML contain just
the compiled binary? This means that stuff is compiled elsewhere, and
only the result copied to a place that's being monitored by - which part
of your application?

Agents are notoriously hard to kill, and the KA is one of these. If, for
instance you start resource change monitoring for an agent, it'll run a
thread that keeps a reference to the KA. So, just wiping a Map will not
rid the program of the KA objects, and this is bound to keep a lot of
other biggies alive.

Did you ever monitor to see running threads? Or existing objects per
class?

HTH
-W




2011/7/13 Jeffrey Schneller 

Yes.  The 18 KnowledgeAgents produce 18 StatefulKnowledgeSessions when
they are needed.  The session has dispose() called on it when it is not
needed any longer.

 

The Map maps the following:

 

X = product name

Y = the Knowledge Agent associated to a product.

 

Code does the following when rules need to be run against a product.

 

1)  Get KnowledgeAgent out of Map based on product name

2)  Create a StatefulKnowledgeSession

3)  Insert the facts about the product

4)  Fire all rules

5)  Dispose of StatefulKnowledgeSession

 

We have no problems with the 5 steps that are followed.  The rules are
configuration and pricing rules for each product.  The facts are the
options specified for a particular product. The rules compute the price
of the product as specified by the desired options and any incompatible
options selected [very similar to what you would see on car
manufacturers website for pricing a particular car]  If there is a
better way to do this, I would be interested in knowing.

 

Jeff

 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: Wednesday, July 13, 2011 1:27 PM
To: Rules Users List
Subject: Re: [rules-users] Memory issues

 

This is strange - do you mean that those 18 KnowledgeAgents stored in
that Map produce 18 different StatefulKnowledgeSessions?

What does the Map map? X? Y?

-W

2011/7/13 Jeffrey Schneller 

I am currently running version 5.1.0M2.  I have 18 different binary
rulesets [packages] that are stored on the local filesystem.  The
rulesets range in size from 4K to 131Mb. 

 

When my application starts I load each ruleset into a knowledgeAgent and
store the knowledgeAgent into a hashmap which is stored in memory.
They are loaded using the following xml:

 













 

The knowledgeAgentConfiguration is setup as:

drools.agent.scanDirectories = false

drools.agent.newInstance = false

drools.agent.scanResources = false

drools.agent.monitorChangeEvents = false

 

After the all the agents are loaded and stored in the hashmap the total
memory used in the app is 6.2GB.  

 

Once the application is running, if a business user needs to update a
set of rules there is a process in place to refresh all the
knowledgeAgents with new rulesets.  In a new thread. the code clears the
hashmap, sets the hashmap to null, calls for garbage collection to
occur, and it then constructs a new hashmap and loads all the rules as
it does at application startup. 

 

The knowledge agent is logging the following when the ruleset is loaded:

KnowledgeAgent applying ChangeSet

KnowledgeAgent performing an incremental build of the ChangeSet

KnowledgeAgent incremental build of KnowledgeBase finished and in use

 

 

It takes a large amount of time to do this process [double to triple the
time of applic

Re: [rules-users] Memory issues

2011-07-13 Thread Jeffrey Schneller
Yes.  The 18 KnowledgeAgents produce 18 StatefulKnowledgeSessions when
they are needed.  The session has dispose() called on it when it is not
needed any longer.

 

The Map maps the following:

 

X = product name

Y = the Knowledge Agent associated to a product.

 

Code does the following when rules need to be run against a product.

 

1)  Get KnowledgeAgent out of Map based on product name

2)  Create a StatefulKnowledgeSession

3)  Insert the facts about the product

4)  Fire all rules

5)  Dispose of StatefulKnowledgeSession

 

We have no problems with the 5 steps that are followed.  The rules are
configuration and pricing rules for each product.  The facts are the
options specified for a particular product. The rules compute the price
of the product as specified by the desired options and any incompatible
options selected [very similar to what you would see on car
manufacturers website for pricing a particular car]  If there is a
better way to do this, I would be interested in knowing.

 

Jeff

 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Wolfgang Laun
Sent: Wednesday, July 13, 2011 1:27 PM
To: Rules Users List
Subject: Re: [rules-users] Memory issues

 

This is strange - do you mean that those 18 KnowledgeAgents stored in
that Map produce 18 different StatefulKnowledgeSessions?

What does the Map map? X? Y?

-W

2011/7/13 Jeffrey Schneller 

I am currently running version 5.1.0M2.  I have 18 different binary
rulesets [packages] that are stored on the local filesystem.  The
rulesets range in size from 4K to 131Mb. 

 

When my application starts I load each ruleset into a knowledgeAgent and
store the knowledgeAgent into a hashmap which is stored in memory.
They are loaded using the following xml:

 













 

The knowledgeAgentConfiguration is setup as:

drools.agent.scanDirectories = false

drools.agent.newInstance = false

drools.agent.scanResources = false

drools.agent.monitorChangeEvents = false

 

After the all the agents are loaded and stored in the hashmap the total
memory used in the app is 6.2GB.  

 

Once the application is running, if a business user needs to update a
set of rules there is a process in place to refresh all the
knowledgeAgents with new rulesets.  In a new thread. the code clears the
hashmap, sets the hashmap to null, calls for garbage collection to
occur, and it then constructs a new hashmap and loads all the rules as
it does at application startup. 

 

The knowledge agent is logging the following when the ruleset is loaded:

KnowledgeAgent applying ChangeSet

KnowledgeAgent performing an incremental build of the ChangeSet

KnowledgeAgent incremental build of KnowledgeBase finished and in use

 

 

It takes a large amount of time to do this process [double to triple the
time of application startup]. After this occurs the memory used by the
app increases [to nearly double the original size 12.2GB] and the CPU is
maxed out.  After some time the CPU usage drops and the app is usable
again but the memory never decreases.  If a business user refreshes the
rules again, the memory increases again and the CPU is maxed out and the
app becomes unresponsive because the memory is completely maxed out.

 

There is obviously a memory leak somewhere and a large one at that.  Is
this the proper way to be caching KnowledgeAgents into memory so the
rulessets don't need to be re-loaded everytime a knowledgeAgent is run?
Is my problem the use of the hashmap?  Do I need to remove the original
knowledgeAgents that were in the hashmap?

 

 

Thanks for any help.

 


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Memory issues

2011-07-13 Thread Jeffrey Schneller
I am currently running version 5.1.0M2.  I have 18 different binary
rulesets [packages] that are stored on the local filesystem.  The
rulesets range in size from 4K to 131Mb. 

 

When my application starts I load each ruleset into a knowledgeAgent and
store the knowledgeAgent into a hashmap which is stored in memory.
They are loaded using the following xml:

 













 

The knowledgeAgentConfiguration is setup as:

drools.agent.scanDirectories = false

drools.agent.newInstance = false

drools.agent.scanResources = false

drools.agent.monitorChangeEvents = false

 

After the all the agents are loaded and stored in the hashmap the total
memory used in the app is 6.2GB.  

 

Once the application is running, if a business user needs to update a
set of rules there is a process in place to refresh all the
knowledgeAgents with new rulesets.  In a new thread. the code clears the
hashmap, sets the hashmap to null, calls for garbage collection to
occur, and it then constructs a new hashmap and loads all the rules as
it does at application startup. 

 

The knowledge agent is logging the following when the ruleset is loaded:

KnowledgeAgent applying ChangeSet

KnowledgeAgent performing an incremental build of the ChangeSet

KnowledgeAgent incremental build of KnowledgeBase finished and in use

 

 

It takes a large amount of time to do this process [double to triple the
time of application startup]. After this occurs the memory used by the
app increases [to nearly double the original size 12.2GB] and the CPU is
maxed out.  After some time the CPU usage drops and the app is usable
again but the memory never decreases.  If a business user refreshes the
rules again, the memory increases again and the CPU is maxed out and the
app becomes unresponsive because the memory is completely maxed out.

 

There is obviously a memory leak somewhere and a large one at that.  Is
this the proper way to be caching KnowledgeAgents into memory so the
rulessets don't need to be re-loaded everytime a knowledgeAgent is run?
Is my problem the use of the hashmap?  Do I need to remove the original
knowledgeAgents that were in the hashmap?

 

 

Thanks for any help.

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Is Drools appropriate for this app scenario?

2011-01-28 Thread Jeffrey Schneller
Yes, the site is pure java.  UI is done with Wicket, DB is done via
hibernate, Rules - drools core and guvnor.

1)  As I said in my original email, the shop owner UI was realized by
excel spreadsheet templates.  The Guvnor allows rules to be written via
an excel file template. Ideally, it would be a GUI based app but the
spreadsheets work and are more cost effective in this case.  The
spreadsheets can also be moved around to different systems [dev, test,
staging, production] and allow rules to be written disconnected from the
web.

2a) not sure what you are asking
2b) We have the following rule types:
Pricing - computes price for a product based on configuration
Configuration - rules which tell which option is required,
default values for options, and when a particular option or value is not
available based on other configuration choices
BOM - based on the configuration generate a BOM
Presentation - only used to determine how to display the picture
of the configured product. 

All these rules are in our service tier.  The presentation tier knows
nothing about the rules and just knows what to present to the user.

3) Our rules are pretty simple.  A bunch of when clauses and a few
consequence clauses.  There are not too many rules which cause other
rules to fire since we only allow the user to select valid choices in
the UI.  The default value rules do cause a cascade of firing and these
are always run first and only run if a default value needs to be set.

4) We do not use rules for entity metadata definition.  We certainly
could have but we maintain that via a database and a front-end GUI app.


This is not something that can be done in a couple of weeks.  The UI,
rules, etc... took months [and more months] to develop.  There were lots
of refactoring of code and rules to get it right.


Let me know [off-line] if you need more information or want to discuss
specific information.

Jeff




-Original Message-
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Sebastien
Chevalier
Sent: Thursday, January 27, 2011 8:10 AM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Is Drools appropriate for this app scenario?


Dear Jeff:

First, thank you very much for your quick reply.

Concerning your StoneSide shop, yes indeed this is pretty much the
functionality that I target, and it is a proof that it works well for a
*web* app. 
If I got it right, you used a pure *server*-centric rules-based
architecture
based on Java, Drools (Expert, Guvnor(?)) and Wicket, right? 

(1) ...But, how did you realize the shop owner UI, the one where (s)he
can
define the rules? Is it a web interface too, probably reusing Guvnor
components, or a separate stand-alone app? 

Relative to the internal architecture: 
(2) Could you please give me some more hints on which arch components
are
working under the covers? 
 -- Especially:

(2a) Which top-level components are used and which interface type do
they provide?
(2b) Which rule "types" must be in place?  (please, see next
paragraph
for details)

I suppose that, following a layered architecture, you'll need rules at
every
of the arch layers, most obviously "data/entity based rules" and
"presentation based rules". Less obvious to me is, if actually necessary
(?), the "data-to-presentation mapping mechanism" which extracts facts
from
the data layer and places the required artifacts onto the presentation,
probably having also some rules for injecting custom presentation and/or
collection/storage behavior into the components (i.e., rules in the
controller layer). 

Are these assumptions correct? 

(3) How do your rules (rule types) typically look like, and how work
they
together (map on each other)???

(4) Do you also use rules for "entity metadata definition" (i.e., dyn.
compositions of entity types from predefined property components)? 


I'd really be very grateful for the clarification of these issues and/or
any
further-helping descriptions.
Thank (all of) you very much in advance.

Best regards
   Sebastien

-- 
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Is-Drools-appropriat
e-for-this-app-scenario-tp2303204p2362526.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Is Drools appropriate for this app scenario?

2011-01-26 Thread Jeffrey Schneller
Sebastien,

I have built an e-commerce site [www.stoneside.com] with some if not all
of the things you are talking about. If you go there and design a
product you can see the rules working.

Drools is being used for:
Pricing rules and discounts within a product.
Rules regarding what components of a product can exist with
other components.  [the end-user is custom designing something to
purchase]
Rules determine how to display the product as the end-user
designs their product.
Rules generate the BOM once the user ultimately orders the
product that they designed.

All the rules are managed using excel spreadsheet templates.  We [the
developers] defined the templates and the business enters the rules into
the spreadsheet.  This has worked pretty well.  The biggest hurdle being
defining the templates correctly and populating the initial sets of
rules.  Some of the more complex products have at least 5K rules [across
all 4 areas of rules] that needed to be defined.

So, I think it is appropriate for your app scenario.  You will need to
think about what you need as rules and what those rule 'templates' need
to look like.  

Jeff



-Original Message-
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Sebastien
Chevalier
Sent: Wednesday, January 26, 2011 6:28 AM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Is Drools appropriate for this app scenario?


@plugtreelabs: First of all, thank you very much for your response and
hints. 

@all: As I'm still not quire sure how to realize my scenario:
Please, could someone provide me with some diagrams or architectural
sketches of a typical rules-based e-commerce web application? -- Or at
least
point me to online resources on that topic, especially showing the
integration of the RBMS in a web app?

This would really help me out a lot at the moment.

_Recap: 
The main goal is that endusers shall, on the one hand, define almost the
whole set of entities and rules in an initial shop
specification/configuration process, and on the other hand, this set
shall
be modifiable later on (primarily through enhancements, not
restrictions).
The entity set basically is: customer types, product categories,
products,
product packages, customer(type)-to-product(type) price assignments
(i.e.
pricing rules), and inter-product/package selection rules, ...all of
these
dynamically definable via a WebUI and in a manner appropriate for
non-technical end-users (considering declarative programming a good
approach
for this(?)). 

The most dynamic parts will be the multi-dimensional pricing tables in
terms
of (a) their schema -- when new pricing parameters (=dimensions) like
delivery distance are added -- and (b) their value contents -- when
concrete
prices change. 
Another quite dynamic part will be the inter-product selection rule
specifications from which a "smart" e-catalog will be generated for the
client-side. Such rules will state sth. like: 
"Prod A must always be ordered with Prod B", "Prod B can never be
ordered
when Package C is selected", and similar.
--

Currently, some "high-level architectural layouts" of a simple,
rules-based
e-commerce web app (Which components are necessary in which place? And
which
components are already delivered by Drools?) would be very helpful for
me.
 
Thank you very much for your help in advance.

Best regards
  Sebastien

-- 
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Is-Drools-appropriat
e-for-this-app-scenario-tp2303204p2353169.html
Sent from the Drools - User mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools and Guvnor 5.1M2 - ExceptionbeingthrowninprocessChangeSet

2010-07-01 Thread Jeffrey Schneller
Thanks for the info.   Is there any way that you can add a call to do
garbage collection after the knowledge agent is refreshed?  I am
noticing that all my rules stick around for some time until garbage
collection is actually run.  If rule packages are huge, modified, and
rebuilt quickly the scanner will pick them up and process them but if
garbage collection hasn't run after the last refresh then a bunch of
stale objects are hanging around.

 

I tested this by running a memory profile tool.  After the rule refresh
occurs all my rule object counts increase by 1.  If I force garbage
collection from the profile tool then all the rule object counts drop
down to 1.  

 

Am I doing something wrong?

 

When do you expect 5.1RC1 to be available? 

 

Thanks.

 

 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban
Aliverti
Sent: Thursday, July 01, 2010 1:27 PM
To: Rules Users List
Subject: Re: [rules-users] Drools and Guvnor 5.1M2 -
ExceptionbeingthrowninprocessChangeSet

 

The other error could be because of a bug I recently fixed:
https://jira.jboss.org/browse/BRMS-320

It should be solved in 5.1RC1 I think.

 

Best,

2010/7/1 Jeffrey Schneller 

Esteban,

 

Here is the stack trace for the ClassNotFoundException when the compiler
jar is not included.  

 

java.lang.ClassNotFoundException:
org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl

 at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
.java:1387)

 at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
.java:1233)

 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

 at java.lang.Class.forName0(Native Method)

 at java.lang.Class.forName(Class.java:169)

 at
org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.newInstance(S
erviceRegistryImpl.java:190)

 at
org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.call(ServiceR
egistryImpl.java:185)

 at
org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:143)

 at
org.drools.builder.KnowledgeBuilderFactory.loadServiceFactory(KnowledgeB
uilderFactory.java:107)

 at
org.drools.builder.KnowledgeBuilderFactory.getKnowledgeBuilderPServiceFa
ctory(KnowledgeBuilderFactory.java:101)

 at
org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(Knowledge
BuilderFactory.java:29)

 at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(Knowl
edgeAgentImpl.java:556)

 at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(Knowl
edgeAgentImpl.java:541)

 at
org.drools.agent.impl.KnowledgeAgentImpl.incrementalBuildResources(Knowl
edgeAgentImpl.java:731)

 at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAge
ntImpl.java:515)

 at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:145)

 at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:130)

 

 

Any idea on why the other error is appearing.  The error is
"java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage".  This occurs when the
knowledge agent is created with the compiled package from the Guvnor for
the first time.

 

Thank you for all your work and help.  Drools is a great package.

 

Thanks.

 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban
Aliverti
Sent: Thursday, July 01, 2010 8:09 AM


To: Rules Users List
Subject: Re: [rules-users] Drools and Guvnor 5.1M2 - Exception
beingthrowninprocessChangeSet

 

Could you please provide us the line number where de
ClassNotFoundException occurs. I think I know what could be happening.
When you use incremental change set processing (newInstance = false),
the agent use a kbuilder to perform some diff between the modified and
original resource. The thing is that the agent always instantiate a
kbuilder even if all the resources are already compiled (which is
useless).

 

Please provide me the line number of the exception, i will start working
on this issue. Meanwhile, as a workaround, add the drools-compiler
dependency. 

The KAgent was practically rebuilt from scratch since 5.1M1 so these
kind of error were expected ;)

 

Best,

 

2010/7/1 Jeffrey Schneller 

As a follow-up, this did work however there are still some problems.
The rules did get pulled into the application and seem to be running but
clearly something is not right.

 

I needed to include the drools-compiler.jar in my app otherwise I was
getting a ClassNotFoundException.  I am pulling a compiled package from
the Guvnor so not sure why I need the compiler jar in my app.

 

When the rules are pulled into the app I am getting the exception thrown
which is being logged and the app can continue running: 

 

2010-07-01 00:36:14,201 | INFO (MyDroolsListener.java:41) KnowledgeAgen

Re: [rules-users] Drools and Guvnor 5.1M2 - Exception beingthrowninprocessChangeSet

2010-07-01 Thread Jeffrey Schneller
Esteban,

 

Here is the stack trace for the ClassNotFoundException when the compiler
jar is not included.  

 

java.lang.ClassNotFoundException:
org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl

 at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
.java:1387)

 at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader
.java:1233)

 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

 at java.lang.Class.forName0(Native Method)

 at java.lang.Class.forName(Class.java:169)

 at
org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.newInstance(S
erviceRegistryImpl.java:190)

 at
org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.call(ServiceR
egistryImpl.java:185)

 at
org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:143)

 at
org.drools.builder.KnowledgeBuilderFactory.loadServiceFactory(KnowledgeB
uilderFactory.java:107)

 at
org.drools.builder.KnowledgeBuilderFactory.getKnowledgeBuilderPServiceFa
ctory(KnowledgeBuilderFactory.java:101)

 at
org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(Knowledge
BuilderFactory.java:29)

 at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(Knowl
edgeAgentImpl.java:556)

 at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(Knowl
edgeAgentImpl.java:541)

 at
org.drools.agent.impl.KnowledgeAgentImpl.incrementalBuildResources(Knowl
edgeAgentImpl.java:731)

 at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAge
ntImpl.java:515)

 at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:145)

 at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:130)

 

 

Any idea on why the other error is appearing.  The error is
"java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage".  This occurs when the
knowledge agent is created with the compiled package from the Guvnor for
the first time.

 

Thank you for all your work and help.  Drools is a great package.

 

Thanks.

 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban
Aliverti
Sent: Thursday, July 01, 2010 8:09 AM
To: Rules Users List
Subject: Re: [rules-users] Drools and Guvnor 5.1M2 - Exception
beingthrowninprocessChangeSet

 

Could you please provide us the line number where de
ClassNotFoundException occurs. I think I know what could be happening.
When you use incremental change set processing (newInstance = false),
the agent use a kbuilder to perform some diff between the modified and
original resource. The thing is that the agent always instantiate a
kbuilder even if all the resources are already compiled (which is
useless).

 

Please provide me the line number of the exception, i will start working
on this issue. Meanwhile, as a workaround, add the drools-compiler
dependency. 

The KAgent was practically rebuilt from scratch since 5.1M1 so these
kind of error were expected ;)

 

Best,

 

2010/7/1 Jeffrey Schneller 

As a follow-up, this did work however there are still some problems.
The rules did get pulled into the application and seem to be running but
clearly something is not right.

 

I needed to include the drools-compiler.jar in my app otherwise I was
getting a ClassNotFoundException.  I am pulling a compiled package from
the Guvnor so not sure why I need the compiler jar in my app.

 

When the rules are pulled into the app I am getting the exception thrown
which is being logged and the app can continue running: 

 

2010-07-01 00:36:14,201 | INFO (MyDroolsListener.java:41) KnowledgeAgent
performing an incremental build of the ChangeSet

2010-07-01 00:36:14,261 | ERROR (MyDroolsListener.java:30)
java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage  

2010-07-01 00:36:14,261 | WARN (MyDroolsListener.java:53)
KnowledgeAgent: The resource didn't create any package: [UrlResource
path='http://ruleserver/drools-guvnor/org.drools.guvnor.Guvnor/package/m
y.rule.package/LATEST']

2010-07-01 00:36:14,271 | INFO (MyDroolsListener.java:41) KnowledgeAgent
incremental build of KnowledgeBase finished and in use

 

Then if I rebuild the package in the Guvnor then I see the following
[the two lines are repeated for each rule in the package]:

 

[2010:07:182 00:07:741:debug] BinaryResourceDiffProducerImpl: Comparing
[Rule name=v_32, agendaGroup=MAIN, salience=0, no-loop=false] against
[Rule name=v_32, agendaGroup=MAIN, salience=0, no-loop=false]

[2010:07:182 00:07:741:debug] BinaryResourceDiffProducerImpl: The rules
have different LHS

 

 

Thanks

 

 

 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban
Aliverti
Sent: Wednesday, June 30, 2010 6:35 PM


To: Rules Users List
Subject:

Re: [rules-users] Drools and Guvnor 5.1M2 - Exception beingthrownin processChangeSet

2010-06-30 Thread Jeffrey Schneller
As a follow-up, this did work however there are still some problems.
The rules did get pulled into the application and seem to be running but
clearly something is not right.

 

I needed to include the drools-compiler.jar in my app otherwise I was
getting a ClassNotFoundException.  I am pulling a compiled package from
the Guvnor so not sure why I need the compiler jar in my app.

 

When the rules are pulled into the app I am getting the exception thrown
which is being logged and the app can continue running: 

 

2010-07-01 00:36:14,201 | INFO (MyDroolsListener.java:41) KnowledgeAgent
performing an incremental build of the ChangeSet

2010-07-01 00:36:14,261 | ERROR (MyDroolsListener.java:30)
java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage  

2010-07-01 00:36:14,261 | WARN (MyDroolsListener.java:53)
KnowledgeAgent: The resource didn't create any package: [UrlResource
path='http://ruleserver/drools-guvnor/org.drools.guvnor.Guvnor/package/m
y.rule.package/LATEST']

2010-07-01 00:36:14,271 | INFO (MyDroolsListener.java:41) KnowledgeAgent
incremental build of KnowledgeBase finished and in use

 

Then if I rebuild the package in the Guvnor then I see the following
[the two lines are repeated for each rule in the package]:

 

[2010:07:182 00:07:741:debug] BinaryResourceDiffProducerImpl: Comparing
[Rule name=v_32, agendaGroup=MAIN, salience=0, no-loop=false] against
[Rule name=v_32, agendaGroup=MAIN, salience=0, no-loop=false]

[2010:07:182 00:07:741:debug] BinaryResourceDiffProducerImpl: The rules
have different LHS

 

 

Thanks

 

 

 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban
Aliverti
Sent: Wednesday, June 30, 2010 6:35 PM
To: Rules Users List
Subject: Re: [rules-users] Drools and Guvnor 5.1M2 - Exception
beingthrownin processChangeSet

 

The problem seams to happen because the kagent can't access the url. 

If you try to access the change set xml using a browser, does the
browser ask you for authentication? I don't know why, but guvnor protect
its urls since 5.1 I think. 

So, basically, the error is that guvnor can't read from the url. The
same error happens if you provide a non existent url. I need to open a
jira for this.

As a work around, try doing this:

 





 





 


Remember to replace username and password.

 

Best,

 

2010/6/30 Jeffrey Schneller 

Here is the xml file I am getting:

 





 





 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban
Aliverti
Sent: Wednesday, June 30, 2010 3:18 PM
To: Rules Users List
Subject: Re: [rules-users] Drools and Guvnor 5.1M2 - Exception being
thrownin processChangeSet

 

Could you please post the xml file you are getting from
http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.rul
e.package/LATEST/ChangeSet.xml
<http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.ru
le.package/LATEST/ChangeSet.xml> ?

 

Best,

2010/6/30 Jeffrey Schneller 

I am trying to upgrade to the 5.1M2 build from 5.0.1 and am running into
some issues.  I have installed the new 5.1 Guvnor and imported the rules
from my 5.0.1 Guvnor instance.  

I then removed the old 5.0.1 drools jars from my app and replaced them
with the 5.1M2 drools jars.  I was also added all the dependent
libraries.  The code that worked with the 5.0.1 version does not work
with the 5.1M2 version.  In 5.0.1 I was constructing the xml and
streaming it into the applyChangeSet method.  With 5.1M2 I am just
pointing to the change set xml file that is in the Guvnor. 

 

I am seeing a NullPointerException being thrown  in the processChangeSet
method as shown below.

 

Caused by: java.lang.NullPointerException

at
org.drools.agent.impl.KnowledgeAgentImpl.processChangeSet(KnowledgeAgent
Impl.java:171)

at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:143)

at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:130)

 

 

Did I miss something?  Am I doing something wrong?  Below is the code
that I have.

 

 KnowledgeAgentConfiguration kaconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();

 kaconf.setProperty( "drools.agent.scanDirectories",
"true" ); 

 kaconf.setProperty("drools.agent.newInstance",
"false");

 

 
ResourceFactory.getResourceChangeScannerService().start();

 
ResourceFactory.getResourceChangeNotifierService().start();

 

String url =
"http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.ru
le.package/LATEST/ChangeSet.xml";



Kn

Re: [rules-users] Drools and Guvnor 5.1M2 - Exception beingthrownin processChangeSet

2010-06-30 Thread Jeffrey Schneller
Thanks.  I started going down that path.  It appears that even the
changeset xml file can't be found from the Guvnor.  So I will need to
pass authentication with the URL given to the applyChangeset method.

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban
Aliverti
Sent: Wednesday, June 30, 2010 6:35 PM
To: Rules Users List
Subject: Re: [rules-users] Drools and Guvnor 5.1M2 - Exception
beingthrownin processChangeSet

 

The problem seams to happen because the kagent can't access the url. 

If you try to access the change set xml using a browser, does the
browser ask you for authentication? I don't know why, but guvnor protect
its urls since 5.1 I think. 

So, basically, the error is that guvnor can't read from the url. The
same error happens if you provide a non existent url. I need to open a
jira for this.

As a work around, try doing this:

 





 





 


Remember to replace username and password.

 

Best,

 

2010/6/30 Jeffrey Schneller 

Here is the xml file I am getting:

 





 





 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban
Aliverti
Sent: Wednesday, June 30, 2010 3:18 PM
To: Rules Users List
Subject: Re: [rules-users] Drools and Guvnor 5.1M2 - Exception being
thrownin processChangeSet

 

Could you please post the xml file you are getting from
http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.rul
e.package/LATEST/ChangeSet.xml
<http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.ru
le.package/LATEST/ChangeSet.xml> ?

 

Best,

2010/6/30 Jeffrey Schneller 

I am trying to upgrade to the 5.1M2 build from 5.0.1 and am running into
some issues.  I have installed the new 5.1 Guvnor and imported the rules
from my 5.0.1 Guvnor instance.  

I then removed the old 5.0.1 drools jars from my app and replaced them
with the 5.1M2 drools jars.  I was also added all the dependent
libraries.  The code that worked with the 5.0.1 version does not work
with the 5.1M2 version.  In 5.0.1 I was constructing the xml and
streaming it into the applyChangeSet method.  With 5.1M2 I am just
pointing to the change set xml file that is in the Guvnor. 

 

I am seeing a NullPointerException being thrown  in the processChangeSet
method as shown below.

 

Caused by: java.lang.NullPointerException

at
org.drools.agent.impl.KnowledgeAgentImpl.processChangeSet(KnowledgeAgent
Impl.java:171)

at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:143)

at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:130)

 

 

Did I miss something?  Am I doing something wrong?  Below is the code
that I have.

 

 KnowledgeAgentConfiguration kaconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();

 kaconf.setProperty( "drools.agent.scanDirectories",
"true" ); 

 kaconf.setProperty("drools.agent.newInstance",
"false");

 

 
ResourceFactory.getResourceChangeScannerService().start();

 
ResourceFactory.getResourceChangeNotifierService().start();

 

String url =
"http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.ru
le.package/LATEST/ChangeSet.xml";



KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent( "Configuration", kaconf );

kagent.setSystemEventListener(new MyDroolsListener());

try {

 
kagent.applyChangeSet(ResourceFactory.newUrlResource(new URL(url)));
// ERROR IS OCCURING INSIDE OF applyChangeSet

} catch (MalformedURLException e) {

e.printStackTrace();

}


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




-- 


Esteban Aliverti


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




-- 


Esteban Aliverti

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools and Guvnor 5.1M2 - Exception being thrownin processChangeSet

2010-06-30 Thread Jeffrey Schneller
Here is the xml file I am getting:

 





 





 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Esteban
Aliverti
Sent: Wednesday, June 30, 2010 3:18 PM
To: Rules Users List
Subject: Re: [rules-users] Drools and Guvnor 5.1M2 - Exception being
thrownin processChangeSet

 

Could you please post the xml file you are getting from
http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.rul
e.package/LATEST/ChangeSet.xml
<http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.ru
le.package/LATEST/ChangeSet.xml> ?

 

Best,

2010/6/30 Jeffrey Schneller 

I am trying to upgrade to the 5.1M2 build from 5.0.1 and am running into
some issues.  I have installed the new 5.1 Guvnor and imported the rules
from my 5.0.1 Guvnor instance.  

I then removed the old 5.0.1 drools jars from my app and replaced them
with the 5.1M2 drools jars.  I was also added all the dependent
libraries.  The code that worked with the 5.0.1 version does not work
with the 5.1M2 version.  In 5.0.1 I was constructing the xml and
streaming it into the applyChangeSet method.  With 5.1M2 I am just
pointing to the change set xml file that is in the Guvnor. 

 

I am seeing a NullPointerException being thrown  in the processChangeSet
method as shown below.

 

Caused by: java.lang.NullPointerException

at
org.drools.agent.impl.KnowledgeAgentImpl.processChangeSet(KnowledgeAgent
Impl.java:171)

at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:143)

at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:130)

 

 

Did I miss something?  Am I doing something wrong?  Below is the code
that I have.

 

 KnowledgeAgentConfiguration kaconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();

 kaconf.setProperty( "drools.agent.scanDirectories",
"true" ); 

 kaconf.setProperty("drools.agent.newInstance",
"false");

 

 
ResourceFactory.getResourceChangeScannerService().start();

 
ResourceFactory.getResourceChangeNotifierService().start();

 

String url =
"http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.ru
le.package/LATEST/ChangeSet.xml";



KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent( "Configuration", kaconf );

kagent.setSystemEventListener(new MyDroolsListener());

try {

 
kagent.applyChangeSet(ResourceFactory.newUrlResource(new URL(url)));
// ERROR IS OCCURING INSIDE OF applyChangeSet

} catch (MalformedURLException e) {

e.printStackTrace();

}


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




-- 


Esteban Aliverti

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Drools and Guvnor 5.1M2 - Exception being thrown in processChangeSet

2010-06-30 Thread Jeffrey Schneller
I am trying to upgrade to the 5.1M2 build from 5.0.1 and am running into
some issues.  I have installed the new 5.1 Guvnor and imported the rules
from my 5.0.1 Guvnor instance.  

I then removed the old 5.0.1 drools jars from my app and replaced them
with the 5.1M2 drools jars.  I was also added all the dependent
libraries.  The code that worked with the 5.0.1 version does not work
with the 5.1M2 version.  In 5.0.1 I was constructing the xml and
streaming it into the applyChangeSet method.  With 5.1M2 I am just
pointing to the change set xml file that is in the Guvnor. 

 

I am seeing a NullPointerException being thrown  in the processChangeSet
method as shown below.

 

Caused by: java.lang.NullPointerException

at
org.drools.agent.impl.KnowledgeAgentImpl.processChangeSet(KnowledgeAgent
Impl.java:171)

at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:143)

at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:130)

 

 

Did I miss something?  Am I doing something wrong?  Below is the code
that I have.

 

 KnowledgeAgentConfiguration kaconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();

 kaconf.setProperty( "drools.agent.scanDirectories",
"true" ); 

 kaconf.setProperty("drools.agent.newInstance",
"false");

 

 
ResourceFactory.getResourceChangeScannerService().start();

 
ResourceFactory.getResourceChangeNotifierService().start();

 

String url =
"http://rulerserver/drools-guvnor/org.drools.guvnor.Guvnor/package/my.ru
le.package/LATEST/ChangeSet.xml";



KnowledgeAgent kagent =
KnowledgeAgentFactory.newKnowledgeAgent( "Configuration", kaconf );

kagent.setSystemEventListener(new MyDroolsListener());

try {

 
kagent.applyChangeSet(ResourceFactory.newUrlResource(new URL(url)));
// ERROR IS OCCURING INSIDE OF applyChangeSet

} catch (MalformedURLException e) {

e.printStackTrace();

}

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Rule Validation/Package Build Error in Guvnor: ClassNot Found

2010-06-28 Thread Jeffrey Schneller
Your jar files [the models] need to be in the same drools package as
your DRL file.

 

So if in the Guvnor you have:

 

com.domain.project.rules

Business Rules

Your DRL file

 

Then you need to have the model in the same package.

 

com.domain.project.rules

Business Rules

Your DRL file

Models

Jar 1

Jar 2

Jar 3

 

The objects in each jar don't have to be in the com.domain.project.rules
package.  They can be in any package.  You do need to import the correct
objects in your DRL however.  The package you specify in the Guvnor is
the package that the individual rules get compiled into.

 

 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Ike Okafo
Sent: Monday, June 28, 2010 4:32 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] Rule Validation/Package Build Error in Guvnor:
ClassNot Found

 

Hello,

I am new to Drools and have written a rule .DRL file which contains some

helper function imports from other packages, fact objects imports from 
other packages and the rules that act on these facts. The file works
well 
when I call it from my javacode using the rulebase or knowledgebase
approach. 

The drl file itself is in its own package.

I now have a requirement to call the same rules from within Guvnor.
The goal is to enable business users modify these rules through the 
Guvnor UI and also take advantage of the disable individual rules 
feature within guvnor.

My current difficulty is importing and validating the rules in guvnor, 
along with the associated fact jar files and finally interfacing 

with guvnor from my code. Any help would be appreciated .

The main error happens when I try to build a binary package and create
a snapshot of the working rule file I imported for deployment.
When I hit the save and validate configuration button, I get
"class not found" validation errors for all the classes imported at 
the top of the rule file - includingng the helper import functions
and facts used in the rules. Same thing happens when I try to 

build the package I get the following errors 

"Error importing: "

Here are the steps I followed in importing the rule file and Jar file
containing the classes
into Guvnor

(1) First within Guvnor I created a package corresponding to the package
path

for for each of the jar files whose classes are referenced/imported in
the rule .DRL file

(2) I created the jar files for each of these packages in eclipse

(3) Imported those jars individually into each of the packages created
in guvnor 
using upload model jar function and selecting the appropriate path
as
created in step 1 2 above

(4) Imported the rule file which is in its own package - using the
create package (upload method)

(5) I then try to save and validate the imported rule file in step 5
(this is where the error occurs)


I have already setup my code to call guvnor as follows

RuleAgent agent = RuleAgent.newRuleAgent("guvnor.properties");
RuleBase masterRuleBase = agent.getRuleBase();

guvnor.properties contains only one entry
url =
http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package/Som
ePackage.drools/LATEST

It is my understanding that after I import the rule file
I need to save and validate and build the package
in order to  point the url to the path above. If I point the url to just
the drl file itself will it work?
i.e
url=http://localhost:8080/drools-guvnor/org.drools.guvnor.Guvnor/package
/SomePackage.drools/LATEST.drl 
 

Any help to resolve the class not found error will 
be much appreciated

Thanks

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] OutOfMemoryError: GC overhead limit exceeded

2010-06-24 Thread Jeffrey Schneller
Geoffrey,

Thank you for your response and the link to the blog post.  We are
definitely on the large side for rules.  Luckily though not 8GB worth
[at least not yet].  Is 5.1 stable enough to run in a production
environment?

Thanks.



-Original Message-
From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Geoffrey De
Smet
Sent: Thursday, June 24, 2010 12:39 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] OutOfMemoryError: GC overhead limit exceeded

An "OutOfMemoryError: GC overhead limit exceeded" issue was fixed for 
5.1, see 
http://blog.athico.com/2010/03/drools-halves-memory-use-with-new-true.ht
ml

With kind regards,
Geoffrey De Smet


Jeffrey Schneller schreef:
> I saw a similar thread about this back in March but I am now seeing a 
> similar exception being thrown.  I am running 5.0.1.  The error is 
> thrown in my app after the change set listener determines there was a 
> change with the rules package in the Guvnor.   I have included the
stack 
> trace from the most recent time the exception was thrown.  Hopefully 
> someone can provide some additional information or a workaround.  Has 
> this problem been fixed in 5.1?  If so, has 5.1 moved out of M2 state 
> and into a CR state and when will it go into a full released state?
> 
>  
> 
> Exception in thread "Thread-44" java.lang.OutOfMemoryError: GC
overhead 
> limit exceeded
> 
>at org.drools.rule.GroupElement.(GroupElement.java:44)
> 
>at org.drools.rule.GroupElement.(GroupElement.java:47)
> 
>at
sun.reflect.GeneratedConstructorAccessor61.newInstance(Unknown 
> Source)
> 
>at 
>
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
tructorAccessorImpl.java:27)
> 
>at
java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> 
>at java.lang.Class.newInstance0(Class.java:355)
> 
>at java.lang.Class.newInstance(Class.java:308)
> 
>at org.drools.rule.GroupElement.clone(GroupElement.java:267)
> 
>at org.drools.rule.GroupElement.clone(GroupElement.java:279)
> 
>at org.drools.rule.Rule.getExtendedLhs(Rule.java:518)
> 
>at org.drools.rule.Rule.getTransformedLhs(Rule.java:545)
> 
>at 
>
org.drools.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.ja
va:98)
> 
>at
org.drools.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:117)
> 
>at
org.drools.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java:362)
> 
>at 
> org.drools.common.AbstractRuleBase.addRule(AbstractRuleBase.java:618)
> 
>at 
>
org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:500
)
> 
>at 
> org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:388)
> 
>at 
>
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgent
Impl.java:416)
> 
>at 
>
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:120)
> 
>at 
>
org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.r
un(KnowledgeAgentImpl.java:538)
> 
>at java.lang.Thread.run(Thread.java:619)
> 
>  
> 
>  
> 
> Thanks.
> 
> 
>

> 
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] OutOfMemoryError: GC overhead limit exceeded - RESEND

2010-06-24 Thread Jeffrey Schneller
This is a RESEND because of mail server issues.  Not sure if the
original message went out.

 

I saw a similar thread about this back in March but I am now seeing a
similar exception being thrown.  I am running 5.0.1.  The error is
thrown in my app after the change set listener determines there was a
change with the rules package in the Guvnor.   I have included the stack
trace from the most recent time the exception was thrown.  Hopefully
someone can provide some additional information or a workaround.  Has
this problem been fixed in 5.1?  If so, has 5.1 moved out of M2 state
and into a CR state and when will it go into a full released state?

 

Exception in thread "Thread-44" java.lang.OutOfMemoryError: GC overhead
limit exceeded

   at org.drools.rule.GroupElement.(GroupElement.java:44)

   at org.drools.rule.GroupElement.(GroupElement.java:47)

   at sun.reflect.GeneratedConstructorAccessor61.newInstance(Unknown
Source)

   at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
tructorAccessorImpl.java:27)

   at
java.lang.reflect.Constructor.newInstance(Constructor.java:513)

   at java.lang.Class.newInstance0(Class.java:355)

   at java.lang.Class.newInstance(Class.java:308)

   at org.drools.rule.GroupElement.clone(GroupElement.java:267)

   at org.drools.rule.GroupElement.clone(GroupElement.java:279)

   at org.drools.rule.Rule.getExtendedLhs(Rule.java:518)

   at org.drools.rule.Rule.getTransformedLhs(Rule.java:545)

   at
org.drools.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.ja
va:98)

   at
org.drools.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:117)

   at
org.drools.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java:362)

   at
org.drools.common.AbstractRuleBase.addRule(AbstractRuleBase.java:618)

   at
org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:500
)

   at
org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:388)

   at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgent
Impl.java:416)

   at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:120)

   at
org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.r
un(KnowledgeAgentImpl.java:538)

   at java.lang.Thread.run(Thread.java:619)

 

 

Thanks.

 

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] OutOfMemoryError: GC overhead limit exceeded

2010-06-23 Thread Jeffrey Schneller
I saw a similar thread about this back in March but I am now seeing a
similar exception being thrown.  I am running 5.0.1.  The error is
thrown in my app after the change set listener determines there was a
change with the rules package in the Guvnor.   I have included the stack
trace from the most recent time the exception was thrown.  Hopefully
someone can provide some additional information or a workaround.  Has
this problem been fixed in 5.1?  If so, has 5.1 moved out of M2 state
and into a CR state and when will it go into a full released state?

 

Exception in thread "Thread-44" java.lang.OutOfMemoryError: GC overhead
limit exceeded

   at org.drools.rule.GroupElement.(GroupElement.java:44)

   at org.drools.rule.GroupElement.(GroupElement.java:47)

   at sun.reflect.GeneratedConstructorAccessor61.newInstance(Unknown
Source)

   at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
tructorAccessorImpl.java:27)

   at
java.lang.reflect.Constructor.newInstance(Constructor.java:513)

   at java.lang.Class.newInstance0(Class.java:355)

   at java.lang.Class.newInstance(Class.java:308)

   at org.drools.rule.GroupElement.clone(GroupElement.java:267)

   at org.drools.rule.GroupElement.clone(GroupElement.java:279)

   at org.drools.rule.Rule.getExtendedLhs(Rule.java:518)

   at org.drools.rule.Rule.getTransformedLhs(Rule.java:545)

   at
org.drools.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.ja
va:98)

   at
org.drools.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:117)

   at
org.drools.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java:362)

   at
org.drools.common.AbstractRuleBase.addRule(AbstractRuleBase.java:618)

   at
org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:500
)

   at
org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:388)

   at
org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgent
Impl.java:416)

   at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentIm
pl.java:120)

   at
org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.r
un(KnowledgeAgentImpl.java:538)

   at java.lang.Thread.run(Thread.java:619)

 

 

Thanks.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] KnowledgeAgent

2010-03-01 Thread Jeffrey Schneller
Can someone explain how to use the knowledge agent when the rules are
stored on the guvnor.  I also do not want to use an xml configuration
file [change-set] to specify the url of the guvnor.  The url is
retrieved through the code in my case and I can't set it via a
change-set since we don't know what the url is until runtime.

 

Thanks.

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] RuleBase Refresh

2010-03-01 Thread Jeffrey Schneller
I am having issues refreshing my RuleBase.  It works in some cases
[small numbers of rules] and doesn't work in others.  I am using the
Guvnor to maintain rules and all my rules are in Excel decision table.

 

To test, I created a simple package that contains 1 excel decision table
which has 1 rule [row] in it.  I ran my application.  Then rebuilt the
package in the Guvnor and my application refreshed the rule base
correctly.

 

Then in my actual application, I have other packages which contain many
100 rules if not 1000 rules all based on multiple excel based decision
tables.  If I run my application, then rebuild the package in the
Guvnor, my application throws the exception.

 

RuleAgent(Assembly) EXCEPTION (Fri Feb 26 12:02:32 EST 2010):
java.lang.ClassCastException: org.drools.util.ObjectHashMap cannot be
cast to org.drools.reteoo.BetaMemory. Stack trace should follow.
org.drools.RuntimeDroolsException: java.lang.ClassCastException:
org.drools.util.ObjectHashMap cannot be cast to
org.drools.reteoo.BetaMemory

 

It appears the problem occurs where there are many rules.  Any ideas?

 

This is going to be a major problem because the rules may need to be
refreshed on a pretty regular basis and restarted the app each time is
not an option.

 

Thanks.

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Refreshing RuleBase using the Guvnor

2010-02-26 Thread Jeffrey Schneller
I posted about caching and after some more investigation it appears the problem 
lies in just refreshing the rulebase.
 
I created a simple package that contains 1 excel decision table which has 1 
rule [row] in it.  I ran my application.  Then rebuilt the package in the 
Guvnor and my application refreshed the rule base correctly.
 
I have other packages which contain many 100 rules if not 1000 rules all based 
on multiple excel based decision tables.  If I run my application, then rebuild 
the package in the Guvnor, my application throws the exception.
 
RuleAgent(Assembly) EXCEPTION (Fri Feb 26 12:02:32 EST 2010): 
java.lang.ClassCastException: org.drools.util.ObjectHashMap cannot be cast to 
org.drools.reteoo.BetaMemory. Stack trace should follow.
org.drools.RuntimeDroolsException: java.lang.ClassCastException: 
org.drools.util.ObjectHashMap cannot be cast to org.drools.reteoo.BetaMemory

It appears the problem occurs where there are many rules.  Any ideas?
 
Thanks.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Refreshing Rule Base

2010-02-26 Thread Jeffrey Schneller
I posted about caching and after some more investigation it appears the problem 
lies in just refreshing the rulebase.
 
I created a simple package that contains 1 excel decision table which has 1 
rule [row] in it.  I ran my application.  Then rebuilt the package in the 
Guvnor and my application refreshed the rule base correctly.
 
I have other packages which contain many 100 rules if not 1000 rules all based 
on multiple excel based decision tables.  If I run my application, then rebuild 
the package in the Guvnor, my application throws the exception.
 
RuleAgent(Assembly) EXCEPTION (Fri Feb 26 12:02:32 EST 2010): 
java.lang.ClassCastException: org.drools.util.ObjectHashMap cannot be cast to 
org.drools.reteoo.BetaMemory. Stack trace should follow.
org.drools.RuntimeDroolsException: java.lang.ClassCastException: 
org.drools.util.ObjectHashMap cannot be cast to org.drools.reteoo.BetaMemory

It appears the problem occurs where there are many rules.  Any ideas?
 
Thanks.
 
 



From: rules-users-boun...@lists.jboss.org on behalf of Jeffrey Schneller
Sent: Fri 2/26/2010 12:18 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] Caching RuleBase


I saw some old thread about caching the rule base on your own.  I have a 
singleton which contains a hashmap to do the caching.  I am using the Guvnor to 
pull my rules from.  This works fine except when the rules change on the 
Guvnor.  When the rule base tries to refresh in my application, I am getting a 
ClassCastException.  Any ideas? 
 
RuleAgent(Assembly) EXCEPTION (Fri Feb 26 12:02:32 EST 2010): 
java.lang.ClassCastException: org.drools.util.ObjectHashMap cannot be cast to 
org.drools.reteoo.BetaMemory. Stack trace should follow.
org.drools.RuntimeDroolsException: java.lang.ClassCastException: 
org.drools.util.ObjectHashMap cannot be cast to org.drools.reteoo.BetaMemory

 
My code to do the caching is below:
 
private HashMap ruleBaseMap = new HashMap();
  // check to see if we already set up this rule base

  if (ruleBaseMap.containsKey(product.getConfigurationRule())) {
   rb = ruleBaseMap.get(product.getConfigurationRule());
  } else {
   
   try {
InitialContext context = new InitialContext();
url = (String) context.lookup("java:comp/env/rules.url");
url = url + product.getConfigurationRule() + "/LATEST";
   } catch (NamingException e1) {
   }
   
   Properties config = new Properties();
   config.setProperty("newInstance", "false");
   config.setProperty("url", url);
   config.setProperty("poll", "300");
   config.setProperty("name", "Assembly");
   RuleAgent agent = RuleAgent.newRuleAgent(config);
   rb = agent.getRuleBase(); 
   
   ruleBaseMap.put(product.getConfigurationRule(), rb);
  }

 
<>___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Caching RuleBase

2010-02-26 Thread Jeffrey Schneller
I saw some old thread about caching the rule base on your own.  I have a 
singleton which contains a hashmap to do the caching.  I am using the Guvnor to 
pull my rules from.  This works fine except when the rules change on the 
Guvnor.  When the rule base tries to refresh in my application, I am getting a 
ClassCastException.  Any ideas? 
 
RuleAgent(Assembly) EXCEPTION (Fri Feb 26 12:02:32 EST 2010): 
java.lang.ClassCastException: org.drools.util.ObjectHashMap cannot be cast to 
org.drools.reteoo.BetaMemory. Stack trace should follow.
org.drools.RuntimeDroolsException: java.lang.ClassCastException: 
org.drools.util.ObjectHashMap cannot be cast to org.drools.reteoo.BetaMemory

 
My code to do the caching is below:
 
private HashMap ruleBaseMap = new HashMap();
  // check to see if we already set up this rule base

  if (ruleBaseMap.containsKey(product.getConfigurationRule())) {
   rb = ruleBaseMap.get(product.getConfigurationRule());
  } else {
   
   try {
InitialContext context = new InitialContext();
url = (String) context.lookup("java:comp/env/rules.url");
url = url + product.getConfigurationRule() + "/LATEST";
   } catch (NamingException e1) {
   }
   
   Properties config = new Properties();
   config.setProperty("newInstance", "false");
   config.setProperty("url", url);
   config.setProperty("poll", "300");
   config.setProperty("name", "Assembly");
   RuleAgent agent = RuleAgent.newRuleAgent(config);
   rb = agent.getRuleBase(); 
   
   ruleBaseMap.put(product.getConfigurationRule(), rb);
  }

 
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Using Collections in LHS

2010-02-23 Thread Jeffrey Schneller
I think what you are looking for is the following.  Someone please
correct me if I am incorrect.

 

when

Order($discount : discount > 10, $items: items)

Item(grade > 3) from $items

then

System.err.print("Discount is not allowed with items having grade 3 or
higher");

 

 

This would fire when an Order has a discount greater than 10 and an
item with a grade greater than 3.

Not sure why you even need the $discount variable.  You could just do
Order(discount > 10, $items : items) for the first line of the when
clause.

 

 

From: rules-users-boun...@lists.jboss.org
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Shabbir Dhari
Sent: Tuesday, February 23, 2010 5:27 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Using Collections in LHS

 

Hi W

I know about case sensitivity issue. How can I combine both Order and
Item in one condition. I tried all possibilities but getting syntax
error.

For example: 

Order ($items : items, $discount : discount > 10, Item(grade > 3) from
$items) // gives error

 

Can please code this condition correctly for me?

 

Dhari

 



Date: Tue, 23 Feb 2010 13:43:01 +0100
From: wolfgang.l...@gmail.com
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Using Collections in LHS

Discount is a field of Order and must not appear in an Item(...).
Probably you want:
   Order  ( $discount : Discount > 10,...

Also, most likely, all your fields need to be written with a lower case
initial letter,
   Order  ( $discount : discount > 10, $items : items)

-W

On Tue, Feb 23, 2010 at 1:11 PM, dhari  wrote:


In this scenario I do have typical Order and Items data structure. I
want to
implement various business rules where I want to check both Order
attributes
and Item attributes together.

Order [ Date, Discount, Amount, Customer, Type, Items]
Item [ Quantity, Rate, ExpiresDate, Grade ]

I am trying to implements following rules but all gives me syntax error.
I
wondering if someone can help me in.


rule one
   when
   Order  ( $discount : Discount, $items : Items)
   Item ($discount > 10 && Grade > 3) from $items
   then
   System.err.print(Discount is not allowed with items having grade
3 or
higher)
end

rule two
   when
   Order  ( $discount : Discount, $items : Items)
   Item ($discount  > 20 || Quantity < 5 ) from $items
   then
   //do some thinge
end
--
View this message in context:
http://n3.nabble.com/Using-Collections-in-LHS-tp386923p386923.html
Sent from the Drools - User mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

 



Find out now Link all your email accounts and social updates with
Hotmail.
 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Rule in decision table

2010-02-19 Thread Jeffrey Schneller
I am trying to write a condition for a decision table and can't seem to
figure out how to do it.

 

I have a global variable called area.  This is in sq. ft.

 

I have a fact called Item which has an attribute called weight.  This is
in grams / sq. ft.

The Item comes from the attribute called value from a fact named Choice
where the sku attribute matches what is in the rule

 

I want to compare the (weight * area) to the parameter for the row.  The
parameter is being passed in as lbs.

 

Here is what I tried for my three condition columns:

 

CONDITION
CONDITION
CONDITION

mm : Choice   

sku
exists(Item(weight * area > ($param * 453.5924)) from mm.value)
exists(Item(weight * area <= ($param * 453.5924)) from mm.value)

 

 

This did not work.  This will work if I remove the formula and just do
something like exists(Item(weight > $param) from mm.value).   So the
syntax is correct except for the comparison that I want to do.

 

Any ideas on how to do this?

 

Thanks.

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Creating excel decision tables

2010-02-02 Thread Jeffrey Schneller
How would you create something similar the below rules in a decision
table.  The value of the ChoiceOption is actually an Interface which
OptionValue and ItemValue bath implement.  Any ideas? 

Thanks.

 

rule 'test'

dialect 'mvel'

when

$o : ChoiceOption(sku=="mount")   

OptionValue(value == "inside") from $o.value

then

log("works");

end

 

rule 'test2'

dialect 'mvel'

when

$o : ChoiceOption(sku=="opt3")   

ItemValue(value == "123") from $o.value

then

log("works");

end

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users