Hide Forgot
Description of problem: KieScanner does not recognize presence of a new class file in Jar, when new Jar is deployed, and kieSession still works with old class file. Version-Release number of selected component (if applicable): Drools 6.0.0-SNAPSHOT Drools 6.0.0.ER4 How reproducible: Pull request #278 submited in Drools. Steps to Reproduce: 1. Write a test with KieScanner for specific KieContainer. Deploy artifact with module that contains rule file and class file. Class file contains one class with one static method that returns some number. Rule file contains one rule. Rule adds returned value from the static method to global variable. Create new KieSession from KieContainer and check that the number is returned. 2. Deploy new artifact with module that contains same rule and class file with method that returns some other number. Create new KieSession from KieContainer and check that the new number is returned. 3. Run test. Actual results: Old value is returned. Expected results: New value should be returned. Additional info:
We were already aware of this issue and the fix could be very difficult. The main problem is that the old Java class is loaded in the class loader and it is not possible to remove it form there and replace with a new one. We should create a way to dump the old class loader, but this cannot work if the KieBase already exists.
Fixed by https://github.com/droolsjbpm/drools/commit/275e7afd7
Tested on BRMS 6.0.0.ER7, but it still doesn't work for me. KieRepositoryScannerTest.testKScannerWithKJarContainingClasses works fine, but test from Pull request #278 still fails.
This problem arises when only java classes are changed but not the drls using them. Fixed by https://github.com/droolsjbpm/drools/commit/e4fb59716
This no longer has a target release of 6.0.0.
Verified on BRMS 6.0.1.ER1.