chemistry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florian Müller <f...@apache.org>
Subject Re: create service with a large content stream causes a "Limit exceeded!" exception
Date Thu, 27 Mar 2014 22:03:06 GMT
Hi Brian,

The CappedInputStream does not limit the content stream, but the
"envelope" around it. In case of the AtomPub binding it is limiting the
size of the XML, but doesn't count the embedded document content.
Could you check how the request is created and if it contains a big XML
portion?


- Florian


> Hi,
> 
> I've run into a limitation in my CMIS Provider which uses OpenCMIS 0.10.0.  When a Client
sends a create request to my CMIS Provider and the accompanying content stream is large, say
1.4 GB, CappedInputStream raises an exception CmisInvalidArgumentException("Limit exceeded!").
 AtomEntryParser.java creates the CappedInputStream object, passing in a constant MAX_STREAM_LENGTH
which is set to 10 * 1024 * 1024.
> 
> public class CappedInputStream extends InputStream {
>     ...
>     private void checkLength() throws IOException {
>         if (counter > max) {
>             throw new CmisInvalidArgumentException("Limit exceeded!");
>         }
>     }
>     ...
> }
> 
> public class AtomEntryParser {
>     ...
>     private static final long MAX_STREAM_LENGTH = 10 * 1024 * 1024;
>     ...
>     public void parse(InputStream stream) throws XMLStreamException, IOException {
>         ...
>         cappedStream = new CappedInputStream(stream, MAX_STREAM_LENGTH);
>         ...
>     }
> }
> 
> What can I do to prevent this exception from occurring?  I tried doubling the value,
but the exception still occurs.
> 
> ... Brian ...
> Brian Inouye, Xerox Corporation
> 
> 

Mime
View raw message