camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Schneider <ch...@die-schneider.net>
Subject Problem with jms in OSGi : IllegalArgumentException: connectionFactory must be specified
Date Thu, 12 Apr 2012 14:40:01 GMT
Hi All,

i have camel route in a OSGi bundle. On one machine where we have maven 
repo access and install via a feature it works nicely. On the other 
machine we get an exception.
org.osgi.service.blueprint.container.ComponentDefinitionException: 
Unable to intialize bean .camelBlueprint.factory.camelContext
Caused by: java.lang.IllegalArgumentException: connectionFactory must be 
specified

The strange thing is that we inject the connectionFactory into the 
JmsConfiguration. As the blueprint context below shows. There is one 
thing we did a bit unorthodox. As the IBM MQ driver did not work as a bundle
we inlined it into our bundle.

Any ideas ?

Christian

----

2012-04-11 14:54:11,093 | ERROR | rint Extender: 2 | 
BlueprintContainerImpl           | container.BlueprintContainerImpl  358 
| 9 - org.apache.aries.blueprint - 0.3.1 | Unable to start blueprint 
container for bundle dispatcher
org.osgi.service.blueprint.container.ComponentDefinitionException: 
Unable to intialize bean .camelBlueprint.factory.camelContext
         at 
org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:638)[9:org.apache.aries.blueprint:0.3.1]
         at 
org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:724)[9:org.apache.aries.blueprint:0.3.1]
         at 
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)[9:org.apache.aries.blueprint:0.3.1]
         at 
org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)[9:org.apache.aries.blueprint:0.3.1]
         at 
org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:198)[9:org.apache.aries.blueprint:0.3.1]
         at 
org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:137)[9:org.apache.aries.blueprint:0.3.1]
         at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.getComponentInstance(BlueprintContainerImpl.java:718)[9:org.apache.aries.blueprint:0.3.1]
         at 
org.apache.camel.blueprint.handler.CamelNamespaceHandler$CamelDependenciesFinder.process(CamelNamespaceHandler.java:619)[172:org.apache.camel.camel-blueprint:2.8.4]
         at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.processProcessors(BlueprintContainerImpl.java:495)[9:org.apache.aries.blueprint:0.3.1]
         at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:314)[9:org.apache.aries.blueprint:0.3.1]
         at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:227)[9:org.apache.aries.blueprint:0.3.1]
         at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)[:1.6.0_18]
         at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)[:1.6.0_18]
         at 
java.util.concurrent.FutureTask.run(FutureTask.java:138)[:1.6.0_18]
         at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)[:1.6.0_18]
         at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)[:1.6.0_18]
         at 
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_18]
         at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_18]
         at java.lang.Thread.run(Thread.java:619)[:1.6.0_18]
Caused by: java.lang.IllegalArgumentException: connectionFactory must be 
specified
         at 
org.apache.camel.util.ObjectHelper.notNull(ObjectHelper.java:278)
         at 
org.apache.camel.component.jms.JmsConfiguration.createConnectionFactory(JmsConfiguration.java:1015)
         at 
org.apache.camel.component.jms.JmsConfiguration.getConnectionFactory(JmsConfiguration.java:396)
         at 
org.apache.camel.component.jms.JmsConfiguration.createListenerConnectionFactory(JmsConfiguration.java:1024)
         at 
org.apache.camel.component.jms.JmsConfiguration.getListenerConnectionFactory(JmsConfiguration.java:415)
         at 
org.apache.camel.component.jms.JmsConfiguration.configureMessageListenerContainer(JmsConfiguration.java:854)
         at 
org.apache.camel.component.jms.JmsConfiguration.createMessageListenerContainer(JmsConfiguration.java:368)
         at 
org.apache.camel.component.jms.JmsEndpoint.createMessageListenerContainer(JmsEndpoint.java:166)
         at 
org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:161)
         at 
org.apache.camel.component.jms.JmsEndpoint.createConsumer(JmsEndpoint.java:72)
         at 
org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:61)
         at 
org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:75)
         at org.apache.camel.impl.RouteService.warmUp(RouteService.java:131)
         at 
org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:1873)
         at 
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1801)
         at 
org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1823)
         at 
org.apache.camel.impl.DefaultCamelContext.startRouteService(DefaultCamelContext.java:1705)
         at 
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:699)
         at 
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1681)
         at 
org.apache.camel.impl.DefaultCamelContext.addRouteDefinitions(DefaultCamelContext.java:641)
         at 
org.apache.camel.builder.RouteBuilder.populateRoutes(RouteBuilder.java:337)
         at 
org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:265)
         at 
dispatcher.DispatcherRouteFactory.addRoutesToCamelContext(DispatcherRouteFactory.java:24)
         at 
org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:603)
         at 
org.apache.camel.core.xml.AbstractCamelContextFactoryBean.installRoutes(AbstractCamelContextFactoryBean.java:626)
         at 
org.apache.camel.core.xml.AbstractCamelContextFactoryBean.afterPropertiesSet(AbstractCamelContextFactoryBean.java:306)
         at 
org.apache.camel.blueprint.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:263)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)[:1.6.0_18]
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_18]
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_18]
         at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_18]
         at 
org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:226)[9:org.apache.aries.blueprint:0.3.1]
         at 
org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:824)[9:org.apache.aries.blueprint:0.3.1]
         at 
org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:636)[9:org.apache.aries.blueprint:0.3.1]
         ... 18 more
----


Below you find the slighty edited blueprint context
---
<?xml version="1.0" encoding="UTF-8"?>
<blueprint default-activation="eager" 
xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:jpa="http://aries.apache.org/xmlns/jpa/v1.0.0" 
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
     xmlns:tx="http://aries.apache.org/xmlns/transactions/v1.0.0"
     xsi:schemaLocation="
   http://www.osgi.org/xmlns/blueprint/v1.0.0 
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
   http://www.osgi.org/xmlns/blueprint-ext/v1.1.0 
https://svn.apache.org/repos/asf/aries/tags/blueprint-0.3.1/blueprint-core/src/main/resources/org/apache/aries/blueprint/ext/blueprint-ext.xsd


   http://cxf.apache.org/blueprint/jaxws 
http://cxf.apache.org/schemas/blueprint/jaxws.xsd
   http://cxf.apache.org/blueprint/jaxrs 
http://cxf.apache.org/schemas/blueprint/jaxrs.xsd
   http://cxf.apache.org/blueprint/core 
http://cxf.apache.org/schemas/blueprint/core.xsd
   http://camel.apache.org/schema/blueprint 
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
   ">

<cm:property-placeholder persistent-id="myconfig" update-strategy="reload">
</cm:property-placeholder>

<bean id="MqConnectionFactory" 
class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="hostName" value="${jms.hostName}" />
<property name="port" value="${jms.port}" />
<property name="queueManager" value="${jms.queueManager}" />
<property name="transportType" value="1" />
</bean>

<bean id="connectionFactory" 
class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="username" value="${jms.username}"/>
<property name="password" value="${jms.password}"/>
<property name="targetConnectionFactory" ref="MqConnectionFactory"/>
</bean>

<reference id="entityManagerFactory" 
interface="javax.persistence.EntityManagerFactory" 
filter="(osgi.unit.name=dispatcher)" />

<bean id="dbService" class="...DbService">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>

<bean id="dispatcherRoutes" class="dispatcher.DispatcherRoute">
</bean>

<bean id="transactionManager" 
class="org.springframework.jms.connection.JmsTransactionManager">
<property name="connectionFactory" ref="connectionFactory" />
</bean>

<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
<property name="configuration" ref="jmsConfiguration" />
<property name="transactionManager" ref="transactionManager" />
</bean>

<bean id="jmsConfiguration" 
class="org.apache.camel.component.jms.JmsConfiguration">
<property name="connectionFactory" ref="connectionFactory" />
</bean>

<camelContext id="camelContext" trace="true" 
xmlns="http://camel.apache.org/schema/blueprint">
<routeBuilder ref="dispatcherRoutes" />
</camelContext>

</blueprint>

-- 
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message