activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Arnold <carn...@ptc.com>
Subject Error using OSGi services in activemq spring xml
Date Wed, 29 Jan 2014 19:40:01 GMT
I'm attempting to configure a 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-extends bundle was 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

Mime
View raw message