You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dfontaine <df...@rosebud.fr> on 2011/12/01 14:47:33 UTC
Camel XStream works with Spring but not with Aries
Hi !
I migrate a little project from Spring to Aries but i have a problem with my
Camel route and XStream.
This route works with Spring :
public class MyFirstRoute extends SpringRouteBuilder {
@Override
public void configure() throws Exception {
from("vm:repo").unmarshal().xstream()
.to("bean:supplyService?method=auto").marshal().xstream()
.to(ExchangePattern.InOnly, "vm:repoSupply");
}
}
This route doesn't work with Aries :
public class MySecondRoute extends RouteBuilder {
@Override
public void configure() throws Exception {
from("vm:repo").unmarshal().xstream()
.to("bean:supplyService?method=auto").marshal().xstream()
.to(ExchangePattern.InOnly, "vm:repoSupply");
}
}
My Exception :
Failed delivery for exchangeId: xxxxxxxxxxxxxxxxxxxxxxx
Exhausted after delivery attempt: 1 caught:
com.thoughtworks.xstream.mapper.CannotResolveClassException: com.zyx.MyCLass
My Message :
<com.zyx.MyCLass>
<date>2011-11-28 09:17:00.0 CET</date>
<name>r20100817-023310.tar.gz</name>
<size>376</size>
<flux>Cass</flux>
<type>delete</type>
</com.zyx.MyCLass>
Thanks,
Damien
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-XStream-works-with-Spring-but-not-with-Aries-tp5038674p5038674.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel XStream works with Spring but not with Aries
Posted by dfontaine <df...@rosebud.fr>.
Hi Ioannis !
I tried with Camel 2.7.3. The route works fine on 2.8.3 without
XStream xstream = new XStream();
xstream.setClassLoader(getClass().getClassLoader());
XStreamDataFormat xstreamDataFormat = new XStreamDataFormat(xstream);
Thanks a lot
Damien
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-XStream-works-with-Spring-but-not-with-Aries-tp5038674p5042520.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Camel XStream works with Spring but not with Aries
Posted by Ioannis Canellos <io...@gmail.com>.
Hi Damien,
which version of camel are you using?
I created an blueprint integration test using camel 2.9 (using exaclty your
use case) and it works fine.
Can you please try with the current trunk?
--
*Ioannis Canellos*
*
FuseSource <http://fusesource.com>
**
Blog: http://iocanel.blogspot.com
**
Apache Karaf <http://karaf.apache.org/> Committer & PMC
Apache Camel <http://camel.apache.org/> Committer
Apache ServiceMix <http://servicemix.apache.org/> Committer
Apache Gora <http://incubator.apache.org/gora/> Committer
Apache DirectMemory <http://incubator.apache.org/directmemory/> Committer
*
Re: Camel XStream works with Spring but not with Aries
Posted by dfontaine <df...@rosebud.fr>.
Ok, i found a workaround but i don't know if the solution is clean.
public class MySecondRoute extends RouteBuilder {
@Override
public void configure() throws Exception {
XStream xstream = new XStream();
xstream.setClassLoader(getClass().getClassLoader());
XStreamDataFormat xstreamDataFormat = new XStreamDataFormat(xstream);
from("vm:repo").unmarshal(xstreamDataFormat)
.to("bean:supplyService?method=auto").marshal().xstream()
.to(ExchangePattern.InOnly, "vm:repoSupply");
}
}
Damien
--
View this message in context: http://camel.465427.n5.nabble.com/Camel-XStream-works-with-Spring-but-not-with-Aries-tp5038674p5038803.html
Sent from the Camel - Users mailing list archive at Nabble.com.