paherve
Aug 29th, 2008, 07:49 AM
Hello,
I practice SI starting from the "cafe" exemple. Like Alca (thread titled "Remoting version of CafeDemo") I 'd like to use RMI. Everything has worked fine until I added a return value from the Barista (server) to the client (Cafe). In the case the client get the following Exception :
java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.springframework.integration.message.MessageExc hangeTemplate$TemporaryReturnAddress
I know that the command goes well to the server because the service-activator (a method in a bean) is executed
Indeed the TemporaryReturnAddress inner class is not serializable but I feel that the problem comes from my work.
Here the client config :
<integration:message-bus />
<integration:channel id="orders" />
<integration:channel id="drinks" />
<integration:channel id="returnChannel">
</integration:channel>
<integration:channel id="coldDrinks">
</integration:channel>
<integration:channel id="hotDrinks" />
<integration:rmi-handler id="rmiTargetColdDrinks" remote-channel="coldDrinks" host="localhost" port="1099" />
<integration:rmi-handler id="rmiTargetHotDrinks"remote-channel="hotDrinks" host="localhost" port="1099" />
<bean id="drinkRouter" class="org.springframework.integration.samples.cafe.Drink Router" />
<integration:router input-channel="drinks" ref="drinkRouter"
method="resolveDrinkChannel" />
<bean id="orderSplitter"
class="org.springframework.integration.samples.cafe.Order Splitter" />
<integration:splitter input-channel="orders" output-channel="drinks"
ref="orderSplitter" method="split" />
<integration:service-activator input-channel="returnChannel" ref="clientRmiInter" method="coldDrinkscb">
</integration:service-activator>
<integration:service-activator input-channel="coldDrinks" ref="rmiTargetColdDrinks">
</integration:service-activator>
<integration:service-activator input-channel="hotDrinks" ref="rmiTargetHotDrinks" />
<bean id="clientRmiInter" class="org.springframework.integration.samples.cafe.Clien tRmiInterceptor" />
<bean id="clientInter"
class="org.springframework.integration.samples.cafe.Clien tChannelInterceptor" />
<bean id="cafe" class="org.springframework.integration.samples.cafe.Cafe">
<property name="orderChannel" ref="coldDrinks" />
</bean>
(ps: I deactivate the router / spliiter / all interceptors)
(I tried to add an output-channel to coldDrinks service-activator->same behaviour).
Does anyone has an idea that helps ?
Thanks.
P.Herve
I practice SI starting from the "cafe" exemple. Like Alca (thread titled "Remoting version of CafeDemo") I 'd like to use RMI. Everything has worked fine until I added a return value from the Barista (server) to the client (Cafe). In the case the client get the following Exception :
java.rmi.UnmarshalException: error unmarshalling return; nested exception is: java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: org.springframework.integration.message.MessageExc hangeTemplate$TemporaryReturnAddress
I know that the command goes well to the server because the service-activator (a method in a bean) is executed
Indeed the TemporaryReturnAddress inner class is not serializable but I feel that the problem comes from my work.
Here the client config :
<integration:message-bus />
<integration:channel id="orders" />
<integration:channel id="drinks" />
<integration:channel id="returnChannel">
</integration:channel>
<integration:channel id="coldDrinks">
</integration:channel>
<integration:channel id="hotDrinks" />
<integration:rmi-handler id="rmiTargetColdDrinks" remote-channel="coldDrinks" host="localhost" port="1099" />
<integration:rmi-handler id="rmiTargetHotDrinks"remote-channel="hotDrinks" host="localhost" port="1099" />
<bean id="drinkRouter" class="org.springframework.integration.samples.cafe.Drink Router" />
<integration:router input-channel="drinks" ref="drinkRouter"
method="resolveDrinkChannel" />
<bean id="orderSplitter"
class="org.springframework.integration.samples.cafe.Order Splitter" />
<integration:splitter input-channel="orders" output-channel="drinks"
ref="orderSplitter" method="split" />
<integration:service-activator input-channel="returnChannel" ref="clientRmiInter" method="coldDrinkscb">
</integration:service-activator>
<integration:service-activator input-channel="coldDrinks" ref="rmiTargetColdDrinks">
</integration:service-activator>
<integration:service-activator input-channel="hotDrinks" ref="rmiTargetHotDrinks" />
<bean id="clientRmiInter" class="org.springframework.integration.samples.cafe.Clien tRmiInterceptor" />
<bean id="clientInter"
class="org.springframework.integration.samples.cafe.Clien tChannelInterceptor" />
<bean id="cafe" class="org.springframework.integration.samples.cafe.Cafe">
<property name="orderChannel" ref="coldDrinks" />
</bean>
(ps: I deactivate the router / spliiter / all interceptors)
(I tried to add an output-channel to coldDrinks service-activator->same behaviour).
Does anyone has an idea that helps ?
Thanks.
P.Herve