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 23:36:07 GMT
Hi Brian,

The CappedInputStream doesn't count the content of the <cmisra:base64>
tag. If you remove that, is the XML small?
Which XML parser do you use on the server? OpenCMIS is tested with
Woodstox and can handle very, very large content streams with this
parser. Other parsers might work differently.


- Florian


> Hi Florian,
> 
> The Client is sending the content stream embedded in the cmisra:content element, so the
resulting XML is huge.
> 
> <?xml version="1.0" encoding="UTF-8" ?>
> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app"
xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/">
> <cmisra:content>
> <cmisra:mediatype>video/quicktime</cmisra:mediatype>
> <cmisra:base64>[base64 encoding of file]</cmisra:base64></cmisra:content>
> <cmisra:object xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/">
> <cmis:properties>...</cmis:properties>
> </cmisra:object>
> <title>Demo.mov</title>
> </entry>
> 
> ... Brian ...
> Brian Inouye, Xerox Corporation
> 
> -----Original Message-----
> From: Florian Müller [mailto:fmui@apache.org] 
> Sent: Thursday, March 27, 2014 3:03 PM
> To: Inouye, Brian
> Cc: dev@chemistry.apache.org
> Subject: Re: create service with a large content stream causes a "Limit exceeded!" exception
> 
> 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