| Summary: | Issues with knowledge agent when using temporal constraints | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [JBoss] JBoss Enterprise BRMS Platform 5 | Reporter: | Jaroslaw Kijanowski <kijanowski> | ||||||||||
| Component: | BRE (Expert, Fusion) | Assignee: | Nobody <nobody> | ||||||||||
| Status: | VERIFIED --- | QA Contact: | Lukáš Petrovický <lpetrovi> | ||||||||||
| Severity: | unspecified | Docs Contact: | |||||||||||
| Priority: | high | ||||||||||||
| Version: | 5.0.1 | CC: | atangrin, kverlaen, ldimaggi, lpetrovi, manstis, trikkola | ||||||||||
| Target Milestone: | --- | ||||||||||||
| Target Release: | future | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| URL: | http://jira.jboss.org/jira/browse/BRMS-239 | ||||||||||||
| Whiteboard: | |||||||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||||||
| Doc Text: |
Using temporal constraints with the knowledge agent resulted in a java.lang.RuntimeException due to a missing domain on the class path. This happened when the facts were imported as a jar file, and it has been resolved by making sure the evaluator registry is populated during package deserialization.
|
Story Points: | --- | ||||||||||
| Clone Of: | Environment: | ||||||||||||
| Last Closed: | Type: | Bug | |||||||||||
| Regression: | --- | Mount Type: | --- | ||||||||||
| Documentation: | --- | CRM: | |||||||||||
| Verified Versions: | Category: | --- | |||||||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||||||
| Attachments: |
|
||||||||||||
|
Description
Jaroslaw Kijanowski
2009-10-26 17:45:21 UTC
might be related Link: Added: This issue is related to JBRULES-2278 #1 might go away if I use an uploaded model jar instead of a declared fact model, since now I end up with two 'declare' statements: declare TestModel @role(event) @timestamp(event_date) @expires(5m) end declare TestModel id: Integer event_date: java.util.Date test: String end Will verify that... #1 goes away when I use a model jar. The package source contains only one 'declare' statement then. When I want to use a declarative model I end up with two 'declare' statements which is bad. #2 is a bug, on the agent side I guess? I attach a repo zip to make it easier to reproduce. It shows up when I use temporal constraints like 'this after [0s,1m] $t1'. No issues with entry-points found. Attachment: Added: repository_export.zip Attachment: Added: CEP.java Release Notes Text: Added: test Release Notes Text: Removed: test Release Notes Docs Status: Added: Not Yet Documented Writer: Added: dlesage This is not a blocker for BRMS 5.1.0, moving to future. QE should retest with 5.3 - if the bug is still present we should open a linked GUVNOR bug. I checked for the core cause of this bug and found out that the problem is missing domain on classpath. When you import you facts to Guvnor as a jar they are not included into resulting package. Therefore when trying to access the rules in Guvnor you have to have the necessary jar (or .class files) on classpath. This gives us two options: - document that when you import model as a jar you have to add it to the classpath of final application, - try adding jars to the package and somehow add them to the classpath in runtime. I haven't tested with Drools 5.3, but both BRMS-5.1.0.GA and BRMS-5.2.0.ER3 behave the same way. #1 looks like a Guvnor problem. It should not be generating 2 incompatible declare statements. The engine merges compatible declare statements properly, but when it sees 2 declares for the same object type, one referencing a model in the classpath and the other generating a bean with fields, one declaring the type as an event and the other as a regular fact, it can't merge them automatically because the runtime semantics of them are completely different. #2 works as designed. If the user has the domain model in a jar, it is his responsibility to deploy that jar into the runtime environment. We can't ship it with the package as we risk classpath clashes. This should be just documented as so, as suggested by Tomas. Can someone in the Guvnor team take this over to fix #1, plz? (In reply to comment #12) > #1 looks like a Guvnor problem. It should not be generating 2 incompatible > declare statements. The engine merges compatible declare statements properly, > but when it sees 2 declares for the same object type, one referencing a model > in the classpath and the other generating a bean with fields, one declaring the > type as an event and the other as a regular fact, it can't merge them > automatically because the runtime semantics of them are completely different. > Can someone in the Guvnor team take this over to fix #1, plz? Jervis, would someone from the Guvnor team please take a look at this? Thanks! Michael, can you or someone from Guvnor take a look at this one, please? Thank you. Created attachment 573789 [details]
Class demonstrating the problem
Created attachment 573790 [details]
Binary package
This is a problem deserializing packages. Attachment CEP2.java and withcep.pkg are files that replicate the problem without needing Guvnor. There is a specific set of requirements for the deserialization to fail:- (1) KnowledgeBuilderFactory.newKnowledgeBuilder() must not have been called in the JVM otherwise the test passes. (2) A KnowledgeBaseConfiguration containing the option EventProcessingOption.STREAM has to be provided otherwise the test passes. Edson, I could not add a new test to CepEspTest or a new class entirely as all of these tests call KnowledgeBuilderFactory.newKnowledgeBuilder() that causes the Operator.CACHE to be populated correctly by EvaluatorRegistry and hence the problem not to occur. The class CEP2 contains more information as to what the problem is.
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
New Contents:
Using temporal constraints with the knowledge agent results in a java.lang.RuntimeException due to a missing domain on the class path. This happens when the facts are imported as a jar file, and the workaround is to copy the jar file to the classpath of the final application.
I "fixed" this problem by making sure the evaluator registry is populated during package deserialization. This fix is specific to 5.3.x version as in versions 5.4.x and newer, the KnowledgeAgent uses the proper API for deserialization. Thanks for all the information on this bug and specially to Michael for the detailed analysis on the causes for this problem. Verified in BRMS-5.3.1-ER1 |