You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Benoit Deshaies <bd...@yahoo.com> on 2004/04/24 00:18:06 UTC

[JspGenerator] StringIndexOutOfBoundsException when streaming to other Generators

- What's not working: JspGenerator gives an exception when invoked
from another pipeline:
Exception JspGenerator.generate() 
org.apache.cocoon.ProcessingException: Exception
JspGenerator.generate(): java.lang.StringIndexOutOfBoundsException:
String index out of range: -1 

I tried with Cocoon 2.1.3 and 2.1.4 running on Tomcat 4.1.27 and 
4.1.29.

- How to reproduce: add the following to samples/jsp/sitemap.xmap:
	  <map:match pattern="outOfBounds">
	  	<map:generate src="cocoon:/hello.xml"/>
		<map:serialize type="xml"/>
	  </map:match>

And invoke: http://localhost:8080/cocoon/samples/jsp/outOfBounds


- What I'm trying to accomplish: use a JSP to generate XML to feed to
another pipeline. More precisely, use a JSP to generate an XForms
document to be fed to JXFormsGenerator.

Many thanks for looking into this.

Benoit Deshaies



	
		
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25�
http://photos.yahoo.com/ph/print_splash

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [JspGenerator] StringIndexOutOfBoundsException when streaming to other Generators

Posted by Joerg Heinicke <jo...@gmx.de>.
On 24.04.2004 00:18, Benoit Deshaies wrote:

> - What's not working: JspGenerator gives an exception when invoked
> from another pipeline:
> Exception JspGenerator.generate() 
> org.apache.cocoon.ProcessingException: Exception
> JspGenerator.generate(): java.lang.StringIndexOutOfBoundsException:
> String index out of range: -1 
> 
> I tried with Cocoon 2.1.3 and 2.1.4 running on Tomcat 4.1.27 and 
> 4.1.29.
> 
> - How to reproduce: add the following to samples/jsp/sitemap.xmap:
> 	  <map:match pattern="outOfBounds">
> 	  	<map:generate src="cocoon:/hello.xml"/>
> 		<map:serialize type="xml"/>
> 	  </map:match>

Hello Benoit,

you were not the first one stumbling over this problem:
http://issues.apache.org/bugzilla/show_bug.cgi?id=27915

What was missing until now was your test case. When I fixed the JSP 
source resolving the last time I added the "sitemapURI != null" check 
mentioned in the bug description as this was the difference between 
invocation from another pipeline or directly from browser. But exactly 
this seems no longer to be true as your test case showed.

I have fixed it now by using the standard Cocoon/Avalon Excalibur source 
resolving and so it is fixd hopefully finally. You can test it when you 
get the both classes JSPGenerator and JSPReader out of CVS.

Thanks for the helpful hint,

Joerg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org