You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Michael Mertins <Mi...@saperion.com> on 2011/08/06 23:21:54 UTC

Deploying my own component/context in Karaf

Hi all,

I wrote my own component based on http://camel.apache.org/creating-a-new-camel-component.html

And created a file in \META-INF\services\org\apache\camel\component that links my Class

After the maven compile I get a jar that I deploy in karaf's deploy folder and that is listed in karaf, then, too. BUT after I create a blueprint xml route to my new component, the route is not loaded... What did I do wrong? How can I deploy my own context in Karaf? Just adding a Context-Implementation-Class tot he jar?

This is my route; it works with normal components, but not with my custom component. Why?

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
        <route>
            <from uri="file://c:/tmp/bla.tif" />
            <to uri="myComponent:bla" />
        </route>
    </camelContext>

</blueprint>

Hope you can give me a hint. Please CC your answer to my address if possible.


Thank you,


Michael Mertins

Re: Deploying my own component/context in Karaf

Posted by Willem Jiang <wi...@gmail.com>.
Can you show me the stack trace ?
It's important :)

On 8/8/11 6:18 PM, Filippo Balicchia wrote:
> Hello Willem my component is installed as bundle.
>
> please read
> http://fusesource.com/products/enterprise-servicemix/#documentation
> the osgi section
> this resolve a lot of your doubts.
>
>
> If this doesn't enough send me your project
>
> Cheers
>
> --Filippo
>
>
>
> 2011/8/8 Willem Jiang<wi...@gmail.com>:
>> Is there any stack trace in the karaf log to tell why the camel route cannot
>> be load ?
>>
>> Is you component wrapped as OSGi bundle ?
>>
>> Can you check the your component bundle stats which osgi:list command ?
>>
>> On 8/7/11 5:21 AM, Michael Mertins wrote:
>>>
>>> Hi all,
>>>
>>> I wrote my own component based on
>>> http://camel.apache.org/creating-a-new-camel-component.html
>>>
>>> And created a file in \META-INF\services\org\apache\camel\component that
>>> links my Class
>>>
>>> After the maven compile I get a jar that I deploy in karaf's deploy folder
>>> and that is listed in karaf, then, too. BUT after I create a blueprint xml
>>> route to my new component, the route is not loaded... What did I do wrong?
>>> How can I deploy my own context in Karaf? Just adding a
>>> Context-Implementation-Class tot he jar?
>>>
>>> This is my route; it works with normal components, but not with my custom
>>> component. Why?
>>>
>>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>>>
>>>      <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>>>          <route>
>>>              <from uri="file://c:/tmp/bla.tif" />
>>>              <to uri="myComponent:bla" />
>>>          </route>
>>>      </camelContext>
>>>
>>> </blueprint>
>>>
>>> Hope you can give me a hint. Please CC your answer to my address if
>>> possible.
>>>
>>>
>>> Thank you,
>>>
>>>
>>> Michael Mertins
>>>
>>
>>
>> --
>> Willem
>> ----------------------------------
>> FuseSource
>> Web: http://www.fusesource.com
>> Blog:    http://willemjiang.blogspot.com (English)
>>          http://jnn.javaeye.com (Chinese)
>> Twitter: willemjiang
>> Weibo: willemjiang
>>
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

Re: Deploying my own component/context in Karaf

Posted by Filippo Balicchia <fb...@gmail.com>.
Hello Willem my component is installed as bundle.

please read
http://fusesource.com/products/enterprise-servicemix/#documentation
the osgi section
this resolve a lot of your doubts.


If this doesn't enough send me your project

Cheers

--Filippo



2011/8/8 Willem Jiang <wi...@gmail.com>:
> Is there any stack trace in the karaf log to tell why the camel route cannot
> be load ?
>
> Is you component wrapped as OSGi bundle ?
>
> Can you check the your component bundle stats which osgi:list command ?
>
> On 8/7/11 5:21 AM, Michael Mertins wrote:
>>
>> Hi all,
>>
>> I wrote my own component based on
>> http://camel.apache.org/creating-a-new-camel-component.html
>>
>> And created a file in \META-INF\services\org\apache\camel\component that
>> links my Class
>>
>> After the maven compile I get a jar that I deploy in karaf's deploy folder
>> and that is listed in karaf, then, too. BUT after I create a blueprint xml
>> route to my new component, the route is not loaded... What did I do wrong?
>> How can I deploy my own context in Karaf? Just adding a
>> Context-Implementation-Class tot he jar?
>>
>> This is my route; it works with normal components, but not with my custom
>> component. Why?
>>
>> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>>
>>     <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>>         <route>
>>             <from uri="file://c:/tmp/bla.tif" />
>>             <to uri="myComponent:bla" />
>>         </route>
>>     </camelContext>
>>
>> </blueprint>
>>
>> Hope you can give me a hint. Please CC your answer to my address if
>> possible.
>>
>>
>> Thank you,
>>
>>
>> Michael Mertins
>>
>
>
> --
> Willem
> ----------------------------------
> FuseSource
> Web: http://www.fusesource.com
> Blog:    http://willemjiang.blogspot.com (English)
>         http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
> Weibo: willemjiang
>

Re: Deploying my own component/context in Karaf

Posted by Willem Jiang <wi...@gmail.com>.
Is there any stack trace in the karaf log to tell why the camel route 
cannot be load ?

Is you component wrapped as OSGi bundle ?

Can you check the your component bundle stats which osgi:list command ?

On 8/7/11 5:21 AM, Michael Mertins wrote:
>
> Hi all,
>
> I wrote my own component based on http://camel.apache.org/creating-a-new-camel-component.html
>
> And created a file in \META-INF\services\org\apache\camel\component that links my Class
>
> After the maven compile I get a jar that I deploy in karaf's deploy folder and that is listed in karaf, then, too. BUT after I create a blueprint xml route to my new component, the route is not loaded... What did I do wrong? How can I deploy my own context in Karaf? Just adding a Context-Implementation-Class tot he jar?
>
> This is my route; it works with normal components, but not with my custom component. Why?
>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>
>      <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>          <route>
>              <from uri="file://c:/tmp/bla.tif" />
>              <to uri="myComponent:bla" />
>          </route>
>      </camelContext>
>
> </blueprint>
>
> Hope you can give me a hint. Please CC your answer to my address if possible.
>
>
> Thank you,
>
>
> Michael Mertins
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang

AW: Deploying my own component/context in Karaf

Posted by Michael Mertins <Mi...@saperion.com>.
Thanks, Filippo :)

Did you implement your own components for deployment in Karaf, too?^^

Here the points:

1: Camel-core is installed (I installled camel and camel-blueprint)
2: My class is defined in \META-INF\services\org\apache\camel\component\myComponent , so I dont need to write a context anymore, right?
3: The bundle appears when I do "list" in Karaf, will try the bundle-install command asap

4: Sidenote: If I want to send a file that my component handles, I only need a producer but no consumer in my component, right? I mean something like from uri=file to uri=myComponent

Hope my steps are making sense...

Best

Michael
________________________________________
Von: Filippo Balicchia [fbalicchia@gmail.com]
Gesendet: Sonntag, 7. August 2011 08:50
An: users@camel.apache.org
Cc: Michael Mertins
Betreff: Re: Deploying my own component/context in Karaf

Hello Micheal,

1: Did your karaf support camel-core (Is it installed in your container).

2: Where is defined your component class ?

3: To install your bundle you can use bundle:install command


I hope this can help ..

--Filippo




2011/8/6 Michael Mertins <Mi...@saperion.com>:
>
> Hi all,
>
> I wrote my own component based on http://camel.apache.org/creating-a-new-camel-component.html
>
> And created a file in \META-INF\services\org\apache\camel\component that links my Class
>
> After the maven compile I get a jar that I deploy in karaf's deploy folder and that is listed in karaf, then, too. BUT after I create a blueprint xml route to my new component, the route is not loaded... What did I do wrong? How can I deploy my own context in Karaf? Just adding a Context-Implementation-Class tot he jar?
>
> This is my route; it works with normal components, but not with my custom component. Why?
>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>
>    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>        <route>
>            <from uri="file://c:/tmp/bla.tif" />
>            <to uri="myComponent:bla" />
>        </route>
>    </camelContext>
>
> </blueprint>
>
> Hope you can give me a hint. Please CC your answer to my address if possible.
>
>
> Thank you,
>
>
> Michael Mertins
>

Re: Deploying my own component/context in Karaf

Posted by Filippo Balicchia <fb...@gmail.com>.
Hello Micheal,

1: Did your karaf support camel-core (Is it installed in your container).

2: Where is defined your component class ?

3: To install your bundle you can use bundle:install command


I hope this can help ..

--Filippo




2011/8/6 Michael Mertins <Mi...@saperion.com>:
>
> Hi all,
>
> I wrote my own component based on http://camel.apache.org/creating-a-new-camel-component.html
>
> And created a file in \META-INF\services\org\apache\camel\component that links my Class
>
> After the maven compile I get a jar that I deploy in karaf's deploy folder and that is listed in karaf, then, too. BUT after I create a blueprint xml route to my new component, the route is not loaded... What did I do wrong? How can I deploy my own context in Karaf? Just adding a Context-Implementation-Class tot he jar?
>
> This is my route; it works with normal components, but not with my custom component. Why?
>
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
>
>    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
>        <route>
>            <from uri="file://c:/tmp/bla.tif" />
>            <to uri="myComponent:bla" />
>        </route>
>    </camelContext>
>
> </blueprint>
>
> Hope you can give me a hint. Please CC your answer to my address if possible.
>
>
> Thank you,
>
>
> Michael Mertins
>