You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Charles Moulliard <cm...@gmail.com> on 2011/06/15 23:26:51 UTC
Error with camel-ejb
Hi,
I try to use openejb from camel using camel-ejb but get this error
when camel looks to find the ejb stateless bean
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/util"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="timer://foo?fixedRate=true&period=5s"/>
<setBody>
<constant>4</constant>
<constant>3</constant>
</setBody>
<to uri="ejb:CalculatorImplRemote?method=sum"/>
<log message=">>> Result : ${body}"/>
</route>
</camelContext>
<!-- setup Camel EJB component -->
<bean id="ejb" class="org.apache.camel.component.ejb.EjbComponent">
<property name="properties" ref="jndiProperties"/>
</bean>
<!-- use OpenEJB context factory -->
<p:properties id="jndiProperties">
<prop key="java.naming.factory.initial">org.apache.openejb.client.RemoteInitialContextFactory</prop>
<prop key="java.naming.provider.url">ejbd://127.0.0.1:4201</prop>
<prop key="java.naming.security.principal">daniel</prop>
<prop key="java.naming.security.credentials">password</prop>
</p:properties>
</beans>
23:12:32,227 | ERROR | foo | DefaultErrorHandler
| ache.camel.processor.CamelLogger 232 | 64 -
org.apache.camel.camel-core - 2.7.0 | Failed delivery for exchangeId:
ID-biker-chm-local-58833-1308171227583-5-6. Exhausted after delivery
attempt: 1 caught: org.apache.camel.NoSuchBeanException: No bean could
be found in the registry for: CalculatorImplRemote
org.apache.camel.NoSuchBeanException: No bean could be found in the
registry for: CalculatorImplRemote
at org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:68)[64:org.apache.camel.camel-core:2.7.0]
at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:84)[64:org.apache.camel.camel-core:2.7.0]
at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)[64:org.apache.camel.camel-core:2.7.0]
at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)[64:org.apache.camel.camel-core:2.7.0]
at org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[64:org.apache.camel.camel-core:2.7.0]
at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[64:org.apache.camel.camel-core:2.7.0]
at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[64:org.apache.camel.camel-core:2.7.0]
How can we define using <setBody> tag the following two parameters to
call the method sum of the stateless ejb CalculatorRemote ?
public int sum(int add1, int add2);
<setBody>
<constant>???</constant>
</setBody>
Regards,
Charles Moulliard
Apache Committer
Blog : http://cmoulliard.blogspot.com
Twitter : http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard
Skype: cmoulliard
Re: Error with camel-ejb
Posted by Charles Moulliard <cm...@gmail.com>.
Here are the bundles deployed
[ 100] [Active ] [ ] [ ] [ 60]
mvn:org.apache.camel/camel-ejb/2.7.0
[ 102] [Active ] [ ] [ ] [ 60]
mvn:org.apache.openejb/openejb-client/4.0.0-SNAPSHOT
[ 103] [Active ] [ ] [ ] [ 60]
mvn:org.apache.geronimo.specs/geronimo-ejb_3.0_spec/1.0.1
and camel of course + spring
On Thu, Jun 16, 2011 at 8:02 PM, Charles Moulliard <cm...@gmail.com> wrote:
> The camel route has been deployed using deploy dir of servicemix and
> DynamicImport package is enable. I have also installed the openEJB
> client jar and wrapped it. So everything is in place
>
> On Thu, Jun 16, 2011 at 4:50 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
>> oh you are in an OSGi container?
>>
>> for openejb you have to import package org.apache.openejb.client and
>> org.apache.openejb.client.proxy i think or something like that (i don't
>> really remember).
>>
>> - Romain
>>
>> 2011/6/16 Charles Moulliard <cm...@gmail.com>
>>
>>> I think that the code that we use to create the endpoint works fine in
>>> a non osgi environment but not on osgi as jndi is not really supported
>>>
>>> @Override
>>> protected Endpoint createEndpoint(String uri, String remaining,
>>> Map<String, Object> parameters) throws Exception {
>>> BeanEndpoint answer = new BeanEndpoint(uri, this);
>>> answer.setBeanName(remaining);
>>>
>>> // plugin registry to lookup in jndi for the EJBs
>>> Registry registry = new JndiRegistry(getContext());
>>> answer.setBeanHolder(new EjbRegistryBean(registry,
>>> getCamelContext(), answer.getBeanName()));
>>>
>>> Processor processor = answer.getProcessor();
>>> setProperties(processor, parameters);
>>> return answer;
>>> }
>>>
>>>
>>> On Wed, Jun 15, 2011 at 11:33 PM, Romain Manni-Bucau
>>> <rm...@gmail.com> wrote:
>>> > Hi,
>>> >
>>> > creating a list with spring should work but i think the problem is the
>>> > context creation here.
>>> >
>>> > personnaly i use the bean component and i ask to me (with java dsl) or
>>> > spring to do the lookup to put it in the camel registry.
>>> >
>>> > - Romain
>>> >
>>> > 2011/6/15 Charles Moulliard <cm...@gmail.com>
>>> >
>>> >> Hi,
>>> >>
>>> >> I try to use openejb from camel using camel-ejb but get this error
>>> >> when camel looks to find the ejb stateless bean
>>> >>
>>> >> <beans xmlns="http://www.springframework.org/schema/beans"
>>> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> >> xmlns:p="http://www.springframework.org/schema/util"
>>> >> xsi:schemaLocation="
>>> >> http://www.springframework.org/schema/beans
>>> >> http://www.springframework.org/schema/beans/spring-beans.xsd
>>> >> http://www.springframework.org/schema/util
>>> >> http://www.springframework.org/schema/util/spring-util.xsd
>>> >> http://camel.apache.org/schema/spring
>>> >> http://camel.apache.org/schema/spring/camel-spring.xsd">
>>> >>
>>> >> <camelContext xmlns="http://camel.apache.org/schema/spring">
>>> >> <route>
>>> >> <from uri="timer://foo?fixedRate=true&period=5s"/>
>>> >> <setBody>
>>> >> <constant>4</constant>
>>> >> <constant>3</constant>
>>> >> </setBody>
>>> >> <to uri="ejb:CalculatorImplRemote?method=sum"/>
>>> >> <log message=">>> Result : ${body}"/>
>>> >> </route>
>>> >> </camelContext>
>>> >>
>>> >> <!-- setup Camel EJB component -->
>>> >> <bean id="ejb" class="org.apache.camel.component.ejb.EjbComponent">
>>> >> <property name="properties" ref="jndiProperties"/>
>>> >> </bean>
>>> >>
>>> >> <!-- use OpenEJB context factory -->
>>> >> <p:properties id="jndiProperties">
>>> >> <prop
>>> >>
>>> key="java.naming.factory.initial">org.apache.openejb.client.RemoteInitialContextFactory</prop>
>>> >> <prop key="java.naming.provider.url">ejbd://127.0.0.1:4201
>>> </prop>
>>> >> <prop key="java.naming.security.principal">daniel</prop>
>>> >> <prop key="java.naming.security.credentials">password</prop>
>>> >> </p:properties>
>>> >>
>>> >> </beans>
>>> >>
>>> >> 23:12:32,227 | ERROR | foo | DefaultErrorHandler
>>> >> | ache.camel.processor.CamelLogger 232 | 64 -
>>> >> org.apache.camel.camel-core - 2.7.0 | Failed delivery for exchangeId:
>>> >> ID-biker-chm-local-58833-1308171227583-5-6. Exhausted after delivery
>>> >> attempt: 1 caught: org.apache.camel.NoSuchBeanException: No bean could
>>> >> be found in the registry for: CalculatorImplRemote
>>> >> org.apache.camel.NoSuchBeanException: No bean could be found in the
>>> >> registry for: CalculatorImplRemote
>>> >> at
>>> >>
>>> org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:68)[64:org.apache.camel.camel-core:2.7.0]
>>> >> at
>>> >>
>>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:84)[64:org.apache.camel.camel-core:2.7.0]
>>> >> at
>>> >>
>>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)[64:org.apache.camel.camel-core:2.7.0]
>>> >> at
>>> >>
>>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)[64:org.apache.camel.camel-core:2.7.0]
>>> >> at
>>> >>
>>> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[64:org.apache.camel.camel-core:2.7.0]
>>> >> at
>>> >>
>>> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[64:org.apache.camel.camel-core:2.7.0]
>>> >> at
>>> >>
>>> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[64:org.apache.camel.camel-core:2.7.0]
>>> >>
>>> >>
>>> >> How can we define using <setBody> tag the following two parameters to
>>> >> call the method sum of the stateless ejb CalculatorRemote ?
>>> >>
>>> >> public int sum(int add1, int add2);
>>> >>
>>> >> <setBody>
>>> >> <constant>???</constant>
>>> >> </setBody>
>>> >>
>>> >>
>>> >> Regards,
>>> >>
>>> >> Charles Moulliard
>>> >>
>>> >> Apache Committer
>>> >>
>>> >> Blog : http://cmoulliard.blogspot.com
>>> >> Twitter : http://twitter.com/cmoulliard
>>> >> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>>> >> Skype: cmoulliard
>>> >>
>>> >
>>>
>>
>
Re: Error with camel-ejb
Posted by Romain Manni-Bucau <rm...@gmail.com>.
cool :).
- Romain
2011/6/16 Charles Moulliard <cm...@gmail.com>
> yep. That works now using camel-ejb component on osgi.
>
>
> On Thu, Jun 16, 2011 at 10:12 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
> > looks like what i've said ;)
> >
> > maybe try to specify manually imports.
> >
> > - Romain
> >
> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
> >
> >> I progress. If I create a camel bean processor containing the code to
> >> setup initial context and cal openEJB, i get this error now
> >>
> >> 21:53:49,737 | ERROR | foo | DefaultErrorHandler
> >> | ache.camel.processor.CamelLogger 232 | 55 -
> >> org.apache.camel.camel-core - 2.8.0.SNAPSHOT | Failed delivery for
> >> exchangeId: ID-biker-chm-local-61842-1308253897457-1-17. Exhausted
> >> after delivery attempt: 1 caught: java.lang.IllegalArgumentException:
> >> interface org.apache.openejb.client.EJBObjectProxy is not visible from
> >> class loader
> >> java.lang.IllegalArgumentException: interface
> >> org.apache.openejb.client.EJBObjectProxy is not visible from class
> >> loader
> >> at
> java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)[:1.6.0_24]
> >> at
> >> java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)[:1.6.0_24]
> >> at
> >>
> org.apache.openejb.client.proxy.Jdk13ProxyFactory.newProxyInstance(Jdk13ProxyFactory.java:118)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
> >> at
> >>
> org.apache.openejb.client.proxy.ProxyManager.newProxyInstance(ProxyManager.java:107)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
> >> at
> >>
> org.apache.openejb.client.EJBObjectHandler.createEJBObjectProxy(EJBObjectHandler.java:126)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
> >> at
> >>
> org.apache.openejb.client.JNDIContext.createBusinessObject(JNDIContext.java:191)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
> >> at
> >>
> org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:232)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
> >> at
> >> javax.naming.InitialContext.lookup(InitialContext.java:392)[:1.6.0_24]
> >> at
> >>
> org.apache.camel.example.remote.ejb.EJBClientBean.process(EJBClientBean.java:41)[69:org.apache.camel.camel-example-remote-ejb:2.8.0.SNAPSHOT]
> >> at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
> >> at
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_24]
> >> at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_24]
> >> at
> >>
> org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:328)[55:org.apache.camel.camel-core:2.8.0.SNAPSHOT]
> >> at
> >>
> org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:230)[55:org.apache.camel.camel-core:2.8.0.SNAPSHOT]
> >> at
> >>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:161)[55:org.apache.camel.camel-core:2.8.0.SNAPSHOT]
> >>
> >>
> >>
> >> On Thu, Jun 16, 2011 at 8:55 PM, Romain Manni-Bucau
> >> <rm...@gmail.com> wrote:
> >> > were you able to check properties?
> >> >
> >> > i think there are ignored if you are not in testing envt.
> >> >
> >> > - Romain
> >> >
> >> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
> >> >
> >> >> I have created a camel-example-remote-ejb project containing a test
> >> >> case with a remote EJB deployed on openEJB and that works fine using
> >> >> InitialContext with the properties provided in my first email. So the
> >> >> project + remote EJB is in order. This is the camel + jndi in OSGI
> >> >> container where we have a problem.
> >> >>
> >> >> On Thu, Jun 16, 2011 at 8:18 PM, Romain Manni-Bucau
> >> >> <rm...@gmail.com> wrote:
> >> >> > Charles, which part of code do you think is not working?
> >> >> >
> >> >> > I never tried the camel-ejb component in OSGi but i did openejb
> remote
> >> >> > client in servicemix and it works fine and camel doesn't add
> anything
> >> on
> >> >> it,
> >> >> > just a way to get a bean not the initial context.
> >> >> >
> >> >> > Can you just check your properties are used and if it is the case
> can
> >> you
> >> >> > try a manual client?
> >> >> >
> >> >> > I think i had some issues reading system.properties or
> jndi.properties
> >> >> with
> >> >> > camel in a non osgi envt some weeks ago (that's why i used spring
> to
> >> do
> >> >> the
> >> >> > lookup).
> >> >> >
> >> >> > - Romain
> >> >> >
> >> >> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
> >> >> >
> >> >> >> The camel route has been deployed using deploy dir of servicemix
> and
> >> >> >> DynamicImport package is enable. I have also installed the openEJB
> >> >> >> client jar and wrapped it. So everything is in place
> >> >> >>
> >> >> >> On Thu, Jun 16, 2011 at 4:50 PM, Romain Manni-Bucau
> >> >> >> <rm...@gmail.com> wrote:
> >> >> >> > oh you are in an OSGi container?
> >> >> >> >
> >> >> >> > for openejb you have to import package org.apache.openejb.client
> >> and
> >> >> >> > org.apache.openejb.client.proxy i think or something like that
> (i
> >> >> don't
> >> >> >> > really remember).
> >> >> >> >
> >> >> >> > - Romain
> >> >> >> >
> >> >> >> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
> >> >> >> >
> >> >> >> >> I think that the code that we use to create the endpoint works
> >> fine
> >> >> in
> >> >> >> >> a non osgi environment but not on osgi as jndi is not really
> >> >> supported
> >> >> >> >>
> >> >> >> >> @Override
> >> >> >> >> protected Endpoint createEndpoint(String uri, String
> remaining,
> >> >> >> >> Map<String, Object> parameters) throws Exception {
> >> >> >> >> BeanEndpoint answer = new BeanEndpoint(uri, this);
> >> >> >> >> answer.setBeanName(remaining);
> >> >> >> >>
> >> >> >> >> // plugin registry to lookup in jndi for the EJBs
> >> >> >> >> Registry registry = new JndiRegistry(getContext());
> >> >> >> >> answer.setBeanHolder(new EjbRegistryBean(registry,
> >> >> >> >> getCamelContext(), answer.getBeanName()));
> >> >> >> >>
> >> >> >> >> Processor processor = answer.getProcessor();
> >> >> >> >> setProperties(processor, parameters);
> >> >> >> >> return answer;
> >> >> >> >> }
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> On Wed, Jun 15, 2011 at 11:33 PM, Romain Manni-Bucau
> >> >> >> >> <rm...@gmail.com> wrote:
> >> >> >> >> > Hi,
> >> >> >> >> >
> >> >> >> >> > creating a list with spring should work but i think the
> problem
> >> is
> >> >> the
> >> >> >> >> > context creation here.
> >> >> >> >> >
> >> >> >> >> > personnaly i use the bean component and i ask to me (with
> java
> >> dsl)
> >> >> or
> >> >> >> >> > spring to do the lookup to put it in the camel registry.
> >> >> >> >> >
> >> >> >> >> > - Romain
> >> >> >> >> >
> >> >> >> >> > 2011/6/15 Charles Moulliard <cm...@gmail.com>
> >> >> >> >> >
> >> >> >> >> >> Hi,
> >> >> >> >> >>
> >> >> >> >> >> I try to use openejb from camel using camel-ejb but get this
> >> error
> >> >> >> >> >> when camel looks to find the ejb stateless bean
> >> >> >> >> >>
> >> >> >> >> >> <beans xmlns="http://www.springframework.org/schema/beans"
> >> >> >> >> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >> >> >> >> >> xmlns:p="http://www.springframework.org/schema/util"
> >> >> >> >> >> xsi:schemaLocation="
> >> >> >> >> >> http://www.springframework.org/schema/beans
> >> >> >> >> >>
> http://www.springframework.org/schema/beans/spring-beans.xsd
> >> >> >> >> >> http://www.springframework.org/schema/util
> >> >> >> >> >> http://www.springframework.org/schema/util/spring-util.xsd
> >> >> >> >> >> http://camel.apache.org/schema/spring
> >> >> >> >> >> http://camel.apache.org/schema/spring/camel-spring.xsd">
> >> >> >> >> >>
> >> >> >> >> >> <camelContext xmlns="
> http://camel.apache.org/schema/spring
> >> ">
> >> >> >> >> >> <route>
> >> >> >> >> >> <from
> >> uri="timer://foo?fixedRate=true&period=5s"/>
> >> >> >> >> >> <setBody>
> >> >> >> >> >> <constant>4</constant>
> >> >> >> >> >> <constant>3</constant>
> >> >> >> >> >> </setBody>
> >> >> >> >> >> <to uri="ejb:CalculatorImplRemote?method=sum"/>
> >> >> >> >> >> <log message=">>> Result : ${body}"/>
> >> >> >> >> >> </route>
> >> >> >> >> >> </camelContext>
> >> >> >> >> >>
> >> >> >> >> >> <!-- setup Camel EJB component -->
> >> >> >> >> >> <bean id="ejb"
> >> >> >> class="org.apache.camel.component.ejb.EjbComponent">
> >> >> >> >> >> <property name="properties" ref="jndiProperties"/>
> >> >> >> >> >> </bean>
> >> >> >> >> >>
> >> >> >> >> >> <!-- use OpenEJB context factory -->
> >> >> >> >> >> <p:properties id="jndiProperties">
> >> >> >> >> >> <prop
> >> >> >> >> >>
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> key="java.naming.factory.initial">org.apache.openejb.client.RemoteInitialContextFactory</prop>
> >> >> >> >> >> <prop key="java.naming.provider.url">ejbd://
> >> 127.0.0.1:4201
> >> >> >> >> </prop>
> >> >> >> >> >> <prop
> key="java.naming.security.principal">daniel</prop>
> >> >> >> >> >> <prop
> >> >> key="java.naming.security.credentials">password</prop>
> >> >> >> >> >> </p:properties>
> >> >> >> >> >>
> >> >> >> >> >> </beans>
> >> >> >> >> >>
> >> >> >> >> >> 23:12:32,227 | ERROR | foo |
> DefaultErrorHandler
> >> >> >> >> >> | ache.camel.processor.CamelLogger 232 | 64 -
> >> >> >> >> >> org.apache.camel.camel-core - 2.7.0 | Failed delivery for
> >> >> exchangeId:
> >> >> >> >> >> ID-biker-chm-local-58833-1308171227583-5-6. Exhausted after
> >> >> delivery
> >> >> >> >> >> attempt: 1 caught: org.apache.camel.NoSuchBeanException: No
> >> bean
> >> >> >> could
> >> >> >> >> >> be found in the registry for: CalculatorImplRemote
> >> >> >> >> >> org.apache.camel.NoSuchBeanException: No bean could be found
> in
> >> >> the
> >> >> >> >> >> registry for: CalculatorImplRemote
> >> >> >> >> >> at
> >> >> >> >> >>
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:68)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> >> >> at
> >> >> >> >> >>
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:84)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> >> >> at
> >> >> >> >> >>
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> >> >> at
> >> >> >> >> >>
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> >> >> at
> >> >> >> >> >>
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> >> >> at
> >> >> >> >> >>
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> >> >> at
> >> >> >> >> >>
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >> How can we define using <setBody> tag the following two
> >> parameters
> >> >> to
> >> >> >> >> >> call the method sum of the stateless ejb CalculatorRemote ?
> >> >> >> >> >>
> >> >> >> >> >> public int sum(int add1, int add2);
> >> >> >> >> >>
> >> >> >> >> >> <setBody>
> >> >> >> >> >> <constant>???</constant>
> >> >> >> >> >> </setBody>
> >> >> >> >> >>
> >> >> >> >> >>
> >> >> >> >> >> Regards,
> >> >> >> >> >>
> >> >> >> >> >> Charles Moulliard
> >> >> >> >> >>
> >> >> >> >> >> Apache Committer
> >> >> >> >> >>
> >> >> >> >> >> Blog : http://cmoulliard.blogspot.com
> >> >> >> >> >> Twitter : http://twitter.com/cmoulliard
> >> >> >> >> >> Linkedin : http://www.linkedin.com/in/charlesmoulliard
> >> >> >> >> >> Skype: cmoulliard
> >> >> >> >> >>
> >> >> >> >> >
> >> >> >> >>
> >> >> >> >
> >> >> >>
> >> >> >
> >> >>
> >> >
> >>
> >
>
Re: Error with camel-ejb
Posted by Charles Moulliard <cm...@gmail.com>.
yep. That works now using camel-ejb component on osgi.
On Thu, Jun 16, 2011 at 10:12 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> looks like what i've said ;)
>
> maybe try to specify manually imports.
>
> - Romain
>
> 2011/6/16 Charles Moulliard <cm...@gmail.com>
>
>> I progress. If I create a camel bean processor containing the code to
>> setup initial context and cal openEJB, i get this error now
>>
>> 21:53:49,737 | ERROR | foo | DefaultErrorHandler
>> | ache.camel.processor.CamelLogger 232 | 55 -
>> org.apache.camel.camel-core - 2.8.0.SNAPSHOT | Failed delivery for
>> exchangeId: ID-biker-chm-local-61842-1308253897457-1-17. Exhausted
>> after delivery attempt: 1 caught: java.lang.IllegalArgumentException:
>> interface org.apache.openejb.client.EJBObjectProxy is not visible from
>> class loader
>> java.lang.IllegalArgumentException: interface
>> org.apache.openejb.client.EJBObjectProxy is not visible from class
>> loader
>> at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)[:1.6.0_24]
>> at
>> java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)[:1.6.0_24]
>> at
>> org.apache.openejb.client.proxy.Jdk13ProxyFactory.newProxyInstance(Jdk13ProxyFactory.java:118)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
>> at
>> org.apache.openejb.client.proxy.ProxyManager.newProxyInstance(ProxyManager.java:107)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
>> at
>> org.apache.openejb.client.EJBObjectHandler.createEJBObjectProxy(EJBObjectHandler.java:126)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
>> at
>> org.apache.openejb.client.JNDIContext.createBusinessObject(JNDIContext.java:191)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
>> at
>> org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:232)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
>> at
>> javax.naming.InitialContext.lookup(InitialContext.java:392)[:1.6.0_24]
>> at
>> org.apache.camel.example.remote.ejb.EJBClientBean.process(EJBClientBean.java:41)[69:org.apache.camel.camel-example-remote-ejb:2.8.0.SNAPSHOT]
>> at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
>> at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_24]
>> at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_24]
>> at
>> org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:328)[55:org.apache.camel.camel-core:2.8.0.SNAPSHOT]
>> at
>> org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:230)[55:org.apache.camel.camel-core:2.8.0.SNAPSHOT]
>> at
>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:161)[55:org.apache.camel.camel-core:2.8.0.SNAPSHOT]
>>
>>
>>
>> On Thu, Jun 16, 2011 at 8:55 PM, Romain Manni-Bucau
>> <rm...@gmail.com> wrote:
>> > were you able to check properties?
>> >
>> > i think there are ignored if you are not in testing envt.
>> >
>> > - Romain
>> >
>> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
>> >
>> >> I have created a camel-example-remote-ejb project containing a test
>> >> case with a remote EJB deployed on openEJB and that works fine using
>> >> InitialContext with the properties provided in my first email. So the
>> >> project + remote EJB is in order. This is the camel + jndi in OSGI
>> >> container where we have a problem.
>> >>
>> >> On Thu, Jun 16, 2011 at 8:18 PM, Romain Manni-Bucau
>> >> <rm...@gmail.com> wrote:
>> >> > Charles, which part of code do you think is not working?
>> >> >
>> >> > I never tried the camel-ejb component in OSGi but i did openejb remote
>> >> > client in servicemix and it works fine and camel doesn't add anything
>> on
>> >> it,
>> >> > just a way to get a bean not the initial context.
>> >> >
>> >> > Can you just check your properties are used and if it is the case can
>> you
>> >> > try a manual client?
>> >> >
>> >> > I think i had some issues reading system.properties or jndi.properties
>> >> with
>> >> > camel in a non osgi envt some weeks ago (that's why i used spring to
>> do
>> >> the
>> >> > lookup).
>> >> >
>> >> > - Romain
>> >> >
>> >> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
>> >> >
>> >> >> The camel route has been deployed using deploy dir of servicemix and
>> >> >> DynamicImport package is enable. I have also installed the openEJB
>> >> >> client jar and wrapped it. So everything is in place
>> >> >>
>> >> >> On Thu, Jun 16, 2011 at 4:50 PM, Romain Manni-Bucau
>> >> >> <rm...@gmail.com> wrote:
>> >> >> > oh you are in an OSGi container?
>> >> >> >
>> >> >> > for openejb you have to import package org.apache.openejb.client
>> and
>> >> >> > org.apache.openejb.client.proxy i think or something like that (i
>> >> don't
>> >> >> > really remember).
>> >> >> >
>> >> >> > - Romain
>> >> >> >
>> >> >> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
>> >> >> >
>> >> >> >> I think that the code that we use to create the endpoint works
>> fine
>> >> in
>> >> >> >> a non osgi environment but not on osgi as jndi is not really
>> >> supported
>> >> >> >>
>> >> >> >> @Override
>> >> >> >> protected Endpoint createEndpoint(String uri, String remaining,
>> >> >> >> Map<String, Object> parameters) throws Exception {
>> >> >> >> BeanEndpoint answer = new BeanEndpoint(uri, this);
>> >> >> >> answer.setBeanName(remaining);
>> >> >> >>
>> >> >> >> // plugin registry to lookup in jndi for the EJBs
>> >> >> >> Registry registry = new JndiRegistry(getContext());
>> >> >> >> answer.setBeanHolder(new EjbRegistryBean(registry,
>> >> >> >> getCamelContext(), answer.getBeanName()));
>> >> >> >>
>> >> >> >> Processor processor = answer.getProcessor();
>> >> >> >> setProperties(processor, parameters);
>> >> >> >> return answer;
>> >> >> >> }
>> >> >> >>
>> >> >> >>
>> >> >> >> On Wed, Jun 15, 2011 at 11:33 PM, Romain Manni-Bucau
>> >> >> >> <rm...@gmail.com> wrote:
>> >> >> >> > Hi,
>> >> >> >> >
>> >> >> >> > creating a list with spring should work but i think the problem
>> is
>> >> the
>> >> >> >> > context creation here.
>> >> >> >> >
>> >> >> >> > personnaly i use the bean component and i ask to me (with java
>> dsl)
>> >> or
>> >> >> >> > spring to do the lookup to put it in the camel registry.
>> >> >> >> >
>> >> >> >> > - Romain
>> >> >> >> >
>> >> >> >> > 2011/6/15 Charles Moulliard <cm...@gmail.com>
>> >> >> >> >
>> >> >> >> >> Hi,
>> >> >> >> >>
>> >> >> >> >> I try to use openejb from camel using camel-ejb but get this
>> error
>> >> >> >> >> when camel looks to find the ejb stateless bean
>> >> >> >> >>
>> >> >> >> >> <beans xmlns="http://www.springframework.org/schema/beans"
>> >> >> >> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> >> >> >> >> xmlns:p="http://www.springframework.org/schema/util"
>> >> >> >> >> xsi:schemaLocation="
>> >> >> >> >> http://www.springframework.org/schema/beans
>> >> >> >> >> http://www.springframework.org/schema/beans/spring-beans.xsd
>> >> >> >> >> http://www.springframework.org/schema/util
>> >> >> >> >> http://www.springframework.org/schema/util/spring-util.xsd
>> >> >> >> >> http://camel.apache.org/schema/spring
>> >> >> >> >> http://camel.apache.org/schema/spring/camel-spring.xsd">
>> >> >> >> >>
>> >> >> >> >> <camelContext xmlns="http://camel.apache.org/schema/spring
>> ">
>> >> >> >> >> <route>
>> >> >> >> >> <from
>> uri="timer://foo?fixedRate=true&period=5s"/>
>> >> >> >> >> <setBody>
>> >> >> >> >> <constant>4</constant>
>> >> >> >> >> <constant>3</constant>
>> >> >> >> >> </setBody>
>> >> >> >> >> <to uri="ejb:CalculatorImplRemote?method=sum"/>
>> >> >> >> >> <log message=">>> Result : ${body}"/>
>> >> >> >> >> </route>
>> >> >> >> >> </camelContext>
>> >> >> >> >>
>> >> >> >> >> <!-- setup Camel EJB component -->
>> >> >> >> >> <bean id="ejb"
>> >> >> class="org.apache.camel.component.ejb.EjbComponent">
>> >> >> >> >> <property name="properties" ref="jndiProperties"/>
>> >> >> >> >> </bean>
>> >> >> >> >>
>> >> >> >> >> <!-- use OpenEJB context factory -->
>> >> >> >> >> <p:properties id="jndiProperties">
>> >> >> >> >> <prop
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> key="java.naming.factory.initial">org.apache.openejb.client.RemoteInitialContextFactory</prop>
>> >> >> >> >> <prop key="java.naming.provider.url">ejbd://
>> 127.0.0.1:4201
>> >> >> >> </prop>
>> >> >> >> >> <prop key="java.naming.security.principal">daniel</prop>
>> >> >> >> >> <prop
>> >> key="java.naming.security.credentials">password</prop>
>> >> >> >> >> </p:properties>
>> >> >> >> >>
>> >> >> >> >> </beans>
>> >> >> >> >>
>> >> >> >> >> 23:12:32,227 | ERROR | foo | DefaultErrorHandler
>> >> >> >> >> | ache.camel.processor.CamelLogger 232 | 64 -
>> >> >> >> >> org.apache.camel.camel-core - 2.7.0 | Failed delivery for
>> >> exchangeId:
>> >> >> >> >> ID-biker-chm-local-58833-1308171227583-5-6. Exhausted after
>> >> delivery
>> >> >> >> >> attempt: 1 caught: org.apache.camel.NoSuchBeanException: No
>> bean
>> >> >> could
>> >> >> >> >> be found in the registry for: CalculatorImplRemote
>> >> >> >> >> org.apache.camel.NoSuchBeanException: No bean could be found in
>> >> the
>> >> >> >> >> registry for: CalculatorImplRemote
>> >> >> >> >> at
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:68)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> >> >> at
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:84)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> >> >> at
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> >> >> at
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> >> >> at
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> >> >> at
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> >> >> at
>> >> >> >> >>
>> >> >> >>
>> >> >>
>> >>
>> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >> How can we define using <setBody> tag the following two
>> parameters
>> >> to
>> >> >> >> >> call the method sum of the stateless ejb CalculatorRemote ?
>> >> >> >> >>
>> >> >> >> >> public int sum(int add1, int add2);
>> >> >> >> >>
>> >> >> >> >> <setBody>
>> >> >> >> >> <constant>???</constant>
>> >> >> >> >> </setBody>
>> >> >> >> >>
>> >> >> >> >>
>> >> >> >> >> Regards,
>> >> >> >> >>
>> >> >> >> >> Charles Moulliard
>> >> >> >> >>
>> >> >> >> >> Apache Committer
>> >> >> >> >>
>> >> >> >> >> Blog : http://cmoulliard.blogspot.com
>> >> >> >> >> Twitter : http://twitter.com/cmoulliard
>> >> >> >> >> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>> >> >> >> >> Skype: cmoulliard
>> >> >> >> >>
>> >> >> >> >
>> >> >> >>
>> >> >> >
>> >> >>
>> >> >
>> >>
>> >
>>
>
Re: Error with camel-ejb
Posted by Romain Manni-Bucau <rm...@gmail.com>.
looks like what i've said ;)
maybe try to specify manually imports.
- Romain
2011/6/16 Charles Moulliard <cm...@gmail.com>
> I progress. If I create a camel bean processor containing the code to
> setup initial context and cal openEJB, i get this error now
>
> 21:53:49,737 | ERROR | foo | DefaultErrorHandler
> | ache.camel.processor.CamelLogger 232 | 55 -
> org.apache.camel.camel-core - 2.8.0.SNAPSHOT | Failed delivery for
> exchangeId: ID-biker-chm-local-61842-1308253897457-1-17. Exhausted
> after delivery attempt: 1 caught: java.lang.IllegalArgumentException:
> interface org.apache.openejb.client.EJBObjectProxy is not visible from
> class loader
> java.lang.IllegalArgumentException: interface
> org.apache.openejb.client.EJBObjectProxy is not visible from class
> loader
> at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)[:1.6.0_24]
> at
> java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)[:1.6.0_24]
> at
> org.apache.openejb.client.proxy.Jdk13ProxyFactory.newProxyInstance(Jdk13ProxyFactory.java:118)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
> at
> org.apache.openejb.client.proxy.ProxyManager.newProxyInstance(ProxyManager.java:107)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
> at
> org.apache.openejb.client.EJBObjectHandler.createEJBObjectProxy(EJBObjectHandler.java:126)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
> at
> org.apache.openejb.client.JNDIContext.createBusinessObject(JNDIContext.java:191)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
> at
> org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:232)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
> at
> javax.naming.InitialContext.lookup(InitialContext.java:392)[:1.6.0_24]
> at
> org.apache.camel.example.remote.ejb.EJBClientBean.process(EJBClientBean.java:41)[69:org.apache.camel.camel-example-remote-ejb:2.8.0.SNAPSHOT]
> at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_24]
> at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_24]
> at
> org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:328)[55:org.apache.camel.camel-core:2.8.0.SNAPSHOT]
> at
> org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:230)[55:org.apache.camel.camel-core:2.8.0.SNAPSHOT]
> at
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:161)[55:org.apache.camel.camel-core:2.8.0.SNAPSHOT]
>
>
>
> On Thu, Jun 16, 2011 at 8:55 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
> > were you able to check properties?
> >
> > i think there are ignored if you are not in testing envt.
> >
> > - Romain
> >
> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
> >
> >> I have created a camel-example-remote-ejb project containing a test
> >> case with a remote EJB deployed on openEJB and that works fine using
> >> InitialContext with the properties provided in my first email. So the
> >> project + remote EJB is in order. This is the camel + jndi in OSGI
> >> container where we have a problem.
> >>
> >> On Thu, Jun 16, 2011 at 8:18 PM, Romain Manni-Bucau
> >> <rm...@gmail.com> wrote:
> >> > Charles, which part of code do you think is not working?
> >> >
> >> > I never tried the camel-ejb component in OSGi but i did openejb remote
> >> > client in servicemix and it works fine and camel doesn't add anything
> on
> >> it,
> >> > just a way to get a bean not the initial context.
> >> >
> >> > Can you just check your properties are used and if it is the case can
> you
> >> > try a manual client?
> >> >
> >> > I think i had some issues reading system.properties or jndi.properties
> >> with
> >> > camel in a non osgi envt some weeks ago (that's why i used spring to
> do
> >> the
> >> > lookup).
> >> >
> >> > - Romain
> >> >
> >> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
> >> >
> >> >> The camel route has been deployed using deploy dir of servicemix and
> >> >> DynamicImport package is enable. I have also installed the openEJB
> >> >> client jar and wrapped it. So everything is in place
> >> >>
> >> >> On Thu, Jun 16, 2011 at 4:50 PM, Romain Manni-Bucau
> >> >> <rm...@gmail.com> wrote:
> >> >> > oh you are in an OSGi container?
> >> >> >
> >> >> > for openejb you have to import package org.apache.openejb.client
> and
> >> >> > org.apache.openejb.client.proxy i think or something like that (i
> >> don't
> >> >> > really remember).
> >> >> >
> >> >> > - Romain
> >> >> >
> >> >> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
> >> >> >
> >> >> >> I think that the code that we use to create the endpoint works
> fine
> >> in
> >> >> >> a non osgi environment but not on osgi as jndi is not really
> >> supported
> >> >> >>
> >> >> >> @Override
> >> >> >> protected Endpoint createEndpoint(String uri, String remaining,
> >> >> >> Map<String, Object> parameters) throws Exception {
> >> >> >> BeanEndpoint answer = new BeanEndpoint(uri, this);
> >> >> >> answer.setBeanName(remaining);
> >> >> >>
> >> >> >> // plugin registry to lookup in jndi for the EJBs
> >> >> >> Registry registry = new JndiRegistry(getContext());
> >> >> >> answer.setBeanHolder(new EjbRegistryBean(registry,
> >> >> >> getCamelContext(), answer.getBeanName()));
> >> >> >>
> >> >> >> Processor processor = answer.getProcessor();
> >> >> >> setProperties(processor, parameters);
> >> >> >> return answer;
> >> >> >> }
> >> >> >>
> >> >> >>
> >> >> >> On Wed, Jun 15, 2011 at 11:33 PM, Romain Manni-Bucau
> >> >> >> <rm...@gmail.com> wrote:
> >> >> >> > Hi,
> >> >> >> >
> >> >> >> > creating a list with spring should work but i think the problem
> is
> >> the
> >> >> >> > context creation here.
> >> >> >> >
> >> >> >> > personnaly i use the bean component and i ask to me (with java
> dsl)
> >> or
> >> >> >> > spring to do the lookup to put it in the camel registry.
> >> >> >> >
> >> >> >> > - Romain
> >> >> >> >
> >> >> >> > 2011/6/15 Charles Moulliard <cm...@gmail.com>
> >> >> >> >
> >> >> >> >> Hi,
> >> >> >> >>
> >> >> >> >> I try to use openejb from camel using camel-ejb but get this
> error
> >> >> >> >> when camel looks to find the ejb stateless bean
> >> >> >> >>
> >> >> >> >> <beans xmlns="http://www.springframework.org/schema/beans"
> >> >> >> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >> >> >> >> xmlns:p="http://www.springframework.org/schema/util"
> >> >> >> >> xsi:schemaLocation="
> >> >> >> >> http://www.springframework.org/schema/beans
> >> >> >> >> http://www.springframework.org/schema/beans/spring-beans.xsd
> >> >> >> >> http://www.springframework.org/schema/util
> >> >> >> >> http://www.springframework.org/schema/util/spring-util.xsd
> >> >> >> >> http://camel.apache.org/schema/spring
> >> >> >> >> http://camel.apache.org/schema/spring/camel-spring.xsd">
> >> >> >> >>
> >> >> >> >> <camelContext xmlns="http://camel.apache.org/schema/spring
> ">
> >> >> >> >> <route>
> >> >> >> >> <from
> uri="timer://foo?fixedRate=true&period=5s"/>
> >> >> >> >> <setBody>
> >> >> >> >> <constant>4</constant>
> >> >> >> >> <constant>3</constant>
> >> >> >> >> </setBody>
> >> >> >> >> <to uri="ejb:CalculatorImplRemote?method=sum"/>
> >> >> >> >> <log message=">>> Result : ${body}"/>
> >> >> >> >> </route>
> >> >> >> >> </camelContext>
> >> >> >> >>
> >> >> >> >> <!-- setup Camel EJB component -->
> >> >> >> >> <bean id="ejb"
> >> >> class="org.apache.camel.component.ejb.EjbComponent">
> >> >> >> >> <property name="properties" ref="jndiProperties"/>
> >> >> >> >> </bean>
> >> >> >> >>
> >> >> >> >> <!-- use OpenEJB context factory -->
> >> >> >> >> <p:properties id="jndiProperties">
> >> >> >> >> <prop
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> key="java.naming.factory.initial">org.apache.openejb.client.RemoteInitialContextFactory</prop>
> >> >> >> >> <prop key="java.naming.provider.url">ejbd://
> 127.0.0.1:4201
> >> >> >> </prop>
> >> >> >> >> <prop key="java.naming.security.principal">daniel</prop>
> >> >> >> >> <prop
> >> key="java.naming.security.credentials">password</prop>
> >> >> >> >> </p:properties>
> >> >> >> >>
> >> >> >> >> </beans>
> >> >> >> >>
> >> >> >> >> 23:12:32,227 | ERROR | foo | DefaultErrorHandler
> >> >> >> >> | ache.camel.processor.CamelLogger 232 | 64 -
> >> >> >> >> org.apache.camel.camel-core - 2.7.0 | Failed delivery for
> >> exchangeId:
> >> >> >> >> ID-biker-chm-local-58833-1308171227583-5-6. Exhausted after
> >> delivery
> >> >> >> >> attempt: 1 caught: org.apache.camel.NoSuchBeanException: No
> bean
> >> >> could
> >> >> >> >> be found in the registry for: CalculatorImplRemote
> >> >> >> >> org.apache.camel.NoSuchBeanException: No bean could be found in
> >> the
> >> >> >> >> registry for: CalculatorImplRemote
> >> >> >> >> at
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:68)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> >> at
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:84)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> >> at
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> >> at
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> >> at
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> >> at
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> >> at
> >> >> >> >>
> >> >> >>
> >> >>
> >>
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> How can we define using <setBody> tag the following two
> parameters
> >> to
> >> >> >> >> call the method sum of the stateless ejb CalculatorRemote ?
> >> >> >> >>
> >> >> >> >> public int sum(int add1, int add2);
> >> >> >> >>
> >> >> >> >> <setBody>
> >> >> >> >> <constant>???</constant>
> >> >> >> >> </setBody>
> >> >> >> >>
> >> >> >> >>
> >> >> >> >> Regards,
> >> >> >> >>
> >> >> >> >> Charles Moulliard
> >> >> >> >>
> >> >> >> >> Apache Committer
> >> >> >> >>
> >> >> >> >> Blog : http://cmoulliard.blogspot.com
> >> >> >> >> Twitter : http://twitter.com/cmoulliard
> >> >> >> >> Linkedin : http://www.linkedin.com/in/charlesmoulliard
> >> >> >> >> Skype: cmoulliard
> >> >> >> >>
> >> >> >> >
> >> >> >>
> >> >> >
> >> >>
> >> >
> >>
> >
>
Re: Error with camel-ejb
Posted by Charles Moulliard <cm...@gmail.com>.
I progress. If I create a camel bean processor containing the code to
setup initial context and cal openEJB, i get this error now
21:53:49,737 | ERROR | foo | DefaultErrorHandler
| ache.camel.processor.CamelLogger 232 | 55 -
org.apache.camel.camel-core - 2.8.0.SNAPSHOT | Failed delivery for
exchangeId: ID-biker-chm-local-61842-1308253897457-1-17. Exhausted
after delivery attempt: 1 caught: java.lang.IllegalArgumentException:
interface org.apache.openejb.client.EJBObjectProxy is not visible from
class loader
java.lang.IllegalArgumentException: interface
org.apache.openejb.client.EJBObjectProxy is not visible from class
loader
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)[:1.6.0_24]
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)[:1.6.0_24]
at org.apache.openejb.client.proxy.Jdk13ProxyFactory.newProxyInstance(Jdk13ProxyFactory.java:118)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
at org.apache.openejb.client.proxy.ProxyManager.newProxyInstance(ProxyManager.java:107)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
at org.apache.openejb.client.EJBObjectHandler.createEJBObjectProxy(EJBObjectHandler.java:126)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
at org.apache.openejb.client.JNDIContext.createBusinessObject(JNDIContext.java:191)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:232)[66:org.apache.openejb.client:4.0.0.SNAPSHOT]
at javax.naming.InitialContext.lookup(InitialContext.java:392)[:1.6.0_24]
at org.apache.camel.example.remote.ejb.EJBClientBean.process(EJBClientBean.java:41)[69:org.apache.camel.camel-example-remote-ejb:2.8.0.SNAPSHOT]
at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_24]
at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_24]
at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:328)[55:org.apache.camel.camel-core:2.8.0.SNAPSHOT]
at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:230)[55:org.apache.camel.camel-core:2.8.0.SNAPSHOT]
at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:161)[55:org.apache.camel.camel-core:2.8.0.SNAPSHOT]
On Thu, Jun 16, 2011 at 8:55 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> were you able to check properties?
>
> i think there are ignored if you are not in testing envt.
>
> - Romain
>
> 2011/6/16 Charles Moulliard <cm...@gmail.com>
>
>> I have created a camel-example-remote-ejb project containing a test
>> case with a remote EJB deployed on openEJB and that works fine using
>> InitialContext with the properties provided in my first email. So the
>> project + remote EJB is in order. This is the camel + jndi in OSGI
>> container where we have a problem.
>>
>> On Thu, Jun 16, 2011 at 8:18 PM, Romain Manni-Bucau
>> <rm...@gmail.com> wrote:
>> > Charles, which part of code do you think is not working?
>> >
>> > I never tried the camel-ejb component in OSGi but i did openejb remote
>> > client in servicemix and it works fine and camel doesn't add anything on
>> it,
>> > just a way to get a bean not the initial context.
>> >
>> > Can you just check your properties are used and if it is the case can you
>> > try a manual client?
>> >
>> > I think i had some issues reading system.properties or jndi.properties
>> with
>> > camel in a non osgi envt some weeks ago (that's why i used spring to do
>> the
>> > lookup).
>> >
>> > - Romain
>> >
>> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
>> >
>> >> The camel route has been deployed using deploy dir of servicemix and
>> >> DynamicImport package is enable. I have also installed the openEJB
>> >> client jar and wrapped it. So everything is in place
>> >>
>> >> On Thu, Jun 16, 2011 at 4:50 PM, Romain Manni-Bucau
>> >> <rm...@gmail.com> wrote:
>> >> > oh you are in an OSGi container?
>> >> >
>> >> > for openejb you have to import package org.apache.openejb.client and
>> >> > org.apache.openejb.client.proxy i think or something like that (i
>> don't
>> >> > really remember).
>> >> >
>> >> > - Romain
>> >> >
>> >> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
>> >> >
>> >> >> I think that the code that we use to create the endpoint works fine
>> in
>> >> >> a non osgi environment but not on osgi as jndi is not really
>> supported
>> >> >>
>> >> >> @Override
>> >> >> protected Endpoint createEndpoint(String uri, String remaining,
>> >> >> Map<String, Object> parameters) throws Exception {
>> >> >> BeanEndpoint answer = new BeanEndpoint(uri, this);
>> >> >> answer.setBeanName(remaining);
>> >> >>
>> >> >> // plugin registry to lookup in jndi for the EJBs
>> >> >> Registry registry = new JndiRegistry(getContext());
>> >> >> answer.setBeanHolder(new EjbRegistryBean(registry,
>> >> >> getCamelContext(), answer.getBeanName()));
>> >> >>
>> >> >> Processor processor = answer.getProcessor();
>> >> >> setProperties(processor, parameters);
>> >> >> return answer;
>> >> >> }
>> >> >>
>> >> >>
>> >> >> On Wed, Jun 15, 2011 at 11:33 PM, Romain Manni-Bucau
>> >> >> <rm...@gmail.com> wrote:
>> >> >> > Hi,
>> >> >> >
>> >> >> > creating a list with spring should work but i think the problem is
>> the
>> >> >> > context creation here.
>> >> >> >
>> >> >> > personnaly i use the bean component and i ask to me (with java dsl)
>> or
>> >> >> > spring to do the lookup to put it in the camel registry.
>> >> >> >
>> >> >> > - Romain
>> >> >> >
>> >> >> > 2011/6/15 Charles Moulliard <cm...@gmail.com>
>> >> >> >
>> >> >> >> Hi,
>> >> >> >>
>> >> >> >> I try to use openejb from camel using camel-ejb but get this error
>> >> >> >> when camel looks to find the ejb stateless bean
>> >> >> >>
>> >> >> >> <beans xmlns="http://www.springframework.org/schema/beans"
>> >> >> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> >> >> >> xmlns:p="http://www.springframework.org/schema/util"
>> >> >> >> xsi:schemaLocation="
>> >> >> >> http://www.springframework.org/schema/beans
>> >> >> >> http://www.springframework.org/schema/beans/spring-beans.xsd
>> >> >> >> http://www.springframework.org/schema/util
>> >> >> >> http://www.springframework.org/schema/util/spring-util.xsd
>> >> >> >> http://camel.apache.org/schema/spring
>> >> >> >> http://camel.apache.org/schema/spring/camel-spring.xsd">
>> >> >> >>
>> >> >> >> <camelContext xmlns="http://camel.apache.org/schema/spring">
>> >> >> >> <route>
>> >> >> >> <from uri="timer://foo?fixedRate=true&period=5s"/>
>> >> >> >> <setBody>
>> >> >> >> <constant>4</constant>
>> >> >> >> <constant>3</constant>
>> >> >> >> </setBody>
>> >> >> >> <to uri="ejb:CalculatorImplRemote?method=sum"/>
>> >> >> >> <log message=">>> Result : ${body}"/>
>> >> >> >> </route>
>> >> >> >> </camelContext>
>> >> >> >>
>> >> >> >> <!-- setup Camel EJB component -->
>> >> >> >> <bean id="ejb"
>> >> class="org.apache.camel.component.ejb.EjbComponent">
>> >> >> >> <property name="properties" ref="jndiProperties"/>
>> >> >> >> </bean>
>> >> >> >>
>> >> >> >> <!-- use OpenEJB context factory -->
>> >> >> >> <p:properties id="jndiProperties">
>> >> >> >> <prop
>> >> >> >>
>> >> >>
>> >>
>> key="java.naming.factory.initial">org.apache.openejb.client.RemoteInitialContextFactory</prop>
>> >> >> >> <prop key="java.naming.provider.url">ejbd://127.0.0.1:4201
>> >> >> </prop>
>> >> >> >> <prop key="java.naming.security.principal">daniel</prop>
>> >> >> >> <prop
>> key="java.naming.security.credentials">password</prop>
>> >> >> >> </p:properties>
>> >> >> >>
>> >> >> >> </beans>
>> >> >> >>
>> >> >> >> 23:12:32,227 | ERROR | foo | DefaultErrorHandler
>> >> >> >> | ache.camel.processor.CamelLogger 232 | 64 -
>> >> >> >> org.apache.camel.camel-core - 2.7.0 | Failed delivery for
>> exchangeId:
>> >> >> >> ID-biker-chm-local-58833-1308171227583-5-6. Exhausted after
>> delivery
>> >> >> >> attempt: 1 caught: org.apache.camel.NoSuchBeanException: No bean
>> >> could
>> >> >> >> be found in the registry for: CalculatorImplRemote
>> >> >> >> org.apache.camel.NoSuchBeanException: No bean could be found in
>> the
>> >> >> >> registry for: CalculatorImplRemote
>> >> >> >> at
>> >> >> >>
>> >> >>
>> >>
>> org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:68)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> >> at
>> >> >> >>
>> >> >>
>> >>
>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:84)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> >> at
>> >> >> >>
>> >> >>
>> >>
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> >> at
>> >> >> >>
>> >> >>
>> >>
>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> >> at
>> >> >> >>
>> >> >>
>> >>
>> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> >> at
>> >> >> >>
>> >> >>
>> >>
>> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> >> at
>> >> >> >>
>> >> >>
>> >>
>> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> >>
>> >> >> >>
>> >> >> >> How can we define using <setBody> tag the following two parameters
>> to
>> >> >> >> call the method sum of the stateless ejb CalculatorRemote ?
>> >> >> >>
>> >> >> >> public int sum(int add1, int add2);
>> >> >> >>
>> >> >> >> <setBody>
>> >> >> >> <constant>???</constant>
>> >> >> >> </setBody>
>> >> >> >>
>> >> >> >>
>> >> >> >> Regards,
>> >> >> >>
>> >> >> >> Charles Moulliard
>> >> >> >>
>> >> >> >> Apache Committer
>> >> >> >>
>> >> >> >> Blog : http://cmoulliard.blogspot.com
>> >> >> >> Twitter : http://twitter.com/cmoulliard
>> >> >> >> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>> >> >> >> Skype: cmoulliard
>> >> >> >>
>> >> >> >
>> >> >>
>> >> >
>> >>
>> >
>>
>
Re: Error with camel-ejb
Posted by Romain Manni-Bucau <rm...@gmail.com>.
were you able to check properties?
i think there are ignored if you are not in testing envt.
- Romain
2011/6/16 Charles Moulliard <cm...@gmail.com>
> I have created a camel-example-remote-ejb project containing a test
> case with a remote EJB deployed on openEJB and that works fine using
> InitialContext with the properties provided in my first email. So the
> project + remote EJB is in order. This is the camel + jndi in OSGI
> container where we have a problem.
>
> On Thu, Jun 16, 2011 at 8:18 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
> > Charles, which part of code do you think is not working?
> >
> > I never tried the camel-ejb component in OSGi but i did openejb remote
> > client in servicemix and it works fine and camel doesn't add anything on
> it,
> > just a way to get a bean not the initial context.
> >
> > Can you just check your properties are used and if it is the case can you
> > try a manual client?
> >
> > I think i had some issues reading system.properties or jndi.properties
> with
> > camel in a non osgi envt some weeks ago (that's why i used spring to do
> the
> > lookup).
> >
> > - Romain
> >
> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
> >
> >> The camel route has been deployed using deploy dir of servicemix and
> >> DynamicImport package is enable. I have also installed the openEJB
> >> client jar and wrapped it. So everything is in place
> >>
> >> On Thu, Jun 16, 2011 at 4:50 PM, Romain Manni-Bucau
> >> <rm...@gmail.com> wrote:
> >> > oh you are in an OSGi container?
> >> >
> >> > for openejb you have to import package org.apache.openejb.client and
> >> > org.apache.openejb.client.proxy i think or something like that (i
> don't
> >> > really remember).
> >> >
> >> > - Romain
> >> >
> >> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
> >> >
> >> >> I think that the code that we use to create the endpoint works fine
> in
> >> >> a non osgi environment but not on osgi as jndi is not really
> supported
> >> >>
> >> >> @Override
> >> >> protected Endpoint createEndpoint(String uri, String remaining,
> >> >> Map<String, Object> parameters) throws Exception {
> >> >> BeanEndpoint answer = new BeanEndpoint(uri, this);
> >> >> answer.setBeanName(remaining);
> >> >>
> >> >> // plugin registry to lookup in jndi for the EJBs
> >> >> Registry registry = new JndiRegistry(getContext());
> >> >> answer.setBeanHolder(new EjbRegistryBean(registry,
> >> >> getCamelContext(), answer.getBeanName()));
> >> >>
> >> >> Processor processor = answer.getProcessor();
> >> >> setProperties(processor, parameters);
> >> >> return answer;
> >> >> }
> >> >>
> >> >>
> >> >> On Wed, Jun 15, 2011 at 11:33 PM, Romain Manni-Bucau
> >> >> <rm...@gmail.com> wrote:
> >> >> > Hi,
> >> >> >
> >> >> > creating a list with spring should work but i think the problem is
> the
> >> >> > context creation here.
> >> >> >
> >> >> > personnaly i use the bean component and i ask to me (with java dsl)
> or
> >> >> > spring to do the lookup to put it in the camel registry.
> >> >> >
> >> >> > - Romain
> >> >> >
> >> >> > 2011/6/15 Charles Moulliard <cm...@gmail.com>
> >> >> >
> >> >> >> Hi,
> >> >> >>
> >> >> >> I try to use openejb from camel using camel-ejb but get this error
> >> >> >> when camel looks to find the ejb stateless bean
> >> >> >>
> >> >> >> <beans xmlns="http://www.springframework.org/schema/beans"
> >> >> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >> >> >> xmlns:p="http://www.springframework.org/schema/util"
> >> >> >> xsi:schemaLocation="
> >> >> >> http://www.springframework.org/schema/beans
> >> >> >> http://www.springframework.org/schema/beans/spring-beans.xsd
> >> >> >> http://www.springframework.org/schema/util
> >> >> >> http://www.springframework.org/schema/util/spring-util.xsd
> >> >> >> http://camel.apache.org/schema/spring
> >> >> >> http://camel.apache.org/schema/spring/camel-spring.xsd">
> >> >> >>
> >> >> >> <camelContext xmlns="http://camel.apache.org/schema/spring">
> >> >> >> <route>
> >> >> >> <from uri="timer://foo?fixedRate=true&period=5s"/>
> >> >> >> <setBody>
> >> >> >> <constant>4</constant>
> >> >> >> <constant>3</constant>
> >> >> >> </setBody>
> >> >> >> <to uri="ejb:CalculatorImplRemote?method=sum"/>
> >> >> >> <log message=">>> Result : ${body}"/>
> >> >> >> </route>
> >> >> >> </camelContext>
> >> >> >>
> >> >> >> <!-- setup Camel EJB component -->
> >> >> >> <bean id="ejb"
> >> class="org.apache.camel.component.ejb.EjbComponent">
> >> >> >> <property name="properties" ref="jndiProperties"/>
> >> >> >> </bean>
> >> >> >>
> >> >> >> <!-- use OpenEJB context factory -->
> >> >> >> <p:properties id="jndiProperties">
> >> >> >> <prop
> >> >> >>
> >> >>
> >>
> key="java.naming.factory.initial">org.apache.openejb.client.RemoteInitialContextFactory</prop>
> >> >> >> <prop key="java.naming.provider.url">ejbd://127.0.0.1:4201
> >> >> </prop>
> >> >> >> <prop key="java.naming.security.principal">daniel</prop>
> >> >> >> <prop
> key="java.naming.security.credentials">password</prop>
> >> >> >> </p:properties>
> >> >> >>
> >> >> >> </beans>
> >> >> >>
> >> >> >> 23:12:32,227 | ERROR | foo | DefaultErrorHandler
> >> >> >> | ache.camel.processor.CamelLogger 232 | 64 -
> >> >> >> org.apache.camel.camel-core - 2.7.0 | Failed delivery for
> exchangeId:
> >> >> >> ID-biker-chm-local-58833-1308171227583-5-6. Exhausted after
> delivery
> >> >> >> attempt: 1 caught: org.apache.camel.NoSuchBeanException: No bean
> >> could
> >> >> >> be found in the registry for: CalculatorImplRemote
> >> >> >> org.apache.camel.NoSuchBeanException: No bean could be found in
> the
> >> >> >> registry for: CalculatorImplRemote
> >> >> >> at
> >> >> >>
> >> >>
> >>
> org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:68)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> at
> >> >> >>
> >> >>
> >>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:84)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> at
> >> >> >>
> >> >>
> >>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> at
> >> >> >>
> >> >>
> >>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> at
> >> >> >>
> >> >>
> >>
> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> at
> >> >> >>
> >> >>
> >>
> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >> at
> >> >> >>
> >> >>
> >>
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[64:org.apache.camel.camel-core:2.7.0]
> >> >> >>
> >> >> >>
> >> >> >> How can we define using <setBody> tag the following two parameters
> to
> >> >> >> call the method sum of the stateless ejb CalculatorRemote ?
> >> >> >>
> >> >> >> public int sum(int add1, int add2);
> >> >> >>
> >> >> >> <setBody>
> >> >> >> <constant>???</constant>
> >> >> >> </setBody>
> >> >> >>
> >> >> >>
> >> >> >> Regards,
> >> >> >>
> >> >> >> Charles Moulliard
> >> >> >>
> >> >> >> Apache Committer
> >> >> >>
> >> >> >> Blog : http://cmoulliard.blogspot.com
> >> >> >> Twitter : http://twitter.com/cmoulliard
> >> >> >> Linkedin : http://www.linkedin.com/in/charlesmoulliard
> >> >> >> Skype: cmoulliard
> >> >> >>
> >> >> >
> >> >>
> >> >
> >>
> >
>
Re: Error with camel-ejb
Posted by Charles Moulliard <cm...@gmail.com>.
I have created a camel-example-remote-ejb project containing a test
case with a remote EJB deployed on openEJB and that works fine using
InitialContext with the properties provided in my first email. So the
project + remote EJB is in order. This is the camel + jndi in OSGI
container where we have a problem.
On Thu, Jun 16, 2011 at 8:18 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> Charles, which part of code do you think is not working?
>
> I never tried the camel-ejb component in OSGi but i did openejb remote
> client in servicemix and it works fine and camel doesn't add anything on it,
> just a way to get a bean not the initial context.
>
> Can you just check your properties are used and if it is the case can you
> try a manual client?
>
> I think i had some issues reading system.properties or jndi.properties with
> camel in a non osgi envt some weeks ago (that's why i used spring to do the
> lookup).
>
> - Romain
>
> 2011/6/16 Charles Moulliard <cm...@gmail.com>
>
>> The camel route has been deployed using deploy dir of servicemix and
>> DynamicImport package is enable. I have also installed the openEJB
>> client jar and wrapped it. So everything is in place
>>
>> On Thu, Jun 16, 2011 at 4:50 PM, Romain Manni-Bucau
>> <rm...@gmail.com> wrote:
>> > oh you are in an OSGi container?
>> >
>> > for openejb you have to import package org.apache.openejb.client and
>> > org.apache.openejb.client.proxy i think or something like that (i don't
>> > really remember).
>> >
>> > - Romain
>> >
>> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
>> >
>> >> I think that the code that we use to create the endpoint works fine in
>> >> a non osgi environment but not on osgi as jndi is not really supported
>> >>
>> >> @Override
>> >> protected Endpoint createEndpoint(String uri, String remaining,
>> >> Map<String, Object> parameters) throws Exception {
>> >> BeanEndpoint answer = new BeanEndpoint(uri, this);
>> >> answer.setBeanName(remaining);
>> >>
>> >> // plugin registry to lookup in jndi for the EJBs
>> >> Registry registry = new JndiRegistry(getContext());
>> >> answer.setBeanHolder(new EjbRegistryBean(registry,
>> >> getCamelContext(), answer.getBeanName()));
>> >>
>> >> Processor processor = answer.getProcessor();
>> >> setProperties(processor, parameters);
>> >> return answer;
>> >> }
>> >>
>> >>
>> >> On Wed, Jun 15, 2011 at 11:33 PM, Romain Manni-Bucau
>> >> <rm...@gmail.com> wrote:
>> >> > Hi,
>> >> >
>> >> > creating a list with spring should work but i think the problem is the
>> >> > context creation here.
>> >> >
>> >> > personnaly i use the bean component and i ask to me (with java dsl) or
>> >> > spring to do the lookup to put it in the camel registry.
>> >> >
>> >> > - Romain
>> >> >
>> >> > 2011/6/15 Charles Moulliard <cm...@gmail.com>
>> >> >
>> >> >> Hi,
>> >> >>
>> >> >> I try to use openejb from camel using camel-ejb but get this error
>> >> >> when camel looks to find the ejb stateless bean
>> >> >>
>> >> >> <beans xmlns="http://www.springframework.org/schema/beans"
>> >> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> >> >> xmlns:p="http://www.springframework.org/schema/util"
>> >> >> xsi:schemaLocation="
>> >> >> http://www.springframework.org/schema/beans
>> >> >> http://www.springframework.org/schema/beans/spring-beans.xsd
>> >> >> http://www.springframework.org/schema/util
>> >> >> http://www.springframework.org/schema/util/spring-util.xsd
>> >> >> http://camel.apache.org/schema/spring
>> >> >> http://camel.apache.org/schema/spring/camel-spring.xsd">
>> >> >>
>> >> >> <camelContext xmlns="http://camel.apache.org/schema/spring">
>> >> >> <route>
>> >> >> <from uri="timer://foo?fixedRate=true&period=5s"/>
>> >> >> <setBody>
>> >> >> <constant>4</constant>
>> >> >> <constant>3</constant>
>> >> >> </setBody>
>> >> >> <to uri="ejb:CalculatorImplRemote?method=sum"/>
>> >> >> <log message=">>> Result : ${body}"/>
>> >> >> </route>
>> >> >> </camelContext>
>> >> >>
>> >> >> <!-- setup Camel EJB component -->
>> >> >> <bean id="ejb"
>> class="org.apache.camel.component.ejb.EjbComponent">
>> >> >> <property name="properties" ref="jndiProperties"/>
>> >> >> </bean>
>> >> >>
>> >> >> <!-- use OpenEJB context factory -->
>> >> >> <p:properties id="jndiProperties">
>> >> >> <prop
>> >> >>
>> >>
>> key="java.naming.factory.initial">org.apache.openejb.client.RemoteInitialContextFactory</prop>
>> >> >> <prop key="java.naming.provider.url">ejbd://127.0.0.1:4201
>> >> </prop>
>> >> >> <prop key="java.naming.security.principal">daniel</prop>
>> >> >> <prop key="java.naming.security.credentials">password</prop>
>> >> >> </p:properties>
>> >> >>
>> >> >> </beans>
>> >> >>
>> >> >> 23:12:32,227 | ERROR | foo | DefaultErrorHandler
>> >> >> | ache.camel.processor.CamelLogger 232 | 64 -
>> >> >> org.apache.camel.camel-core - 2.7.0 | Failed delivery for exchangeId:
>> >> >> ID-biker-chm-local-58833-1308171227583-5-6. Exhausted after delivery
>> >> >> attempt: 1 caught: org.apache.camel.NoSuchBeanException: No bean
>> could
>> >> >> be found in the registry for: CalculatorImplRemote
>> >> >> org.apache.camel.NoSuchBeanException: No bean could be found in the
>> >> >> registry for: CalculatorImplRemote
>> >> >> at
>> >> >>
>> >>
>> org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:68)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> at
>> >> >>
>> >>
>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:84)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> at
>> >> >>
>> >>
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> at
>> >> >>
>> >>
>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> at
>> >> >>
>> >>
>> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> at
>> >> >>
>> >>
>> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[64:org.apache.camel.camel-core:2.7.0]
>> >> >> at
>> >> >>
>> >>
>> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[64:org.apache.camel.camel-core:2.7.0]
>> >> >>
>> >> >>
>> >> >> How can we define using <setBody> tag the following two parameters to
>> >> >> call the method sum of the stateless ejb CalculatorRemote ?
>> >> >>
>> >> >> public int sum(int add1, int add2);
>> >> >>
>> >> >> <setBody>
>> >> >> <constant>???</constant>
>> >> >> </setBody>
>> >> >>
>> >> >>
>> >> >> Regards,
>> >> >>
>> >> >> Charles Moulliard
>> >> >>
>> >> >> Apache Committer
>> >> >>
>> >> >> Blog : http://cmoulliard.blogspot.com
>> >> >> Twitter : http://twitter.com/cmoulliard
>> >> >> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>> >> >> Skype: cmoulliard
>> >> >>
>> >> >
>> >>
>> >
>>
>
Re: Error with camel-ejb
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Charles, which part of code do you think is not working?
I never tried the camel-ejb component in OSGi but i did openejb remote
client in servicemix and it works fine and camel doesn't add anything on it,
just a way to get a bean not the initial context.
Can you just check your properties are used and if it is the case can you
try a manual client?
I think i had some issues reading system.properties or jndi.properties with
camel in a non osgi envt some weeks ago (that's why i used spring to do the
lookup).
- Romain
2011/6/16 Charles Moulliard <cm...@gmail.com>
> The camel route has been deployed using deploy dir of servicemix and
> DynamicImport package is enable. I have also installed the openEJB
> client jar and wrapped it. So everything is in place
>
> On Thu, Jun 16, 2011 at 4:50 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
> > oh you are in an OSGi container?
> >
> > for openejb you have to import package org.apache.openejb.client and
> > org.apache.openejb.client.proxy i think or something like that (i don't
> > really remember).
> >
> > - Romain
> >
> > 2011/6/16 Charles Moulliard <cm...@gmail.com>
> >
> >> I think that the code that we use to create the endpoint works fine in
> >> a non osgi environment but not on osgi as jndi is not really supported
> >>
> >> @Override
> >> protected Endpoint createEndpoint(String uri, String remaining,
> >> Map<String, Object> parameters) throws Exception {
> >> BeanEndpoint answer = new BeanEndpoint(uri, this);
> >> answer.setBeanName(remaining);
> >>
> >> // plugin registry to lookup in jndi for the EJBs
> >> Registry registry = new JndiRegistry(getContext());
> >> answer.setBeanHolder(new EjbRegistryBean(registry,
> >> getCamelContext(), answer.getBeanName()));
> >>
> >> Processor processor = answer.getProcessor();
> >> setProperties(processor, parameters);
> >> return answer;
> >> }
> >>
> >>
> >> On Wed, Jun 15, 2011 at 11:33 PM, Romain Manni-Bucau
> >> <rm...@gmail.com> wrote:
> >> > Hi,
> >> >
> >> > creating a list with spring should work but i think the problem is the
> >> > context creation here.
> >> >
> >> > personnaly i use the bean component and i ask to me (with java dsl) or
> >> > spring to do the lookup to put it in the camel registry.
> >> >
> >> > - Romain
> >> >
> >> > 2011/6/15 Charles Moulliard <cm...@gmail.com>
> >> >
> >> >> Hi,
> >> >>
> >> >> I try to use openejb from camel using camel-ejb but get this error
> >> >> when camel looks to find the ejb stateless bean
> >> >>
> >> >> <beans xmlns="http://www.springframework.org/schema/beans"
> >> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >> >> xmlns:p="http://www.springframework.org/schema/util"
> >> >> xsi:schemaLocation="
> >> >> http://www.springframework.org/schema/beans
> >> >> http://www.springframework.org/schema/beans/spring-beans.xsd
> >> >> http://www.springframework.org/schema/util
> >> >> http://www.springframework.org/schema/util/spring-util.xsd
> >> >> http://camel.apache.org/schema/spring
> >> >> http://camel.apache.org/schema/spring/camel-spring.xsd">
> >> >>
> >> >> <camelContext xmlns="http://camel.apache.org/schema/spring">
> >> >> <route>
> >> >> <from uri="timer://foo?fixedRate=true&period=5s"/>
> >> >> <setBody>
> >> >> <constant>4</constant>
> >> >> <constant>3</constant>
> >> >> </setBody>
> >> >> <to uri="ejb:CalculatorImplRemote?method=sum"/>
> >> >> <log message=">>> Result : ${body}"/>
> >> >> </route>
> >> >> </camelContext>
> >> >>
> >> >> <!-- setup Camel EJB component -->
> >> >> <bean id="ejb"
> class="org.apache.camel.component.ejb.EjbComponent">
> >> >> <property name="properties" ref="jndiProperties"/>
> >> >> </bean>
> >> >>
> >> >> <!-- use OpenEJB context factory -->
> >> >> <p:properties id="jndiProperties">
> >> >> <prop
> >> >>
> >>
> key="java.naming.factory.initial">org.apache.openejb.client.RemoteInitialContextFactory</prop>
> >> >> <prop key="java.naming.provider.url">ejbd://127.0.0.1:4201
> >> </prop>
> >> >> <prop key="java.naming.security.principal">daniel</prop>
> >> >> <prop key="java.naming.security.credentials">password</prop>
> >> >> </p:properties>
> >> >>
> >> >> </beans>
> >> >>
> >> >> 23:12:32,227 | ERROR | foo | DefaultErrorHandler
> >> >> | ache.camel.processor.CamelLogger 232 | 64 -
> >> >> org.apache.camel.camel-core - 2.7.0 | Failed delivery for exchangeId:
> >> >> ID-biker-chm-local-58833-1308171227583-5-6. Exhausted after delivery
> >> >> attempt: 1 caught: org.apache.camel.NoSuchBeanException: No bean
> could
> >> >> be found in the registry for: CalculatorImplRemote
> >> >> org.apache.camel.NoSuchBeanException: No bean could be found in the
> >> >> registry for: CalculatorImplRemote
> >> >> at
> >> >>
> >>
> org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:68)[64:org.apache.camel.camel-core:2.7.0]
> >> >> at
> >> >>
> >>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:84)[64:org.apache.camel.camel-core:2.7.0]
> >> >> at
> >> >>
> >>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)[64:org.apache.camel.camel-core:2.7.0]
> >> >> at
> >> >>
> >>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)[64:org.apache.camel.camel-core:2.7.0]
> >> >> at
> >> >>
> >>
> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[64:org.apache.camel.camel-core:2.7.0]
> >> >> at
> >> >>
> >>
> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[64:org.apache.camel.camel-core:2.7.0]
> >> >> at
> >> >>
> >>
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[64:org.apache.camel.camel-core:2.7.0]
> >> >>
> >> >>
> >> >> How can we define using <setBody> tag the following two parameters to
> >> >> call the method sum of the stateless ejb CalculatorRemote ?
> >> >>
> >> >> public int sum(int add1, int add2);
> >> >>
> >> >> <setBody>
> >> >> <constant>???</constant>
> >> >> </setBody>
> >> >>
> >> >>
> >> >> Regards,
> >> >>
> >> >> Charles Moulliard
> >> >>
> >> >> Apache Committer
> >> >>
> >> >> Blog : http://cmoulliard.blogspot.com
> >> >> Twitter : http://twitter.com/cmoulliard
> >> >> Linkedin : http://www.linkedin.com/in/charlesmoulliard
> >> >> Skype: cmoulliard
> >> >>
> >> >
> >>
> >
>
Re: Error with camel-ejb
Posted by Charles Moulliard <cm...@gmail.com>.
The camel route has been deployed using deploy dir of servicemix and
DynamicImport package is enable. I have also installed the openEJB
client jar and wrapped it. So everything is in place
On Thu, Jun 16, 2011 at 4:50 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> oh you are in an OSGi container?
>
> for openejb you have to import package org.apache.openejb.client and
> org.apache.openejb.client.proxy i think or something like that (i don't
> really remember).
>
> - Romain
>
> 2011/6/16 Charles Moulliard <cm...@gmail.com>
>
>> I think that the code that we use to create the endpoint works fine in
>> a non osgi environment but not on osgi as jndi is not really supported
>>
>> @Override
>> protected Endpoint createEndpoint(String uri, String remaining,
>> Map<String, Object> parameters) throws Exception {
>> BeanEndpoint answer = new BeanEndpoint(uri, this);
>> answer.setBeanName(remaining);
>>
>> // plugin registry to lookup in jndi for the EJBs
>> Registry registry = new JndiRegistry(getContext());
>> answer.setBeanHolder(new EjbRegistryBean(registry,
>> getCamelContext(), answer.getBeanName()));
>>
>> Processor processor = answer.getProcessor();
>> setProperties(processor, parameters);
>> return answer;
>> }
>>
>>
>> On Wed, Jun 15, 2011 at 11:33 PM, Romain Manni-Bucau
>> <rm...@gmail.com> wrote:
>> > Hi,
>> >
>> > creating a list with spring should work but i think the problem is the
>> > context creation here.
>> >
>> > personnaly i use the bean component and i ask to me (with java dsl) or
>> > spring to do the lookup to put it in the camel registry.
>> >
>> > - Romain
>> >
>> > 2011/6/15 Charles Moulliard <cm...@gmail.com>
>> >
>> >> Hi,
>> >>
>> >> I try to use openejb from camel using camel-ejb but get this error
>> >> when camel looks to find the ejb stateless bean
>> >>
>> >> <beans xmlns="http://www.springframework.org/schema/beans"
>> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> >> xmlns:p="http://www.springframework.org/schema/util"
>> >> xsi:schemaLocation="
>> >> http://www.springframework.org/schema/beans
>> >> http://www.springframework.org/schema/beans/spring-beans.xsd
>> >> http://www.springframework.org/schema/util
>> >> http://www.springframework.org/schema/util/spring-util.xsd
>> >> http://camel.apache.org/schema/spring
>> >> http://camel.apache.org/schema/spring/camel-spring.xsd">
>> >>
>> >> <camelContext xmlns="http://camel.apache.org/schema/spring">
>> >> <route>
>> >> <from uri="timer://foo?fixedRate=true&period=5s"/>
>> >> <setBody>
>> >> <constant>4</constant>
>> >> <constant>3</constant>
>> >> </setBody>
>> >> <to uri="ejb:CalculatorImplRemote?method=sum"/>
>> >> <log message=">>> Result : ${body}"/>
>> >> </route>
>> >> </camelContext>
>> >>
>> >> <!-- setup Camel EJB component -->
>> >> <bean id="ejb" class="org.apache.camel.component.ejb.EjbComponent">
>> >> <property name="properties" ref="jndiProperties"/>
>> >> </bean>
>> >>
>> >> <!-- use OpenEJB context factory -->
>> >> <p:properties id="jndiProperties">
>> >> <prop
>> >>
>> key="java.naming.factory.initial">org.apache.openejb.client.RemoteInitialContextFactory</prop>
>> >> <prop key="java.naming.provider.url">ejbd://127.0.0.1:4201
>> </prop>
>> >> <prop key="java.naming.security.principal">daniel</prop>
>> >> <prop key="java.naming.security.credentials">password</prop>
>> >> </p:properties>
>> >>
>> >> </beans>
>> >>
>> >> 23:12:32,227 | ERROR | foo | DefaultErrorHandler
>> >> | ache.camel.processor.CamelLogger 232 | 64 -
>> >> org.apache.camel.camel-core - 2.7.0 | Failed delivery for exchangeId:
>> >> ID-biker-chm-local-58833-1308171227583-5-6. Exhausted after delivery
>> >> attempt: 1 caught: org.apache.camel.NoSuchBeanException: No bean could
>> >> be found in the registry for: CalculatorImplRemote
>> >> org.apache.camel.NoSuchBeanException: No bean could be found in the
>> >> registry for: CalculatorImplRemote
>> >> at
>> >>
>> org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:68)[64:org.apache.camel.camel-core:2.7.0]
>> >> at
>> >>
>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:84)[64:org.apache.camel.camel-core:2.7.0]
>> >> at
>> >>
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)[64:org.apache.camel.camel-core:2.7.0]
>> >> at
>> >>
>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)[64:org.apache.camel.camel-core:2.7.0]
>> >> at
>> >>
>> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[64:org.apache.camel.camel-core:2.7.0]
>> >> at
>> >>
>> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[64:org.apache.camel.camel-core:2.7.0]
>> >> at
>> >>
>> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[64:org.apache.camel.camel-core:2.7.0]
>> >>
>> >>
>> >> How can we define using <setBody> tag the following two parameters to
>> >> call the method sum of the stateless ejb CalculatorRemote ?
>> >>
>> >> public int sum(int add1, int add2);
>> >>
>> >> <setBody>
>> >> <constant>???</constant>
>> >> </setBody>
>> >>
>> >>
>> >> Regards,
>> >>
>> >> Charles Moulliard
>> >>
>> >> Apache Committer
>> >>
>> >> Blog : http://cmoulliard.blogspot.com
>> >> Twitter : http://twitter.com/cmoulliard
>> >> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>> >> Skype: cmoulliard
>> >>
>> >
>>
>
Re: Error with camel-ejb
Posted by Romain Manni-Bucau <rm...@gmail.com>.
oh you are in an OSGi container?
for openejb you have to import package org.apache.openejb.client and
org.apache.openejb.client.proxy i think or something like that (i don't
really remember).
- Romain
2011/6/16 Charles Moulliard <cm...@gmail.com>
> I think that the code that we use to create the endpoint works fine in
> a non osgi environment but not on osgi as jndi is not really supported
>
> @Override
> protected Endpoint createEndpoint(String uri, String remaining,
> Map<String, Object> parameters) throws Exception {
> BeanEndpoint answer = new BeanEndpoint(uri, this);
> answer.setBeanName(remaining);
>
> // plugin registry to lookup in jndi for the EJBs
> Registry registry = new JndiRegistry(getContext());
> answer.setBeanHolder(new EjbRegistryBean(registry,
> getCamelContext(), answer.getBeanName()));
>
> Processor processor = answer.getProcessor();
> setProperties(processor, parameters);
> return answer;
> }
>
>
> On Wed, Jun 15, 2011 at 11:33 PM, Romain Manni-Bucau
> <rm...@gmail.com> wrote:
> > Hi,
> >
> > creating a list with spring should work but i think the problem is the
> > context creation here.
> >
> > personnaly i use the bean component and i ask to me (with java dsl) or
> > spring to do the lookup to put it in the camel registry.
> >
> > - Romain
> >
> > 2011/6/15 Charles Moulliard <cm...@gmail.com>
> >
> >> Hi,
> >>
> >> I try to use openejb from camel using camel-ejb but get this error
> >> when camel looks to find the ejb stateless bean
> >>
> >> <beans xmlns="http://www.springframework.org/schema/beans"
> >> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >> xmlns:p="http://www.springframework.org/schema/util"
> >> xsi:schemaLocation="
> >> http://www.springframework.org/schema/beans
> >> http://www.springframework.org/schema/beans/spring-beans.xsd
> >> http://www.springframework.org/schema/util
> >> http://www.springframework.org/schema/util/spring-util.xsd
> >> http://camel.apache.org/schema/spring
> >> http://camel.apache.org/schema/spring/camel-spring.xsd">
> >>
> >> <camelContext xmlns="http://camel.apache.org/schema/spring">
> >> <route>
> >> <from uri="timer://foo?fixedRate=true&period=5s"/>
> >> <setBody>
> >> <constant>4</constant>
> >> <constant>3</constant>
> >> </setBody>
> >> <to uri="ejb:CalculatorImplRemote?method=sum"/>
> >> <log message=">>> Result : ${body}"/>
> >> </route>
> >> </camelContext>
> >>
> >> <!-- setup Camel EJB component -->
> >> <bean id="ejb" class="org.apache.camel.component.ejb.EjbComponent">
> >> <property name="properties" ref="jndiProperties"/>
> >> </bean>
> >>
> >> <!-- use OpenEJB context factory -->
> >> <p:properties id="jndiProperties">
> >> <prop
> >>
> key="java.naming.factory.initial">org.apache.openejb.client.RemoteInitialContextFactory</prop>
> >> <prop key="java.naming.provider.url">ejbd://127.0.0.1:4201
> </prop>
> >> <prop key="java.naming.security.principal">daniel</prop>
> >> <prop key="java.naming.security.credentials">password</prop>
> >> </p:properties>
> >>
> >> </beans>
> >>
> >> 23:12:32,227 | ERROR | foo | DefaultErrorHandler
> >> | ache.camel.processor.CamelLogger 232 | 64 -
> >> org.apache.camel.camel-core - 2.7.0 | Failed delivery for exchangeId:
> >> ID-biker-chm-local-58833-1308171227583-5-6. Exhausted after delivery
> >> attempt: 1 caught: org.apache.camel.NoSuchBeanException: No bean could
> >> be found in the registry for: CalculatorImplRemote
> >> org.apache.camel.NoSuchBeanException: No bean could be found in the
> >> registry for: CalculatorImplRemote
> >> at
> >>
> org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:68)[64:org.apache.camel.camel-core:2.7.0]
> >> at
> >>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:84)[64:org.apache.camel.camel-core:2.7.0]
> >> at
> >>
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)[64:org.apache.camel.camel-core:2.7.0]
> >> at
> >>
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)[64:org.apache.camel.camel-core:2.7.0]
> >> at
> >>
> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[64:org.apache.camel.camel-core:2.7.0]
> >> at
> >>
> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[64:org.apache.camel.camel-core:2.7.0]
> >> at
> >>
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[64:org.apache.camel.camel-core:2.7.0]
> >>
> >>
> >> How can we define using <setBody> tag the following two parameters to
> >> call the method sum of the stateless ejb CalculatorRemote ?
> >>
> >> public int sum(int add1, int add2);
> >>
> >> <setBody>
> >> <constant>???</constant>
> >> </setBody>
> >>
> >>
> >> Regards,
> >>
> >> Charles Moulliard
> >>
> >> Apache Committer
> >>
> >> Blog : http://cmoulliard.blogspot.com
> >> Twitter : http://twitter.com/cmoulliard
> >> Linkedin : http://www.linkedin.com/in/charlesmoulliard
> >> Skype: cmoulliard
> >>
> >
>
Re: Error with camel-ejb
Posted by Charles Moulliard <cm...@gmail.com>.
I think that the code that we use to create the endpoint works fine in
a non osgi environment but not on osgi as jndi is not really supported
@Override
protected Endpoint createEndpoint(String uri, String remaining,
Map<String, Object> parameters) throws Exception {
BeanEndpoint answer = new BeanEndpoint(uri, this);
answer.setBeanName(remaining);
// plugin registry to lookup in jndi for the EJBs
Registry registry = new JndiRegistry(getContext());
answer.setBeanHolder(new EjbRegistryBean(registry,
getCamelContext(), answer.getBeanName()));
Processor processor = answer.getProcessor();
setProperties(processor, parameters);
return answer;
}
On Wed, Jun 15, 2011 at 11:33 PM, Romain Manni-Bucau
<rm...@gmail.com> wrote:
> Hi,
>
> creating a list with spring should work but i think the problem is the
> context creation here.
>
> personnaly i use the bean component and i ask to me (with java dsl) or
> spring to do the lookup to put it in the camel registry.
>
> - Romain
>
> 2011/6/15 Charles Moulliard <cm...@gmail.com>
>
>> Hi,
>>
>> I try to use openejb from camel using camel-ejb but get this error
>> when camel looks to find the ejb stateless bean
>>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xmlns:p="http://www.springframework.org/schema/util"
>> xsi:schemaLocation="
>> http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans.xsd
>> http://www.springframework.org/schema/util
>> http://www.springframework.org/schema/util/spring-util.xsd
>> http://camel.apache.org/schema/spring
>> http://camel.apache.org/schema/spring/camel-spring.xsd">
>>
>> <camelContext xmlns="http://camel.apache.org/schema/spring">
>> <route>
>> <from uri="timer://foo?fixedRate=true&period=5s"/>
>> <setBody>
>> <constant>4</constant>
>> <constant>3</constant>
>> </setBody>
>> <to uri="ejb:CalculatorImplRemote?method=sum"/>
>> <log message=">>> Result : ${body}"/>
>> </route>
>> </camelContext>
>>
>> <!-- setup Camel EJB component -->
>> <bean id="ejb" class="org.apache.camel.component.ejb.EjbComponent">
>> <property name="properties" ref="jndiProperties"/>
>> </bean>
>>
>> <!-- use OpenEJB context factory -->
>> <p:properties id="jndiProperties">
>> <prop
>> key="java.naming.factory.initial">org.apache.openejb.client.RemoteInitialContextFactory</prop>
>> <prop key="java.naming.provider.url">ejbd://127.0.0.1:4201</prop>
>> <prop key="java.naming.security.principal">daniel</prop>
>> <prop key="java.naming.security.credentials">password</prop>
>> </p:properties>
>>
>> </beans>
>>
>> 23:12:32,227 | ERROR | foo | DefaultErrorHandler
>> | ache.camel.processor.CamelLogger 232 | 64 -
>> org.apache.camel.camel-core - 2.7.0 | Failed delivery for exchangeId:
>> ID-biker-chm-local-58833-1308171227583-5-6. Exhausted after delivery
>> attempt: 1 caught: org.apache.camel.NoSuchBeanException: No bean could
>> be found in the registry for: CalculatorImplRemote
>> org.apache.camel.NoSuchBeanException: No bean could be found in the
>> registry for: CalculatorImplRemote
>> at
>> org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:68)[64:org.apache.camel.camel-core:2.7.0]
>> at
>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:84)[64:org.apache.camel.camel-core:2.7.0]
>> at
>> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)[64:org.apache.camel.camel-core:2.7.0]
>> at
>> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)[64:org.apache.camel.camel-core:2.7.0]
>> at
>> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[64:org.apache.camel.camel-core:2.7.0]
>> at
>> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[64:org.apache.camel.camel-core:2.7.0]
>> at
>> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[64:org.apache.camel.camel-core:2.7.0]
>>
>>
>> How can we define using <setBody> tag the following two parameters to
>> call the method sum of the stateless ejb CalculatorRemote ?
>>
>> public int sum(int add1, int add2);
>>
>> <setBody>
>> <constant>???</constant>
>> </setBody>
>>
>>
>> Regards,
>>
>> Charles Moulliard
>>
>> Apache Committer
>>
>> Blog : http://cmoulliard.blogspot.com
>> Twitter : http://twitter.com/cmoulliard
>> Linkedin : http://www.linkedin.com/in/charlesmoulliard
>> Skype: cmoulliard
>>
>
Re: Error with camel-ejb
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,
creating a list with spring should work but i think the problem is the
context creation here.
personnaly i use the bean component and i ask to me (with java dsl) or
spring to do the lookup to put it in the camel registry.
- Romain
2011/6/15 Charles Moulliard <cm...@gmail.com>
> Hi,
>
> I try to use openejb from camel using camel-ejb but get this error
> when camel looks to find the ejb stateless bean
>
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:p="http://www.springframework.org/schema/util"
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://www.springframework.org/schema/util
> http://www.springframework.org/schema/util/spring-util.xsd
> http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd">
>
> <camelContext xmlns="http://camel.apache.org/schema/spring">
> <route>
> <from uri="timer://foo?fixedRate=true&period=5s"/>
> <setBody>
> <constant>4</constant>
> <constant>3</constant>
> </setBody>
> <to uri="ejb:CalculatorImplRemote?method=sum"/>
> <log message=">>> Result : ${body}"/>
> </route>
> </camelContext>
>
> <!-- setup Camel EJB component -->
> <bean id="ejb" class="org.apache.camel.component.ejb.EjbComponent">
> <property name="properties" ref="jndiProperties"/>
> </bean>
>
> <!-- use OpenEJB context factory -->
> <p:properties id="jndiProperties">
> <prop
> key="java.naming.factory.initial">org.apache.openejb.client.RemoteInitialContextFactory</prop>
> <prop key="java.naming.provider.url">ejbd://127.0.0.1:4201</prop>
> <prop key="java.naming.security.principal">daniel</prop>
> <prop key="java.naming.security.credentials">password</prop>
> </p:properties>
>
> </beans>
>
> 23:12:32,227 | ERROR | foo | DefaultErrorHandler
> | ache.camel.processor.CamelLogger 232 | 64 -
> org.apache.camel.camel-core - 2.7.0 | Failed delivery for exchangeId:
> ID-biker-chm-local-58833-1308171227583-5-6. Exhausted after delivery
> attempt: 1 caught: org.apache.camel.NoSuchBeanException: No bean could
> be found in the registry for: CalculatorImplRemote
> org.apache.camel.NoSuchBeanException: No bean could be found in the
> registry for: CalculatorImplRemote
> at
> org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:68)[64:org.apache.camel.camel-core:2.7.0]
> at
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:84)[64:org.apache.camel.camel-core:2.7.0]
> at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)[64:org.apache.camel.camel-core:2.7.0]
> at
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:74)[64:org.apache.camel.camel-core:2.7.0]
> at
> org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:102)[64:org.apache.camel.camel-core:2.7.0]
> at
> org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:72)[64:org.apache.camel.camel-core:2.7.0]
> at
> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50)[64:org.apache.camel.camel-core:2.7.0]
>
>
> How can we define using <setBody> tag the following two parameters to
> call the method sum of the stateless ejb CalculatorRemote ?
>
> public int sum(int add1, int add2);
>
> <setBody>
> <constant>???</constant>
> </setBody>
>
>
> Regards,
>
> Charles Moulliard
>
> Apache Committer
>
> Blog : http://cmoulliard.blogspot.com
> Twitter : http://twitter.com/cmoulliard
> Linkedin : http://www.linkedin.com/in/charlesmoulliard
> Skype: cmoulliard
>