camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Consume a message from Rmi
Date Mon, 11 Apr 2011 07:04:10 GMT
Hi

See the rmi example in the Apache Camel 2.7 release.
https://svn.apache.org/repos/asf/camel/trunk/examples/camel-example-osgi-rmi/


On Sun, Apr 10, 2011 at 4:02 PM, Filippo Balicchia <fbalicchia@gmail.com> wrote:
> Hello,
> thanks for response but I don't understand how i can call my remote method.
>
> Explanation:
>
> 1: Camel rounting information looks like this
> from("timer://myTimer?period=30000").to("bean:helloServiceBean").bean(new
> SomeBean());
> 2: helloServiceBean is defined in a file xml called camel-context.xml that
> look like this
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>       xsi:schemaLocation="
>       http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
>       http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd">
>
>  <camelContext id="camelRmiTest"
>                xmlns="http://camel.apache.org/schema/spring">
>    <package>org.apache.camel.example.spring</package>
>    <jmxAgent id="agent" createConnector="true"/>
>  </camelContext>
>
>  <bean id="helloServiceBean"
> class="org.apache.camel.spring.remoting.CamelProxyFactoryBean">
>        <property name="serviceUrl"
> value="rmi://localhost:1234/helloServiceBean"/>
>        <property name="serviceInterface"
> value="com.mylab.mock.commons.HelloService"/>
>   </bean>
> </beans>
>
> 3: On the server side i have
> <beans>
>    <bean id="helloServiceBean"
> class="com.mylab.mock.server.HelloServiceImpl">
>    </bean>
>
>    <bean class="org.springframework.remoting.rmi.RmiServiceExporter">
>        <property name="serviceName" value="helloServiceBean"/>
>        <property name="service" ref="helloServiceBean"/>
>        <property name="serviceInterface"
> value="com.mylab.mock.commons.HelloService"/>
>        <property name="registryPort" value="1234"/>
>    </bean>
> </beans>
>
>
> It seam is ok but when i run the package i receive the following error
>
> Failed delivery for exchangeId: ID-fbalicchia-4354-1302443726203-0-2.
> Exhausted
>  after delivery attempt: 1 caught: org.apache.camel.RuntimeCamelException:
> java.
> rmi.UnmarshalException: error unmarshalling return; nested exception is:
> java.lang.ClassNotFoundException: org.springframework.remoting.rmi.RmiIn
> vocationWrapper_Stub (no security manager: RMI class loader disabled)
> org.apache.camel.RuntimeCamelException: java.rmi.UnmarshalException: error
> unmar
> shalling return; nested exception is:
>        java.lang.ClassNotFoundException:
> org.springframework.remoting.rmi.RmiIn
> vocationWrapper_Stub (no security manager: RMI class loader disabled)
>
> How can I enable secuirty manager ?
> than here i can call my remote method and how.
> In new someBean at the end of rounting information is ok ?
>
> Thanks
>
> --Filippo
>
>
>
>
> 2011/4/10 Claus Ibsen <claus.ibsen@gmail.com>
>
>> You can use the timer or quartz endpoint to trigger the scheduling.
>> And then invoke the rmi service, and then after that the bean.
>>
>> Something like:
>>
>> from(timer)
>>   .to(rmi)
>>   .to(bean)
>>
>>
>> On Sun, Apr 10, 2011 at 8:55 AM, Filippo Balicchia <fbalicchia@gmail.com>
>> wrote:
>> > Hello,
>> > I need to implement an example that Scheduled consumes messages from a
>> > remote RMI Server and invoke a bean with the received message.
>> >
>> > The server RMI in a simple hello world server that is exposed with spring
>> > Remoting.
>> >
>> > Could you suggest me, please, where some examples if are there or address
>> > me, my camel route consume a message from rmi not exposed like the
>> example
>> > found in Camel package
>> >
>> > Thanks for help.
>> >
>> > --Filippo
>> >
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> FuseSource
>> Email: cibsen@fusesource.com
>> Web: http://fusesource.com
>> CamelOne 2011: http://fusesource.com/camelone2011/
>> Twitter: davsclaus
>> Blog: http://davsclaus.blogspot.com/
>> Author of Camel in Action: http://www.manning.com/ibsen/
>>
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
CamelOne 2011: http://fusesource.com/camelone2011/
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message