Hi Laci,

do you import org.apache.camel package in your bundle ?

Regards
JB

On 01/30/2014 01:15 PM, Laci Gaspar wrote:
Hi
I'm just starting, please excuse silly questions.

I'm having problems writing an example that uses camel, activemq, karaf.
As a basis I used the Camel Example camel-example-jms-file.

Then I adapted the pom file, so that it builds a bundle. So far so good.
After installing it in karaf nothing happened, the route didn't start.

Then I looked in other examples  (jms2rest in the karaf tutorials ) and
so I added a blueprint.xml file to the project.
    <bean id="jms2FileRoute"
class="org.apache.camel.example.jmstofile.Jms2FileRoute">
     </bean>
     <camelContext id="jms2file"
xmlns="http://camel.apache.org/schema/blueprint";>
         <routeBuilder ref="jms2FileRoute" />
     </camelContext>
      <bean id="connectionFactory" class="javax.jms.ConnectionFactory" />
     <bean id="jmsConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
         <property name="connectionFactory" ref="connectionFactory"/>
     </bean>
     <bean id="jms-test"
class="org.apache.camel.component.jms.JmsComponent">
         <argument ref="jmsConfig"/>
     </bean>
       <bean id="activemqConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
          <property name="brokerURL" value="tcp://0.0.0.0:61616" />
      </bean>
      <bean id="pooledConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
          <property name="maxConnections" value="8" />
          <property name="connectionFactory"
ref="activemqConnectionFactory" />
      </bean>

In my main class i do:
         CamelContext context = new DefaultCamelContext();
         JmsConfiguration jmsConfig = new JmsConfiguration(new
ActiveMQConnectionFactory("tcp://localhost:61616"));
         context.addComponent("jms-test", new JmsComponent(jmsConfig ));


After installing the bundle in karaf,  i get the log message:
2014-01-30 13:09:38,145 | INFO  | l Console Thread |
BlueprintContainerImpl           | container.BlueprintContainerImpl  360
| 7 - org.apache.aries.blueprint.core - 1.1.0 | Bundle
org.apache.camel.example.jmstofile.camel-example-jms-file is waiting for
dependencies
[(&(component=test-jms)(objectClass=org.apache.camel.spi.ComponentResolver))]


It seems that something is wrong with my ActiveMQConnectionFactory, but
I can't figure out what.

Any advice would be most helpful as well as a working up to date example
that involves AMQ, camel and karaf.

Thanks a lot,
Laci


--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to