cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Dumon <>
Subject Re: cocoon:/ does not work with SourceResolver (was: Re: Flow's processePipelineTo inside a Transformer?)
Date Thu, 27 Nov 2003 16:20:02 GMT
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  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

Bruno Dumon                   
Outerthought - Open Source, Java & XML Competence Support Center                

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message