[ 
https://issues.apache.org/jira/browse/AMQ-6301?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15296276#comment-15296276
 ] 

Christopher L. Shannon commented on AMQ-6301:
---------------------------------------------

There is still an issue running the ActiveMQBrokerNdCamelFeatureTest.  That 
test is currently ignored but I re-enabled it against this patch (this test 
should be enabled but was temporarily disabled because of the Karaf issues)

The problem is now that spring dm is embedded, it avoids the Karaf issue but 
the OsgiBundleXmlApplicationContext still has a dependency on Spring and 
doesn't work properly with Spring 4.  Specifically I'm seeing a 
NoSuchMethodError because it relies on a deprecated method that was removed.  
Spring DM probably needs to go away entirely for the correct fix.

{noformat}
java.lang.NoSuchMethodError: 
org.springframework.core.CollectionFactory.createConcurrentMap(I)Lorg/springframework/core/ConcurrentMap;
        at 
org.springframework.osgi.util.internal.ClassUtils.<clinit>(ClassUtils.java:164)
        at 
org.springframework.osgi.context.support.TrackingUtil.getService(TrackingUtil.java:160)
        at 
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.lookupNamespaceHandlerResolver(OsgiBundleXmlApplicationContext.java:243)
        at 
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.createNamespaceHandlerResolver(OsgiBundleXmlApplicationContext.java:201)
        at 
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.access$000(OsgiBundleXmlApplicationContext.java:60)
        at 
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext$1.run(OsgiBundleXmlApplicationContext.java:124)
        at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_60]
        at 
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:119)
        at 
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
        at 
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:605)
        at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:509)
        at 
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$301(AbstractDelegatedExecutionApplicationContext.java:69)
        at 
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$1.run(AbstractDelegatedExecutionApplicationContext.java:186)
        at 
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
        at 
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.normalRefresh(AbstractDelegatedExecutionApplicationContext.java:182)
        at 
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$NoDependenciesWaitRefreshExecutor.refresh(AbstractDelegatedExecutionApplicationContext.java:89)
        at 
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
        at 
org.apache.activemq.osgi.ActiveMQServiceFactory.updated(ActiveMQServiceFactory.java:102)
        at 
org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.updated(ManagedServiceFactoryTracker.java:159)[7:org.apache.felix.configadmin:1.8.8]
        at 
org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.provideConfiguration(ManagedServiceFactoryTracker.java:93)[7:org.apache.felix.configadmin:1.8.8]
        at 
org.apache.felix.cm.impl.ConfigurationManager$UpdateConfiguration.run(ConfigurationManager.java:1753)[7:org.apache.felix.configadmin:1.8.8]
        at 
org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:143)[7:org.apache.felix.configadmin:1.8.8]
        at 
org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:110)[7:org.apache.felix.configadmin:1.8.8]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_60]
{noformat}

> Embed spring-dm in activemq-osgi to avoid loading spring-dm in Karaf
> --------------------------------------------------------------------
>
>                 Key: AMQ-6301
>                 URL: https://issues.apache.org/jira/browse/AMQ-6301
>             Project: ActiveMQ
>          Issue Type: Improvement
>          Components: OSGi/Karaf
>    Affects Versions: 5.13.0
>            Reporter: Seth Leger
>              Labels: patch
>
> Embed spring-dm in activemq-osgi to avoid loading spring-dm in Karaf
> In commit 3a6d67e8f95320bea91b7c7106173c9b34773bc5, a test was fixed in issue 
> AMQ-4727 by reusing the spring-dm OsgiBundleXmlApplicationContext class 
> inside the ActiveMQServiceFactory managed service factory.
> To satisfy the import packages for activemq-osgi, the 'spring-dm' Karaf 
> feature was added to the main 'activemq-client' feature.
> This is problematic because loading the 'spring-dm' Karaf feature enables the 
> Spring DM deployer. This deployer is unnecessary in environments that rely on 
> Blueprint or CDI wiring and it may unexpectedly activate Spring DM bundles in 
> those environments. Because spring-dm was compiled against older versions of 
> Spring 3.0 and 3.1, it can also cause older versions of Spring features to be 
> loaded into the container.
> To avoid using the ‘spring-dm’ Karaf feature to provide the classes, I 
> propose embedding the spring-dm bundles inside activemq-osgi. Since they are 
> only used as library code to provide the BundleContext when parsing the 
> BrokerService context, they can be embedded safely without any dependency 
> issues.
> This is the root cause of the following issue:
> http://karaf.922171.n3.nabble.com/Karaf-4-0-3-unable-to-start-bundle-activemq-osgi-5-13-0-td4044640.html



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to