Hi Ivan Please see comments below:
On Wed, Jan 19, 2011 at 11:34 AM, Ivan Vitoria Sanchez < [email protected]> wrote: > Hi Sergey, > > I'm not using XOP and yes, the properties 'attachment-directory' and > 'attachment-memory-threshold' don't seem to have any effect. I've also > tried > adding the VM options but the result is the same. > > Following you can find the Spring configuration and log output: > > <jaxrs:server id="genericServer" > modelRef="classpath:/WEB-INF/model/GenericModel.xml" abstract="true"> > <jaxrs:features> > <cxf:logging/> > </jaxrs:features> > <jaxrs:inInterceptors> > <ref bean="gzipInInterceptor" /> > </jaxrs:inInterceptors> > <jaxrs:outInterceptors> > <ref bean="gzipOutInterceptor" /> > </jaxrs:outInterceptors> > <jaxrs:properties> > <entry key="attachment-directory" value="/temp/mobility"/> > <!-- 400K--> > <entry key="attachment-memory-threshold" value="409600"/> > </jaxrs:properties> > </jaxrs:server> > > > <bean id="attachmentServer" parent="genericServer"> > <property name="modelRef" > value="classpath:/WEB-INF/model/AttachmentModel.xml" /> > <property name="address" value="/attachments" /> > <property name="serviceBeans"> > <!-- Service Bean omitted --> > </property> > </bean> > > --------------- > Response-Code: 200 > Content-Type: application/octet-stream > Headers: {Date=[Wed, 19 Jan 2011 10:20:55 GMT], Content-Encoding=[gzip], > Vary=[Accept-Encoding]} > Messages: Outbound Message (saved to tmp file): > Filename: > > C:\Users\ICA\.netbeans\6.9\apache-tomcat-6.0.26_base\temp\cxf-tmp-872111\cos > 4854851171655688610tmp > (message truncated to 102400 bytes) > > Payload: omitted > > > AFAIK, These properties, "attachment-directory" and "attachment-memory-threshold", are affecting reading the attachments only. But it looks like you'd like them affecting writing the attachments ? Try setting the following system properties : -Dorg.apache.cxf.io.CachedOutputStream.Threshold=someValue and -Dorg.apache.cxf.io.CachedOutputStream.OutputDirectory=/temp/mobility There must be the way to set these properties as jaxrs:properties too, just do not have an access to the code right now Let me know please if it helps Cheers, Sergey > Ivan > > > > -----Mensaje original----- > De: Sergey Beryozkin [mailto:[email protected]] > Enviado el: miƩrcoles, 19 de enero de 2011 12:06 > Para: [email protected] > Asunto: Re: JAX-RS Attachments size limit and temp folder > > Hi > > On Wed, Jan 19, 2011 at 10:56 AM, Ivan Vitoria Sanchez < > [email protected]> wrote: > > > Hi everyone, > > > > > > > > I'm developing a JAX-RS server (CXF 2.3.1) which performs both GET and > POST > > operations with DataHandler attachments within a bean, and it works fine > > (I'm not sending Multiparts). However, I could not set neither the temp > > folder used as buffer nor the max size of the attachments as explained in > > http://cxf.apache.org/docs/jax-rs-multiparts.html ("Reading Large > > Attachments" section). > > > > > Are you using XOP ? Also, when you say you can not set, do you mean the > properties you set have no effect ? > > thanks, Sergey > > > > > > > > Does it not work because it only applies to Multipart messages? If so, > how > > can i do it? > > > > > > > > Thanks in advance! > > > > > > > > Ivan > > > > > > > > > > > > > > > > >
