[
https://jira.jboss.org/browse/JBESB-3402?page=com.atlassian.jira.plugin.s...
]
David Ward closed JBESB-3402.
-----------------------------
Resolution: Done
Committed revision 34368.
DroolsRuleAgentResourceClassLoader was renamed to RulesClassLoader and given the
additional required functionality, then
ClassLoaderCacheOption.PROPERTY_NAME="false" and RulesClassLoader were applied
to KnowledgeBuilderConfiguration creation in both DroolsRuleBaseHelper and
DroolsRuleAgentHelper.
All quickstarts have been re-tested under ESB deployment (and redeployment!) in JBoss AS
4.2.3 / Sun JDK 1.5.0_22 and JBoss AS 5.1.0 / Sun JDK 1.6.0_20. All unit tests still pass
as well.
LHS of rules failing to match on ESB redeploy
---------------------------------------------
Key: JBESB-3402
URL:
https://jira.jboss.org/browse/JBESB-3402
Project: JBoss ESB
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Content Based Routing
Reporter: David Ward
Assignee: David Ward
Priority: Critical
Fix For: 4.9
It became evident that Drools caches ClassLoaders by default.
The problem that showcased this was that on redeploy of the business_rules* quickstarts,
none of the LHS of the DRL rules were matching. When we deploy a new ESB archive, there
is a new ClassLoader. However Drools was holding onto the old ClassLoader. Because an
Object is only ever "equal" to another Object if it came from the same
ClassLoader, none of the Objects on the LHS matched the expression.
Two things need to happen to fix this problem:
1. KnowledgeBuilderConfigurations need to be created with a Properties argument
containing ClassLoaderCacheOption.PROPERTY_NAME="false".
2. KnowledgeBuilderConfigurations need to be created with a ClassLoader argument
containing a custom ESB ClassLoader, which under-the-hood uses the LifecycleResource
mechanism to associate the original Thread ContextClassLoader (the deployment's
ClassLoader) with calls to loadClass(), findResource(), etc. Luckily most of what is
needed here already exists in the DroolsRuleAgentHelper code.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira