Bug 1100860
| Summary: | CNF Exception during fireAllRules() using OSGi in particular configuration | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Retired] JBoss BPMS Platform 6 | Reporter: | Adam Baxter <abaxter> | ||||||
| Component: | jBPM Core | Assignee: | Mario Fusco <mfusco> | ||||||
| Status: | CLOSED EOL | QA Contact: | Marek Winkler <mwinkler> | ||||||
| Severity: | medium | Docs Contact: | |||||||
| Priority: | high | ||||||||
| Version: | 6.0.1 | CC: | abaxter, cmoulliard, etirelli, mbaluch | ||||||
| Target Milestone: | ER5 | ||||||||
| Target Release: | 6.1.0 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||
| Doc Text: | Story Points: | --- | |||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2020-03-27 18:36:15 UTC | Type: | Bug | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Attachments: |
|
||||||||
|
Description
Adam Baxter
2014-05-23 15:44:36 UTC
Until now, if I try to deploy the project using JBoss Fuse 6.1-379 I get another issue from sonatype aether when the kjar must be loaded Caused by: java.lang.IllegalArgumentException: number of transferred bytes cannot be negative at org.sonatype.aether.util.listener.DefaultTransferEvent.setTransferredBytes(DefaultTransferEvent.java:123)[218:org.kie.scanner.osgi:6.1.0.20140429-1643] at org.sonatype.aether.connector.file.FileRepositoryWorker.run(FileRepositoryWorker.java:299)[218:org.kie.scanner.osgi:6.1.0.20140429-1643] at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)[218:org.kie.scanner.osgi:6.1.0.20140429-1643] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_51] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_51] at java.lang.Thread.run(Thread.java:744)[:1.7.0_51] The workaround to solve this issue is to add DynaMic-Import METADATA to the drools core bundle Check what is the Bundle ID of Drools Core bundle list -t 0 | grep -i drools [ 134] [Active ] [ ] [ 60] Drools :: Core (6.1.0.20140429-1643) [ 135] [Active ] [ ] [ 60] Drools :: Compiler (6.1.0.20140429-1643), Fragments: 136 [ 136] [Resolved ] [ ] [ 60] Drools :: OSGI Integration (6.1.0.20140429-1736), Hosts: 135 JBossFuse:karaf@root> dev:dynamic-import 134 Enabling dynamic imports on bundle org.drools.core [134] We have to investigate why the classloader used is Drools-Core and not the classloader of the bundle of this TLMS project ? If I enable dynamic imports on drools-core, I get the following error: 09:24:20,582 | INFO | l Console Thread | Activator | 263 - org.drools.core - 6.1.0.20140429-1643 | registering core services 09:24:20,587 | INFO | l Console Thread | Activator | 263 - org.drools.core - 6.1.0.20140429-1643 | core services registered 09:24:20,608 | INFO | xFrameworkWiring | BlueprintExtender | 9 - org.apache.aries.blueprint.core - 1.0.1.redhat-610379 | Destroying BlueprintContainer for bundle tlms-secure-rest 09:24:20,618 | INFO | xFrameworkWiring | Activator | 264 - org.drools.compiler - 6.1.0.20140429-1643 | unregistering compiler : org.kie.scanner.KieScannerFactoryServiceImpl@1fb4490b : interface org.kie.api.builder.KieScannerFactoryService 09:24:20,624 | INFO | xFrameworkWiring | BlueprintExtender | 9 - org.apache.aries.blueprint.core - 1.0.1.redhat-610379 | Destroying BlueprintContainer for bundle tlms-data-services 09:24:20,629 | INFO | xFrameworkWiring | BlueprintExtender | 9 - org.apache.aries.blueprint.core - 1.0.1.redhat-610379 | Destroying BlueprintContainer for bundle tlms-fuse-commons 09:24:20,688 | INFO | xFrameworkWiring | BlueprintContainerImpl | 9 - org.apache.aries.blueprint.core - 1.0.1.redhat-610379 | Bundle tlms-secure-rest is waiting for dependencies [(objectClass=com.rgis.tlms.fuse.dao.service.TlmsPersonActivitiesService)] 09:24:20,743 | INFO | xFrameworkWiring | Activator | 264 - org.drools.compiler - 6.1.0.20140429-1643 | registering compiler services 09:24:20,747 | INFO | xFrameworkWiring | Activator | 264 - org.drools.compiler - 6.1.0.20140429-1643 | compiler services registered 09:24:20,913 | INFO | xFrameworkWiring | Activator | 263 - org.drools.core - 6.1.0.20140429-1643 | registering core services 09:24:20,918 | INFO | xFrameworkWiring | Activator | 263 - org.drools.core - 6.1.0.20140429-1643 | core services registered 09:24:20,980 | INFO | xFrameworkWiring | Activator | 291 - org.kie.scanner.osgi - 6.1.0.20140429-1643 | registering kiescanner services 09:24:20,981 | INFO | xFrameworkWiring | Activator | 264 - org.drools.compiler - 6.1.0.20140429-1643 | registering compiler : org.kie.scanner.KieScannerFactoryServiceImpl@7ccef093 : interface org.kie.api.builder.KieScannerFactoryService 09:24:20,985 | INFO | xFrameworkWiring | Activator | 291 - org.kie.scanner.osgi - 6.1.0.20140429-1643 | kiescanner services registered 09:24:21,025 | WARN | xFrameworkWiring | BeanRecipe | 9 - org.apache.aries.blueprint.core - 1.0.1.redhat-610379 | Object to be destroyed is not an instance of UnwrapperedBeanHolder, type: null 09:24:21,025 | ERROR | xFrameworkWiring | BlueprintContainerImpl | 9 - org.apache.aries.blueprint.core - 1.0.1.redhat-610379 | Unable to start blueprint container for bundle tlms-fuse-commons org.osgi.service.blueprint.container.ComponentDefinitionException: Error when instantiating bean brmsUtil of class class com.rgis.tlms.fuse.commons.BRMSUtil at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:333)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_51] at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:676)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:374)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:261)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:270)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:233)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[11:org.apache.aries.util:1.0.1.redhat-610379] at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[11:org.apache.aries.util:1.0.1.redhat-610379] at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[11:org.apache.aries.util:1.0.1.redhat-610379] at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[11:org.apache.aries.util:1.0.1.redhat-610379] at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[11:org.apache.aries.util:1.0.1.redhat-610379] at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1103)[org.apache.felix.framework-4.0.3.redhat-610379.jar:] at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:696)[org.apache.felix.framework-4.0.3.redhat-610379.jar:] at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:484)[org.apache.felix.framework-4.0.3.redhat-610379.jar:] at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4650)[org.apache.felix.framework-4.0.3.redhat-610379.jar:] at org.apache.felix.framework.Felix$4.run(Felix.java:2123)[org.apache.felix.framework-4.0.3.redhat-610379.jar:] at org.apache.felix.framework.Felix.runInContext(Felix.java:2147)[org.apache.felix.framework-4.0.3.redhat-610379.jar:] at org.apache.felix.framework.Felix.startBundle(Felix.java:2121)[org.apache.felix.framework-4.0.3.redhat-610379.jar:] at org.apache.felix.framework.Felix$RefreshHelper.restart(Felix.java:5169)[org.apache.felix.framework-4.0.3.redhat-610379.jar:] at org.apache.felix.framework.Felix.refreshPackages(Felix.java:4373)[org.apache.felix.framework-4.0.3.redhat-610379.jar:] at org.apache.felix.framework.FrameworkWiringImpl.run(FrameworkWiringImpl.java:178)[org.apache.felix.framework-4.0.3.redhat-610379.jar:] at java.lang.Thread.run(Thread.java:744)[:1.7.0_51] Caused by: java.lang.RuntimeException: Cannot find KieModule: com.rgis.tlms.fuse:tlms-fuse-kjar:1.0-SNAPSHOT at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:99) at com.rgis.tlms.fuse.commons.BRMSUtil.<init>(BRMSUtil.java:19) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)[:1.7.0_51] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)[:1.7.0_51] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.7.0_51] at java.lang.reflect.Constructor.newInstance(Constructor.java:526)[:1.7.0_51] at org.apache.aries.blueprint.utils.ReflectionUtils.newInstance(ReflectionUtils.java:329)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at org.apache.aries.blueprint.container.BeanRecipe.newInstance(BeanRecipe.java:962)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:331)[9:org.apache.aries.blueprint.core:1.0.1.redhat-610379] ... 28 more Have you restarted the server JBoss Fuse after doing that ? Is the error still there ? We eventually figured it out. Ignore my last message Charles, The key appears to be initializing the container and scanner in BRMSUtil's constructor. If a singleton pattern is utilized where the container and scanner aren't initialized until after, the problem appears to go away. We're doing some more testing just to make sure. Adam nm Charles,
I'm able to add another problem to the mix. If the kjar is updated while the scanner is running, the module's recompilation will fail.
10:32:05,300 | ERROR | Timer-3 | AbstractKieModule | 267 - org.drools.compiler - 6.0.2.redhat-6 | Unable to build KieBaseModel:reproducer
Unable to resolve ObjectType 'Person' : [Rule name='One']
Unable to resolve ObjectType 'Person' : [Rule name='Two']
Error importing : 'com.rgis.tlms.brms.model.Dependent'
Error importing : 'com.rgis.tlms.brms.model.Person'
10:32:05,300 | INFO | Timer-3 | KieScanner | 269 - org.kie.scanner.osgi - 1.0.0.SNAPSHOT | The following artifacts have been updated: {com.rgis.tlms.fuse:tlms-fuse-kjar:1.0-SNAPSHOT=com.rgis.tlms.fuse:tlms-fuse-kjar:jar:1.0-SNAPSHOT}
10:32:06,784 | INFO | Timer-2 | KieRepositoryImpl | 267 - org.drools.compiler - 6.0.2.redhat-6 | KieModule was added:ZipKieModule[ ReleaseId=com.rgis.tlms.fuse:tlms-fuse-kjar:1.0-SNAPSHOTfile=/home/abaxter/.m2/repository/com/rgis/tlms/fuse/tlms-fuse-kjar/1.0-SNAPSHOT/tlms-fuse-kjar-1.0-SNAPSHOT.jar]
10:32:07,013 | INFO | Timer-2 | KieScanner | 269 - org.kie.scanner.osgi - 1.0.0.SNAPSHOT | The following artifacts have been updated: {com.rgis.tlms.fuse:tlms-fuse-kjar:1.0-SNAPSHOT=com.rgis.tlms.fuse:tlms-fuse-kjar:jar:1.0-SNAPSHOT}
This is with dynamic-import enabled for drools-core
When I enabled dynamic-import on drools-compiler, as well, and this appears to fix the error after I restarted Fuse. Hmm.. now if I update any of the fuse modules, such as the data-services, we start getting some very bizarre class-path related issues. Probably from the dynamic imports. forcing a refresh after the update appears to fix that Marek, engineering is unable to reproduce this problem with latest version. Can you please double check and if you are also unable to reproduce, close this ticket? I have been trying to reproduce the problem, so far I have encountered possible missing imports for kie-ci bundle in drools-compiler and kie-internal. This could cause the need to use dynamic imports. I have filed separate BZ 1187219 for this. I have been trying to reproduce the problem and I am getting the following exception. I have installed the bundle tlms-fuse-kjar, it is ACTIVE. The bundle jar is also accessible in my local Maven repository (~/.m2/repository), so I would expect KIE-CI to download it from there, if it was not found as a bundle. Any clues what I might be doing wrong? Thanks! ERROR: Bundle tlms-data-services [253] Error starting file:/home/mwinkler/work/temp/xxx/jboss-fuse-6.1.1.redhat-412/deploy/tlms-data-services-1.0-SNAPSHOT.jar (org.osgi.framework.BundleException: Activator start error in bundle tlms-data-services [253].) java.lang.RuntimeException: Cannot find KieModule: com.rgis.tlms.fuse:tlms-fuse-kjar:1.0-SNAPSHOT at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:97) at com.rgis.tlms.fuse.commons.BRMSUtil.<init>(BRMSUtil.java:19) at com.rgis.tlms.fuse.dao.service.impl.TlmsPersonActivitiesServiceImpl.getBrmsUtil(TlmsPersonActivitiesServiceImpl.java:24) at com.rgis.tlms.fuse.dao.service.impl.TlmsPersonActivitiesServiceImpl.runRules(TlmsPersonActivitiesServiceImpl.java:44) at com.rgis.tlms.fuse.dao.service.impl.TlmsPersonActivitiesServiceImpl.start(TlmsPersonActivitiesServiceImpl.java:61) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645) at org.apache.felix.framework.Felix.doActivateBundle(Felix.java:2387) at org.apache.felix.framework.Felix$7.call(Felix.java:2325) at org.apache.felix.framework.Felix$6.call(Felix.java:2208) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) kie-ci was not working under osgi because of some missing package imports in the kie-ci-osgi manifest. I fixed it with this commit https://github.com/droolsjbpm/drools/commit/4b6e07c86fc04b0ebfbb8856eef6c22cbd5e2d0b Created attachment 999598 [details] BRMS 6.1.0 ER6 KieScanner warnings I have tried with BRMS 6.1.0 ER6 which fixes a few OSGi-related issues. I was able to deploy the reproducer project successfully, but Fuse log contains a lot of KieScanner related warnings - see the attachment: 16:15:58,283 | WARN | Timer-6 | Sisu | 299 - org.kie.scanner.osgi - 6.2.0.201503032251 | Error injecting: org.apache.maven.execution.DefaultMavenExecutionRequestPopulator com.google.inject.ProvisionException: Guice provision errors: 1) No implementation for org.apache.maven.repository.RepositorySystem was bound. while locating org.apache.maven.execution.DefaultMavenExecutionRequestPopulator ... The next problem is that I am unable to get WSDL from http://localhost:8181/cxf/secrets/tlms-service/run-test/?wsdl - should I use different URL? Empty response is returned, so the service is deployed to some extent. Adam, could you please verify on your side? Or provide information how to obtain WSDL, am I doing something wrong? Thanks! I have just found that SOAP service does not get deployed - when I check the URL http://localhost:8181/cxf/ I am getting the following response: Available SOAP services: Available RESTful services: Endpoint address: http://localhost:8181/cxf/secrets WADL : http://localhost:8181/cxf/secrets?_wadl The Fuse commands I have used to install the reproducer: - features:addurl mvn:org.drools/drools-karaf-features/6.2.0.Final-redhat-2/xml/features - features:install drools-jpa - features:install jbpm // might not be needed - features:install kie-spring // might not be needed - features:install kie-ci - features:addurl mvn:com.rgis.tlms.fuse/tlms-fuse-commons/1.0-SNAPSHOT/xml/features - features:install tlms-fuse-commons - features:addurl mvn:com.rgis.tlms.fuse/tlms-fuse-model/1.0-SNAPSHOT/xml/features - features:install tlms-fuse-model - features:addurl mvn:com.rgis.tlms.fuse/tlms-data-services/1.0-SNAPSHOT/xml/features - features:install tlms-data-services - features:addurl mvn:com.rgis.tlms.fuse/tlms-secure-rest/1.0-SNAPSHOT/xml/features - features:install tlms-secure-rest My bad, the published service is apparently REST service, not a SOAP. When I imported the WADL into SoapUI and made a POST request to http://localhost:8181/cxf/secrets/tlms-service/run-test, the response was the following: HTTP/1.1 200 OK Content-Type: application/json Date: Mon, 09 Mar 2015 16:46:06 GMT Transfer-Encoding: chunked Server: Jetty(8.1.14.v20131031) OK Since Mario confirmed that the warnings in the log are a known issue which should result in fallback to MinimalPomParser bundled with Drools, this is not a serious problem (although users should be aware that MinimalPomParser fails to parse e.g. kJar's parent pom and not rely on dependencies declared in parent pom in their kJars). I have filed documentation BZ 1200099 to cover that. Marking as verified in BRMS 6.1.0 ER6. |