Return-Path: X-Original-To: apmail-chemistry-dev-archive@www.apache.org Delivered-To: apmail-chemistry-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3083910964 for ; Thu, 27 Mar 2014 22:03:41 +0000 (UTC) Received: (qmail 39894 invoked by uid 500); 27 Mar 2014 22:03:39 -0000 Delivered-To: apmail-chemistry-dev-archive@chemistry.apache.org Received: (qmail 39149 invoked by uid 500); 27 Mar 2014 22:03:38 -0000 Mailing-List: contact dev-help@chemistry.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@chemistry.apache.org Delivered-To: mailing list dev@chemistry.apache.org Received: (qmail 37728 invoked by uid 99); 27 Mar 2014 22:03:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2014 22:03:37 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [87.230.106.24] (HELO vwp1524.webpack.hosteurope.de) (87.230.106.24) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2014 22:03:30 +0000 Received: from 91-67-24-223-dynip.superkabel.de ([91.67.24.223] helo=laptop-2.fritz.box); authenticated by vwp1524.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) id 1WTIOC-0008M6-Pi; Thu, 27 Mar 2014 23:03:08 +0100 Message-ID: <5334A01A.2060908@apache.org> Date: Thu, 27 Mar 2014 23:03:06 +0100 From: =?ISO-8859-1?Q?Florian_M=FCller?= User-Agent: Postbox 3.0.9 (Macintosh/20140129) MIME-Version: 1.0 To: "Inouye, Brian" CC: dev@chemistry.apache.org Subject: Re: create service with a large content stream causes a "Limit exceeded!" exception References: <22E5D1EA1B46FC4F92D6E0DCBD80746602F46BDB@USA7109MB010.na.xerox.net> In-Reply-To: <22E5D1EA1B46FC4F92D6E0DCBD80746602F46BDB@USA7109MB010.na.xerox.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-bounce-key: webpack.hosteurope.de;fmui@apache.org;1395957810;618403df; X-Virus-Checked: Checked by ClamAV on apache.org 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 > >