camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Moulliard <cmoulli...@gmail.com>
Subject Error with camel-ejb
Date Wed, 15 Jun 2011 21:26:51 GMT
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&amp;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

Mime
View raw message