aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikolay Voskresenskiy (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ARIES-1731) Error using Blueprint Spring when Spring 3.x bundles are installed in container
Date Fri, 21 Jul 2017 16:25:00 GMT
Nikolay Voskresenskiy created ARIES-1731:
--------------------------------------------

             Summary: Error using Blueprint Spring when Spring 3.x bundles are installed in
container
                 Key: ARIES-1731
                 URL: https://issues.apache.org/jira/browse/ARIES-1731
             Project: Aries
          Issue Type: Bug
    Affects Versions: blueprint-spring-0.4.0
            Reporter: Nikolay Voskresenskiy


Hi,

When attempting to use Blueprint Spring 0.4.0 with karaf container version 4.0.x i've encountered
the following exceptions:

{code}
2017-07-21 09:31:44,693 | WARN  | pool-29-thread-3 | Activator                        | 32
- org.apache.aries.blueprint.spring - 0.4.0 | Error starting extension: org.apache.servicemix.bundles.spring-jms/4.2.5.RELEASE_1
java.lang.ClassCastException: org.springframework.jms.config.JmsNamespaceHandler cannot be
cast to org.springframework.beans.factory.xml.NamespaceHandler
	at org.apache.aries.blueprint.spring.SpringExtension.start(SpringExtension.java:64)[32:org.apache.aries.blueprint.spring:0.4.0]
	at org.apache.felix.utils.extender.AbstractExtender$1.run(AbstractExtender.java:265)[32:org.apache.aries.blueprint.spring:0.4.0]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_20]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_20]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)[:1.8.0_20]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)[:1.8.0_20]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_20]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_20]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_20]
{code}

{code}
2017-07-21 10:07:13,802 | ERROR | pool-8-thread-1  | BlueprintContainerImpl           | 30
- org.apache.aries.blueprint.core - 1.6.2 | Unable to start blueprint container for bundle
cash-settlement-services/1.0.0.SNAPSHOT
java.lang.IllegalAccessError: tried to access method org.springframework.beans.factory.xml.XmlBeanDefinitionReader.createReaderContext(Lorg/springframework/core/io/Resource;)Lorg/springframework/beans/factory/xml/XmlReaderContext;
from class org.apache.aries.blueprint.spring.BlueprintNamespaceHandler
	at org.apache.aries.blueprint.spring.BlueprintNamespaceHandler.createSpringParserContext(BlueprintNamespaceHandler.java:260)
	at org.apache.aries.blueprint.spring.BlueprintNamespaceHandler.getOrCreateParserContext(BlueprintNamespaceHandler.java:159)
	at org.apache.aries.blueprint.spring.BlueprintNamespaceHandler.parse(BlueprintNamespaceHandler.java:104)
	at org.apache.aries.blueprint.parser.Parser.parseCustomElement(Parser.java:1369)[30:org.apache.aries.blueprint.core:1.6.2]
	at org.apache.aries.blueprint.parser.Parser.loadComponents(Parser.java:427)[30:org.apache.aries.blueprint.core:1.6.2]
	at org.apache.aries.blueprint.parser.Parser.populate(Parser.java:331)[30:org.apache.aries.blueprint.core:1.6.2]
	at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:349)[30:org.apache.aries.blueprint.core:1.6.2]
	at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:276)[30:org.apache.aries.blueprint.core:1.6.2]
	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:300)[30:org.apache.aries.blueprint.core:1.6.2]
	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:269)[30:org.apache.aries.blueprint.core:1.6.2]
	at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:265)[30:org.apache.aries.blueprint.core:1.6.2]
	at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:255)[30:org.apache.aries.blueprint.core:1.6.2]
	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[43:org.apache.aries.util:1.1.1]
	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[43:org.apache.aries.util:1.1.1]
	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[43:org.apache.aries.util:1.1.1]
	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[43:org.apache.aries.util:1.1.1]
	at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[43:org.apache.aries.util:1.1.1]
	at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179)[org.apache.felix.framework-5.4.0.jar:]
	at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:731)[org.apache.felix.framework-5.4.0.jar:]
	at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:486)[org.apache.felix.framework-5.4.0.jar:]
	at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4541)[org.apache.felix.framework-5.4.0.jar:]
	at org.apache.felix.framework.Felix.startBundle(Felix.java:2172)[org.apache.felix.framework-5.4.0.jar:]
	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)[org.apache.felix.framework-5.4.0.jar:]
	at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)[org.apache.felix.framework-5.4.0.jar:]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1286)[8:org.apache.karaf.features.core:4.0.7]
	at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:846)[8:org.apache.karaf.features.core:4.0.7]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1176)[8:org.apache.karaf.features.core:4.0.7]
	at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1074)[8:org.apache.karaf.features.core:4.0.7]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_20]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_20]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_20]
	at java.lang.Thread.run(Thread.java:745)[:1.8.0_20]
{code}

The root cause for these exception is that the bundle attempts to use spring-beans version
3.x instead of 4.x. Spring 3.x was present in the container in my case.due to another dependency
(e.g. camel-jms/2.16.3).

Spring 3 beans are apparently incompatible with the code of Blueprint Spring extender, and
consequently i propose to set the correct package filter in the OSGI package imports of blueprint-spring
module to avoid this issue

The current workaround is to explicitly ban spring 3.x from the container assembly through
karaf assembly configuration, which is far from ideal



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message