From jackrabbit-dev-return-762-apmail-incubator-jackrabbit-dev-archive=www.apache.org@incubator.apache.org Thu Feb 17 10:36:28 2005 Return-Path: Delivered-To: apmail-incubator-jackrabbit-dev-archive@www.apache.org Received: (qmail 91682 invoked from network); 17 Feb 2005 10:36:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 17 Feb 2005 10:36:27 -0000 Received: (qmail 5332 invoked by uid 500); 17 Feb 2005 10:36:27 -0000 Mailing-List: contact jackrabbit-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jackrabbit-dev@incubator.apache.org Delivered-To: mailing list jackrabbit-dev@incubator.apache.org Received: (qmail 5292 invoked by uid 99); 17 Feb 2005 10:36:26 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of stefan.guggisberg@gmail.com designates 64.233.170.202 as permitted sender) Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.202) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 17 Feb 2005 02:36:25 -0800 Received: by rproxy.gmail.com with SMTP id c16so292455rne for ; Thu, 17 Feb 2005 02:36:23 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=BiCzkXiLCqOUsMKQcWGC7chCvODTahAoepEAzavVr7EUzL+U6+LFleXQyqFPe7+LOziU0Qpa4rtHMXqUDTWecKa4HpYvQOUxopENb3gTIZkq43RBsWho66bMiS3R+JU6H7fjF6w0/EVIQC7uXM2asKZdAV3g5jhmmKnFpjPNBtg= Received: by 10.38.98.37 with SMTP id v37mr299430rnb; Thu, 17 Feb 2005 02:36:23 -0800 (PST) Received: by 10.38.152.61 with HTTP; Thu, 17 Feb 2005 02:36:23 -0800 (PST) Message-ID: <90a8d1c00502170236322de5d5@mail.gmail.com> Date: Thu, 17 Feb 2005 11:36:23 +0100 From: Stefan Guggisberg Reply-To: Stefan Guggisberg To: jackrabbit-dev@incubator.apache.org Subject: Re: Limit of 65535 bytes per String value? In-Reply-To: <20050216200305.4C5F98E25@twickel.jacum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <20050216200305.4C5F98E25@twickel.jacum.com> X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N hi timur, thanks for reporting this issue. On Wed, 16 Feb 2005 21:04:03 +0100, Timur Evdokimov wrote: > > Hello everyone, > > I just have been hit by a strange limitation of Jackrabbit > ObjectPersistenceManager. > > I've got a custom property with String type and multiple="true" (which is > mapped to String[] Java type) > The problem is that Jackrabbit writes these Strings internally using > DataOutputStream.writeUTF method, which throws UTFDataFormatException when > the number of bytes required to save that string is effectively more than > 2^16, thus 65535 > > That leaves me to worry, because I thought I could have used these String[] > fields for multi-page articles and online books on my site. The only option > I've left to is use of multiple Binary field which could store fields any > length. However APIs for Binary fields works with InputStream! > > Because of this, my neat and nice > > setProperty("text", new String[] {xxx, yyy, ...}); > > would suddenly explode into full-blown method or even class of its own! > > Were there any REAL reasons to limit Strings length by 65535? > JCR spec, at a first quick sweep through, says nothing about it. no, it's an implementation issue, as you assumed correctly. the culprit is the following line in DataOutputStream.writeUTF(String str, DataOutput out) : if (utflen > 65535) throw new UTFDataFormatException(); i am speechless..., there seemed to be real pro's at work :( nevertheless, please post a jira bug and i'll fix it asap. you can attach your patch to the jira issue, if you wish. thanks stefan > > So I've made some quick changes to ObjectPersistenceManager, replacing > read/writeUTF with byte-wise String persistence, and it works for me. > Attached comes the copy. > > Regards, > Timur > >