Thanks Dan: Yes , it is; While mapping attachment to byte[], if attachment is big, the sun's decoder will increase buffer and read from middle of buffer. This is corrected in CXF-3582. Thanks a lot
> ----original ----- > Sender: Daniel Kulp [mailto:dk...@apache.org] > Date: 2011/8/9 22:13 > Receiver: users@cxf.apache.org > : Re: NULL Pointer Exception while processing attachments > > On Tuesday, August 09, 2011 11:36:56 AM xuhb wrote: > > Thanks Jim > > > > I just tried the latest version of CXF 2.4.1. This problem doesn't occurs > in > > this version; > > I think maybe some issue fixed in 2.4.1 has fix the problem. But I am not > > know which one is.....; > > Likely CXF-3582. > > Dan > > > > > > > ----original ----- > > > Sender: Jim Ma [mailto:mail2ji...@gmail.com] > > > Date: 2011/8/9 11:03 > > > Receiver: users@cxf.apache.org > > > Subject: Re: NULL Pointer Exception while processing attachments > > > > > > From the information you provided, we can not tell if it's really a > > > CXF issue. Can you file a jira issue with your test case to help > > > reproduce ? > > > > > > Cheers > > > Jim > > > > > > On Tue, Aug 9, 2011 at 10:43 AM, xuhb <x...@tongtech.com> wrote: > > > > Hi: > > > > When I use cxf webservice at following situation, there always a > > > > null > > > > pointer exception occurs > > > > > > > > 1)MTOM enabled, and multi attachments sent. > > > > 2)The first attachment is big enough (etc 2M). and the second > > > > attachments > > > > > is > > > > > > > very small (etc: several bytes); > > > > 3)the MTOM attachment is mapped to a byte[] attribute (not > > > > DataHandler). > > > > > > > > At such a situation, the server side of cxf can only find the first > > > > attachments, And the second attachment cannot be found , so a > > > > NullPointer > > > > > > exception occurs > > > > > > > > Stack: > > > > Java.lang.NullPointerException > > > > At > > > > > > > org.apache.cxf.attachment.LazyDataSource.getContentType(LazyDataSource.j > > > av> > > > a: > > > > 61) > > > > > > > > Is it a bug? > -- > Daniel Kulp > dk...@apache.org > http://dankulp.com/blog > Talend - http://www.talend.com