Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 96465 invoked from network); 27 Nov 2003 16:20:10 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 27 Nov 2003 16:20:10 -0000 Received: (qmail 49397 invoked by uid 500); 27 Nov 2003 16:19:56 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 49169 invoked by uid 500); 27 Nov 2003 16:19:54 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: users@cocoon.apache.org Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 49155 invoked from network); 27 Nov 2003 16:19:54 -0000 Received: from unknown (HELO otsrv1.iic.ugent.be) (157.193.121.51) by daedalus.apache.org with SMTP; 27 Nov 2003 16:19:54 -0000 Received: from yum.ot (host100 [192.168.123.100]) by otsrv1.iic.ugent.be (8.11.6/8.11.6) with ESMTP id hARGJup01373 for ; Thu, 27 Nov 2003 17:19:56 +0100 Subject: Re: cocoon:/ does not work with SourceResolver (was: Re: Flow's processePipelineTo inside a Transformer?) From: Bruno Dumon To: users@cocoon.apache.org In-Reply-To: <20031126203231.GC8053@tux.wh17.tu-dresden.de> References: <20031124214712.GA8053@tux.wh17.tu-dresden.de> <1069784935.23892.31.camel@yum.ot> <20031126130416.GB8053@tux.wh17.tu-dresden.de> <1069853355.23894.76.camel@yum.ot> <20031126203231.GC8053@tux.wh17.tu-dresden.de> Content-Type: text/plain; charset=ISO-8859-1 Organization: Outerthought Message-Id: <1069950002.23892.252.camel@yum.ot> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Thu, 27 Nov 2003 17:20:02 +0100 Content-Transfer-Encoding: 8bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N On Wed, 2003-11-26 at 21:32, Sebastian Klamar wrote: > * Bruno Dumon [2003-11-26 14:29 +0100] wrote: > > On Wed, 2003-11-26 at 14:04, Sebastian Klamar wrote: > > > But for cocoon:/ and cocoon:// prefixed URLs (like > > > �cocoon://samples/�) I get no response. The response has always > > > mime type text/xml and content length -1. > > > > Can you do source.getInputStream() and read data from the inputstream? > > I can call source.getInputStream().available() that returns the same > size as source.getContentLength() with http:// URI. But I can't make > reading from the InputStream. I've tried the read() methods from > InputStream interface > > byte[] bytes; > source.getInputStream().read(bytes); is this a literal cut and paste from your code? You need to create the byte array yourself: byte[] bytes = new byte[10000]; though you should have gotten a NullPointerException in case you didn't do that. See the javadoc of the InputStream.read method for more info. > > and > > source.getInputStream().read(bytes, int, ...getInputStream().length) this obviously won't work, since getLength() returns -1. > but both are blocking the whole process and no data gets read. I've > also tried to call close() on the InputStream. > > Do you easily see what I'm doing wrong? If not I can provide more > information about IOExceptions that were thrown when trying various > methods tomorrow (no read() but close(), only available() w/ and wo > close() ...). If you think you found a bug, best of all would be a full example (full Java class + pipelines etc. to reproduce the problem) that illustrates the problem, so that we can reproduce it (submit it to bugzilla in that case). -- Bruno Dumon http://outerthought.org/ Outerthought - Open Source, Java & XML Competence Support Center bruno@outerthought.org bruno@apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org