On 5/6/11 11:42 AM, ext2 wrote:
Hi Daniel:
I think the problem is some what concern with my project's environment;
1) At first the test is running in a test project which not only dependency
cxf and spring, also dependency on other librarys(etc camel) for other
testing purpose. Then the problem occurs;
2) but if I create a more simple project which only dependency on cxf and
spring, and running the test in this project, every thing is ok;
3) Because I have no idea about which cause the difference, the Client's
TestCase's code are exactly same; But when I debugging my program , I find
that:
3.1) when running in un-correct environment, when client return the
response, all the attachments are not cached, (using the java debugger, I
see the DataHandler 's LazyDataSource are not loaded) so the
DataSource().getInputStream() always return a DelegateInputStream(), then
...all things is wrong;
I'm not sure about what's the incorrect environment?
Did you mean using Camel?
If so, that could a bug of Camel.
3.2) But when running in the correct environment, only the last attachment's
DataSource is not loaded, the other are already loaded, so only the last
datasource's inputStream is DelegateInputStream, the others 's inputStream
is Cached; then everything is ok;
I thinks the 3.2) case is correctly, because it works just like you have
told me; But I have no any ideas about why 3.1) all attachment are not
loaded.:(
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Connect at CamelOne May 24-26
The Open Source Integration Conference
http://camelone.com