You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Christian Posta <ch...@gmail.com> on 2014/02/07 01:53:54 UTC

Re: Error using OSGi services in activemq spring xml

Christopher,

Any way you can help me reproduce this to help you out?

On Thu, Jan 30, 2014 at 7:30 AM, Christopher Arnold <ca...@ptc.com> wrote:
> karaf@root()> la | grep -i xbean
> 111 | Active   |  20 | 3.16.0                | Apache XBean OSGI Bundle
> Utilities
> 112 | Active   |  20 | 3.16.0                | Apache XBean :: ASM 4 shaded
> (repackaged)
> 113 | Active   |  20 | 3.16                  | Apache XBean :: Reflect
> 114 | Active   |  20 | 3.16.0                | Apache XBean :: Finder shaded
> (repackaged)
> 186 | Active   |  50 | 3.14.0                | Apache XBean :: Spring
>
> -Chris
>
>
> On 01/30/2014 08:13 AM, Jean-Baptiste Onofré wrote:
>>
>> Hi Christopher,
>>
>> Could you do:
>>
>> la|grep -i xbean
>>
>> ?
>>
>> Regards
>> JB
>>
>> On 01/30/2014 03:10 PM, Christopher Arnold wrote:
>>>
>>>
>>> I'm attempting to configure a ActiveMQ broker in Karaf for SSL using
>>> encrypted
>>> properties for the keystore/truststore passwords.  These properties were
>>> encrypted using Jasypt and we have a bundle responsible for the handling
>>> of the jasypt password that exports a PBEConfig as an OSGi service.  Now
>>> I'm trying to reference that service in my activemq.xml to decrypt the
>>> properties and I'm getting the following error on startup:
>>>
>>> 2014-01-29 13:28:54,674 | ERROR | ctivemq.server]) |
>>> configadmin                      | 43 - org.apache.felix.configadmin -
>>> 1.6.0 | [org.osgi.service.cm.ManagedServiceFactory, id=599,
>>> bundle=187/mvn:org.apache.activemq/activemq-osgi/5.9.0]: Updating
>>> configuration
>>> org.apache.activemq.server.772feee5-3a63-4786-91fb-950934523291 caused a
>>> problem: Cannot start the broker
>>> org.osgi.service.cm.ConfigurationException: null : Cannot start the
>>> broker
>>>          at
>>>
>>> org.apache.activemq.osgi.ActiveMQServiceFactory.updated(ActiveMQServiceFactory.java:110)[187:org.apache.activemq.activemq-osgi:5.9.0]
>>>
>>>          at Proxy04fd69e0_a37e_44e9_a755_4652d9c38525.updated(Unknown
>>> Source)[:]
>>>          at
>>>
>>> org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.provideConfiguration(ManagedServiceFactoryTracker.java:88)[43:org.apache.felix.configadmin:1.6.0]
>>>
>>>          at
>>>
>>> org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceFactoryUpdate.provide(ConfigurationManager.java:1593)[43:org.apache.felix.configadmin:1.6.0]
>>>
>>>          at
>>>
>>> org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceFactoryUpdate.run(ConfigurationManager.java:1536)[43:org.apache.felix.configadmin:1.6.0]
>>>
>>>          at
>>>
>>> org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:103)[43:org.apache.felix.configadmin:1.6.0]
>>>
>>>          at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]
>>> Caused by:
>>> org.springframework.beans.factory.BeanDefinitionStoreException:
>>> Unrecognized xbean namespace mapping:
>>> http://www.springframework.org/schema/osgi
>>>          at
>>>
>>> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:284)[186:org.apache.xbean.spring:3.14.0]
>>>
>>>          at
>>>
>>> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:156)[186:org.apache.xbean.spring:3.14.0]
>>>
>>>          at
>>>
>>> org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:49)[186:org.apache.xbean.spring:3.14.0]
>>>
>>>          at
>>>
>>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1438)[66:org.springframework.beans:3.2.4.RELEASE]
>>>
>>>          at
>>>
>>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)[66:org.springframework.beans:3.2.4.RELEASE]
>>>
>>>          at
>>>
>>> org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseBeanDefinitions(XBeanBeanDefinitionDocumentReader.java:84)[186:org.apache.xbean.spring:3.14.0]
>>>
>>>          at
>>>
>>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)[66:org.springframework.beans:3.2.4.RELEASE]
>>>
>>>          at
>>>
>>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)[66:org.springframework.beans:3.2.4.RELEASE]
>>>
>>>          at
>>>
>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)[66:org.springframework.beans:3.2.4.RELEASE]
>>>
>>>          at
>>>
>>> org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.registerBeanDefinitions(XBeanXmlBeanDefinitionReader.java:79)[186:org.apache.xbean.spring:3.14.0]
>>>
>>>          at
>>>
>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)[66:org.springframework.beans:3.2.4.RELEASE]
>>>
>>>          at
>>>
>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[66:org.springframework.beans:3.2.4.RELEASE]
>>>
>>>          at
>>>
>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[66:org.springframework.beans:3.2.4.RELEASE]
>>>
>>>          at
>>>
>>> org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:111)[186:org.apache.xbean.spring:3.14.0]
>>>
>>>          at
>>>
>>> org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:104)[186:org.apache.xbean.spring:3.14.0]
>>>
>>>          at
>>>
>>> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[68:org.springframework.context:3.2.4.RELEASE]
>>>
>>>          at
>>>
>>> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)[68:org.springframework.context:3.2.4.RELEASE]
>>>
>>>          at
>>>
>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)[68:org.springframework.context:3.2.4.RELEASE]
>>>
>>>          at
>>>
>>> org.apache.activemq.osgi.ActiveMQServiceFactory.updated(ActiveMQServiceFactory.java:90)[187:org.apache.activemq.activemq-osgi:5.9.0]
>>>
>>>          ... 6 more
>>>
>>> relevant part of activemq.xml:
>>>
>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>      xmlns:osgi="http://www.springframework.org/schema/osgi"
>>>      xsi:schemaLocation="
>>>        http://www.springframework.org/schema/beans
>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>        http://activemq.apache.org/schema/core
>>> http://activemq.apache.org/schema/core/activemq-core.xsd
>>>        http://www.springframework.org/schema/osgi
>>> http://www.springframework.org/schema/osgi/spring-osgi.xsd
>>>      ">
>>>
>>>    <osgi:reference id="pbeConfig"
>>> interface="org.jasypt.encryption.pbe.config.StringPBEConfig"/>
>>>
>>>    <bean id="encryptor"
>>> class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
>>>      <property name="config" ref="pbeConfig"/>
>>>    </bean>
>>>
>>>    <bean
>>>
>>> class="org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer">
>>>
>>>      <constructor-arg ref="encryptor"/>
>>>      <property name="location">
>>> <value>file:${karaf.base}/etc/ptc/ptc.properties</value>
>>>      </property>
>>>    </bean>
>>>
>>> ...snip
>>>
>>> I've confirmed that the spring-osgi-extenders bundle is present and
>>> started before the activemq-osgi bundle.  Any ideas why it can't find
>>> the namespace handler?
>>>
>>> ActiveMQ 5.9.0, Karaf 3.0.0
>>>
>>> Thanks,
>>> -Chris
>>>
>>>
>>>
>>
>



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta

Re: Error using OSGi services in activemq spring xml

Posted by Christopher Arnold <ca...@ptc.com>.
JB,

I tried switching to Equinox and I don't see the error, however activemq 
startup seems to hang.  activemq:list --jmxlocal doesn't list any 
brokers and nothing is listening on 61616.  No errors in log file, but 
here's the last few statements that seems relevant to ActiveMQ

2014-02-07 08:14:13,485 | INFO  | ctivemq.server]) | ActiveMQServiceFactory           | 107 - org.apache.activemq.activemq-osgi - 5.9.0 | Starting broker amq-broker
2014-02-07 08:14:13,523 | INFO  | ctivemq.server]) | ActiveMQServiceFactory$1         | 96 - org.springframework.context - 3.2.4.RELEASE | Refreshing org.apache.activemq.osgi.ActiveMQServiceFactory$1@688b5d36: startup date [Fri Feb 07 08:14:13 CST 2014]; root of context hierarchy
2014-02-07 08:14:13,598 | INFO  | ctivemq.server]) | XBeanXmlBeanDefinitionReader     | 94 - org.springframework.beans - 3.2.4.RELEASE | Loading XML bean definitions from file [/mnt/disk1/home/carnold/sandbox/amq-test/apache-karaf-3.0.0/etc/activemq.xml]

Christian,

Here's a list of steps that reproduce this on my box:

1) unpack and startup apache-karaf distribution
2) run the following commands:
     feature:install jasypt-encryption
     feature:repo-add activemq 5.9.0
     feature:install activemq-broker-noweb
     bundle:install -s 
mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jasypt-spring31/1.9.1_1
3) shutdown karaf
4) copy blueprint.xml to deploy/ and activemq.xml to etc/ (files attached)
5) start karaf

-Chris

On 02/06/2014 08:27 PM, Jean-Baptiste Onofré wrote:
> Hi guys,
>
> I would try to restart in a clean state with purging the data folder.
>
> We have some bundle cache corruption issue on Karaf 3.0.0 with Felix 
> now (I'm working on it).
>
> @Christopher, could you do a try with Equinox ?
>
> Thanks,
> Regards
> JB
>
> On 02/07/2014 01:53 AM, Christian Posta wrote:
>> Christopher,
>>
>> Any way you can help me reproduce this to help you out?
>>
>> On Thu, Jan 30, 2014 at 7:30 AM, Christopher Arnold <ca...@ptc.com> 
>> wrote:
>>> karaf@root()> la | grep -i xbean
>>> 111 | Active   |  20 | 3.16.0                | Apache XBean OSGI Bundle
>>> Utilities
>>> 112 | Active   |  20 | 3.16.0                | Apache XBean :: ASM 4 
>>> shaded
>>> (repackaged)
>>> 113 | Active   |  20 | 3.16                  | Apache XBean :: Reflect
>>> 114 | Active   |  20 | 3.16.0                | Apache XBean :: 
>>> Finder shaded
>>> (repackaged)
>>> 186 | Active   |  50 | 3.14.0                | Apache XBean :: Spring
>>>
>>> -Chris
>>>
>>>
>>> On 01/30/2014 08:13 AM, Jean-Baptiste Onofré wrote:
>>>>
>>>> Hi Christopher,
>>>>
>>>> Could you do:
>>>>
>>>> la|grep -i xbean
>>>>
>>>> ?
>>>>
>>>> Regards
>>>> JB
>>>>
>>>> On 01/30/2014 03:10 PM, Christopher Arnold wrote:
>>>>>
>>>>>
>>>>> I'm attempting to configure a ActiveMQ broker in Karaf for SSL using
>>>>> encrypted
>>>>> properties for the keystore/truststore passwords.  These 
>>>>> properties were
>>>>> encrypted using Jasypt and we have a bundle responsible for the 
>>>>> handling
>>>>> of the jasypt password that exports a PBEConfig as an OSGi 
>>>>> service.  Now
>>>>> I'm trying to reference that service in my activemq.xml to decrypt 
>>>>> the
>>>>> properties and I'm getting the following error on startup:
>>>>>
>>>>> 2014-01-29 13:28:54,674 | ERROR | ctivemq.server]) |
>>>>> configadmin                      | 43 - 
>>>>> org.apache.felix.configadmin -
>>>>> 1.6.0 | [org.osgi.service.cm.ManagedServiceFactory, id=599,
>>>>> bundle=187/mvn:org.apache.activemq/activemq-osgi/5.9.0]: Updating
>>>>> configuration
>>>>> org.apache.activemq.server.772feee5-3a63-4786-91fb-950934523291 
>>>>> caused a
>>>>> problem: Cannot start the broker
>>>>> org.osgi.service.cm.ConfigurationException: null : Cannot start the
>>>>> broker
>>>>>           at
>>>>>
>>>>> org.apache.activemq.osgi.ActiveMQServiceFactory.updated(ActiveMQServiceFactory.java:110)[187:org.apache.activemq.activemq-osgi:5.9.0] 
>>>>>
>>>>>
>>>>>           at 
>>>>> Proxy04fd69e0_a37e_44e9_a755_4652d9c38525.updated(Unknown
>>>>> Source)[:]
>>>>>           at
>>>>>
>>>>> org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.provideConfiguration(ManagedServiceFactoryTracker.java:88)[43:org.apache.felix.configadmin:1.6.0] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceFactoryUpdate.provide(ConfigurationManager.java:1593)[43:org.apache.felix.configadmin:1.6.0] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceFactoryUpdate.run(ConfigurationManager.java:1536)[43:org.apache.felix.configadmin:1.6.0] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:103)[43:org.apache.felix.configadmin:1.6.0] 
>>>>>
>>>>>
>>>>>           at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]
>>>>> Caused by:
>>>>> org.springframework.beans.factory.BeanDefinitionStoreException:
>>>>> Unrecognized xbean namespace mapping:
>>>>> http://www.springframework.org/schema/osgi
>>>>>           at
>>>>>
>>>>> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:284)[186:org.apache.xbean.spring:3.14.0] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:156)[186:org.apache.xbean.spring:3.14.0] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:49)[186:org.apache.xbean.spring:3.14.0] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1438)[66:org.springframework.beans:3.2.4.RELEASE] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)[66:org.springframework.beans:3.2.4.RELEASE] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseBeanDefinitions(XBeanBeanDefinitionDocumentReader.java:84)[186:org.apache.xbean.spring:3.14.0] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)[66:org.springframework.beans:3.2.4.RELEASE] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)[66:org.springframework.beans:3.2.4.RELEASE] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)[66:org.springframework.beans:3.2.4.RELEASE] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.registerBeanDefinitions(XBeanXmlBeanDefinitionReader.java:79)[186:org.apache.xbean.spring:3.14.0] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)[66:org.springframework.beans:3.2.4.RELEASE] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[66:org.springframework.beans:3.2.4.RELEASE] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[66:org.springframework.beans:3.2.4.RELEASE] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:111)[186:org.apache.xbean.spring:3.14.0] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:104)[186:org.apache.xbean.spring:3.14.0] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[68:org.springframework.context:3.2.4.RELEASE] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)[68:org.springframework.context:3.2.4.RELEASE] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)[68:org.springframework.context:3.2.4.RELEASE] 
>>>>>
>>>>>
>>>>>           at
>>>>>
>>>>> org.apache.activemq.osgi.ActiveMQServiceFactory.updated(ActiveMQServiceFactory.java:90)[187:org.apache.activemq.activemq-osgi:5.9.0] 
>>>>>
>>>>>
>>>>>           ... 6 more
>>>>>
>>>>> relevant part of activemq.xml:
>>>>>
>>>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>> xmlns:osgi="http://www.springframework.org/schema/osgi"
>>>>>       xsi:schemaLocation="
>>>>>         http://www.springframework.org/schema/beans
>>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>>>         http://activemq.apache.org/schema/core
>>>>> http://activemq.apache.org/schema/core/activemq-core.xsd
>>>>>         http://www.springframework.org/schema/osgi
>>>>> http://www.springframework.org/schema/osgi/spring-osgi.xsd
>>>>>       ">
>>>>>
>>>>>     <osgi:reference id="pbeConfig"
>>>>> interface="org.jasypt.encryption.pbe.config.StringPBEConfig"/>
>>>>>
>>>>>     <bean id="encryptor"
>>>>> class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
>>>>>       <property name="config" ref="pbeConfig"/>
>>>>>     </bean>
>>>>>
>>>>>     <bean
>>>>>
>>>>> class="org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer"> 
>>>>>
>>>>>
>>>>>       <constructor-arg ref="encryptor"/>
>>>>>       <property name="location">
>>>>> <value>file:${karaf.base}/etc/ptc/ptc.properties</value>
>>>>>       </property>
>>>>>     </bean>
>>>>>
>>>>> ...snip
>>>>>
>>>>> I've confirmed that the spring-osgi-extenders bundle is present and
>>>>> started before the activemq-osgi bundle.  Any ideas why it can't find
>>>>> the namespace handler?
>>>>>
>>>>> ActiveMQ 5.9.0, Karaf 3.0.0
>>>>>
>>>>> Thanks,
>>>>> -Chris
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>>
>>
>


Re: Error using OSGi services in activemq spring xml

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi guys,

I would try to restart in a clean state with purging the data folder.

We have some bundle cache corruption issue on Karaf 3.0.0 with Felix now 
(I'm working on it).

@Christopher, could you do a try with Equinox ?

Thanks,
Regards
JB

On 02/07/2014 01:53 AM, Christian Posta wrote:
> Christopher,
>
> Any way you can help me reproduce this to help you out?
>
> On Thu, Jan 30, 2014 at 7:30 AM, Christopher Arnold <ca...@ptc.com> wrote:
>> karaf@root()> la | grep -i xbean
>> 111 | Active   |  20 | 3.16.0                | Apache XBean OSGI Bundle
>> Utilities
>> 112 | Active   |  20 | 3.16.0                | Apache XBean :: ASM 4 shaded
>> (repackaged)
>> 113 | Active   |  20 | 3.16                  | Apache XBean :: Reflect
>> 114 | Active   |  20 | 3.16.0                | Apache XBean :: Finder shaded
>> (repackaged)
>> 186 | Active   |  50 | 3.14.0                | Apache XBean :: Spring
>>
>> -Chris
>>
>>
>> On 01/30/2014 08:13 AM, Jean-Baptiste Onofré wrote:
>>>
>>> Hi Christopher,
>>>
>>> Could you do:
>>>
>>> la|grep -i xbean
>>>
>>> ?
>>>
>>> Regards
>>> JB
>>>
>>> On 01/30/2014 03:10 PM, Christopher Arnold wrote:
>>>>
>>>>
>>>> I'm attempting to configure a ActiveMQ broker in Karaf for SSL using
>>>> encrypted
>>>> properties for the keystore/truststore passwords.  These properties were
>>>> encrypted using Jasypt and we have a bundle responsible for the handling
>>>> of the jasypt password that exports a PBEConfig as an OSGi service.  Now
>>>> I'm trying to reference that service in my activemq.xml to decrypt the
>>>> properties and I'm getting the following error on startup:
>>>>
>>>> 2014-01-29 13:28:54,674 | ERROR | ctivemq.server]) |
>>>> configadmin                      | 43 - org.apache.felix.configadmin -
>>>> 1.6.0 | [org.osgi.service.cm.ManagedServiceFactory, id=599,
>>>> bundle=187/mvn:org.apache.activemq/activemq-osgi/5.9.0]: Updating
>>>> configuration
>>>> org.apache.activemq.server.772feee5-3a63-4786-91fb-950934523291 caused a
>>>> problem: Cannot start the broker
>>>> org.osgi.service.cm.ConfigurationException: null : Cannot start the
>>>> broker
>>>>           at
>>>>
>>>> org.apache.activemq.osgi.ActiveMQServiceFactory.updated(ActiveMQServiceFactory.java:110)[187:org.apache.activemq.activemq-osgi:5.9.0]
>>>>
>>>>           at Proxy04fd69e0_a37e_44e9_a755_4652d9c38525.updated(Unknown
>>>> Source)[:]
>>>>           at
>>>>
>>>> org.apache.felix.cm.impl.helper.ManagedServiceFactoryTracker.provideConfiguration(ManagedServiceFactoryTracker.java:88)[43:org.apache.felix.configadmin:1.6.0]
>>>>
>>>>           at
>>>>
>>>> org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceFactoryUpdate.provide(ConfigurationManager.java:1593)[43:org.apache.felix.configadmin:1.6.0]
>>>>
>>>>           at
>>>>
>>>> org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceFactoryUpdate.run(ConfigurationManager.java:1536)[43:org.apache.felix.configadmin:1.6.0]
>>>>
>>>>           at
>>>>
>>>> org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:103)[43:org.apache.felix.configadmin:1.6.0]
>>>>
>>>>           at java.lang.Thread.run(Thread.java:744)[:1.7.0_45]
>>>> Caused by:
>>>> org.springframework.beans.factory.BeanDefinitionStoreException:
>>>> Unrecognized xbean namespace mapping:
>>>> http://www.springframework.org/schema/osgi
>>>>           at
>>>>
>>>> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:284)[186:org.apache.xbean.spring:3.14.0]
>>>>
>>>>           at
>>>>
>>>> org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:156)[186:org.apache.xbean.spring:3.14.0]
>>>>
>>>>           at
>>>>
>>>> org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:49)[186:org.apache.xbean.spring:3.14.0]
>>>>
>>>>           at
>>>>
>>>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1438)[66:org.springframework.beans:3.2.4.RELEASE]
>>>>
>>>>           at
>>>>
>>>> org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)[66:org.springframework.beans:3.2.4.RELEASE]
>>>>
>>>>           at
>>>>
>>>> org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseBeanDefinitions(XBeanBeanDefinitionDocumentReader.java:84)[186:org.apache.xbean.spring:3.14.0]
>>>>
>>>>           at
>>>>
>>>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)[66:org.springframework.beans:3.2.4.RELEASE]
>>>>
>>>>           at
>>>>
>>>> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)[66:org.springframework.beans:3.2.4.RELEASE]
>>>>
>>>>           at
>>>>
>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)[66:org.springframework.beans:3.2.4.RELEASE]
>>>>
>>>>           at
>>>>
>>>> org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.registerBeanDefinitions(XBeanXmlBeanDefinitionReader.java:79)[186:org.apache.xbean.spring:3.14.0]
>>>>
>>>>           at
>>>>
>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)[66:org.springframework.beans:3.2.4.RELEASE]
>>>>
>>>>           at
>>>>
>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)[66:org.springframework.beans:3.2.4.RELEASE]
>>>>
>>>>           at
>>>>
>>>> org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)[66:org.springframework.beans:3.2.4.RELEASE]
>>>>
>>>>           at
>>>>
>>>> org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:111)[186:org.apache.xbean.spring:3.14.0]
>>>>
>>>>           at
>>>>
>>>> org.apache.xbean.spring.context.ResourceXmlApplicationContext.loadBeanDefinitions(ResourceXmlApplicationContext.java:104)[186:org.apache.xbean.spring:3.14.0]
>>>>
>>>>           at
>>>>
>>>> org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)[68:org.springframework.context:3.2.4.RELEASE]
>>>>
>>>>           at
>>>>
>>>> org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)[68:org.springframework.context:3.2.4.RELEASE]
>>>>
>>>>           at
>>>>
>>>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)[68:org.springframework.context:3.2.4.RELEASE]
>>>>
>>>>           at
>>>>
>>>> org.apache.activemq.osgi.ActiveMQServiceFactory.updated(ActiveMQServiceFactory.java:90)[187:org.apache.activemq.activemq-osgi:5.9.0]
>>>>
>>>>           ... 6 more
>>>>
>>>> relevant part of activemq.xml:
>>>>
>>>> <beans xmlns="http://www.springframework.org/schema/beans"
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>>       xmlns:osgi="http://www.springframework.org/schema/osgi"
>>>>       xsi:schemaLocation="
>>>>         http://www.springframework.org/schema/beans
>>>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>>>         http://activemq.apache.org/schema/core
>>>> http://activemq.apache.org/schema/core/activemq-core.xsd
>>>>         http://www.springframework.org/schema/osgi
>>>> http://www.springframework.org/schema/osgi/spring-osgi.xsd
>>>>       ">
>>>>
>>>>     <osgi:reference id="pbeConfig"
>>>> interface="org.jasypt.encryption.pbe.config.StringPBEConfig"/>
>>>>
>>>>     <bean id="encryptor"
>>>> class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
>>>>       <property name="config" ref="pbeConfig"/>
>>>>     </bean>
>>>>
>>>>     <bean
>>>>
>>>> class="org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer">
>>>>
>>>>       <constructor-arg ref="encryptor"/>
>>>>       <property name="location">
>>>> <value>file:${karaf.base}/etc/ptc/ptc.properties</value>
>>>>       </property>
>>>>     </bean>
>>>>
>>>> ...snip
>>>>
>>>> I've confirmed that the spring-osgi-extenders bundle is present and
>>>> started before the activemq-osgi bundle.  Any ideas why it can't find
>>>> the namespace handler?
>>>>
>>>> ActiveMQ 5.9.0, Karaf 3.0.0
>>>>
>>>> Thanks,
>>>> -Chris
>>>>
>>>>
>>>>
>>>
>>
>
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com