Spring Remoting

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Spring Remoting

borgel
Hi,

We are using Hessian Spring Remoting today and I wanted to test this together with Camel. I started with the example you have created.

I have created an ISay interface with the method say() and an implementation of this in SayService. In addition I have a Controller and a RouteBuilder classes. The routebuilder just do from("direct:say").to("direct:sayImpl").

I added the routebuilder as a bean in my applicationContext.xml file.

When i start Tomcat I receive:
BeanCreationException: Error creating bean with name 'sayProxy' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: If endpoint is not specified, the serviceUrl and camelContext must be specified.

What am i doing wrong and where am i supposed to specify the Hessian service url?

Any help appreciated!
Reply | Threaded
Open this post in threaded view
|

Re: Spring Remoting

jstrachan
On 05/10/2007, borgel <[hidden email]> wrote:
>
> Hi,
>
> We are using Hessian Spring Remoting today and I wanted to test this
> together with Camel.

BTW we should do a Hessian component for Camel so folks could use that
as a wire format.


> I started with
> http://activemq.apache.org/camel/spring-remoting.html the example you have
> created .
>
> I have created an ISay interface with the method say() and an implementation
> of this in SayService. In addition I have a Controller and a RouteBuilder
> classes. The routebuilder just do from("direct:say").to("direct:sayImpl").
>
> I added the routebuilder as a bean in my applicationContext.xml file.
>
> When i start Tomcat I receive:
> BeanCreationException: Error creating bean with name 'sayProxy' defined in
> ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of
> init method failed; nested exception is java.lang.IllegalArgumentException:
> java.lang.IllegalArgumentException: If endpoint is not specified, the
> serviceUrl and camelContext must be specified.
>
> What am i doing wrong and where am i supposed to specify the Hessian service
> url?

Could you post your entire Spring.xml so we can see? Note that the
endpoint "direct:sayImpl" will just invoke any consumers on that
endpoint. To invoke a bean, such as the sayImpl you could use
"bean:sayImpl" (or whatever the name is in your spring XML)

BTW if you just wanna do spring remoting; there are proxy factory and
service exporter XML elements you can use...

<proxy> or <export>

http://activemq.apache.org/camel/maven/camel-spring/xsddoc/

--
James
-------
http://macstrac.blogspot.com/

Open Source SOA
http://open.iona.com
Reply | Threaded
Open this post in threaded view
|

Re: Spring Remoting

borgel
Yes, i want to do spring remoting, so i removed the Say and ISay stuff (that was just for testing). The url of the remote service is: http://www.remoteserver.no/integration-service/remoting/CustomerService
My goal is to call a method on the server synchronously.

How do i specify which method to call on the service?
Am i supposed to do the routing like this: from("bean:customerService").to("bean:customerServiceProxy")?
Sorry for the basic questions, but i am rather new to Camel, and i don't see how to do this.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd" >

<beans>

       
        <bean id="camel" class="org.apache.camel.spring.CamelContextFactoryBean">
                <property name="packages" value="no.example.camel"/>
        </bean>


       
        <bean id="customerServiceProxy" class="org.apache.camel.spring.remoting.CamelProxyFactoryBean">
          <property name="serviceUrl" value="http://www.remoteserver.no/integration-service/remoting/CustomerService"/>
          <property name="serviceInterface" value="no.service.backend.CustomerService"/>
        </bean>
       

        <bean id="routeBuilder" class="no.example.camel.MyRouteBuilder">
        </bean>
       
               
        <bean id="customerService" class="org.apache.camel.spring.remoting.CamelServiceExporter">
          <property name="uri" value="bean:customerService"/>
          <property name="service">
            <bean class="no.example.camel.Customer"/> 
          </property>
          <property name="serviceInterface" value="no.service.backend.CustomerService"/>
        </bean>

</beans>


James.Strachan wrote
On 05/10/2007, borgel <borge.lotre@gmail.com> wrote:
>
> Hi,
>
> We are using Hessian Spring Remoting today and I wanted to test this
> together with Camel.

BTW we should do a Hessian component for Camel so folks could use that
as a wire format.


> I started with
> http://activemq.apache.org/camel/spring-remoting.html the example you have
> created .
>
> I have created an ISay interface with the method say() and an implementation
> of this in SayService. In addition I have a Controller and a RouteBuilder
> classes. The routebuilder just do from("direct:say").to("direct:sayImpl").
>
> I added the routebuilder as a bean in my applicationContext.xml file.
>
> When i start Tomcat I receive:
> BeanCreationException: Error creating bean with name 'sayProxy' defined in
> ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of
> init method failed; nested exception is java.lang.IllegalArgumentException:
> java.lang.IllegalArgumentException: If endpoint is not specified, the
> serviceUrl and camelContext must be specified.
>
> What am i doing wrong and where am i supposed to specify the Hessian service
> url?

Could you post your entire Spring.xml so we can see? Note that the
endpoint "direct:sayImpl" will just invoke any consumers on that
endpoint. To invoke a bean, such as the sayImpl you could use
"bean:sayImpl" (or whatever the name is in your spring XML)

BTW if you just wanna do spring remoting; there are proxy factory and
service exporter XML elements you can use...

<proxy> or <export>

http://activemq.apache.org/camel/maven/camel-spring/xsddoc/

--
James
-------
http://macstrac.blogspot.com/

Open Source SOA
http://open.iona.com