You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "LAU Sze Sze (ECC)" <ss...@nie.edu.sg> on 2004/03/05 03:21:36 UTC

JSPGenerator Error for

Hi,
 
I am facing this problem for a long time and is not able to solve it.
When I aggregate a jsp file within the <map:aggregate>, I can get the
following error:
 
org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
org.apache.cocoon.ProcessingException: Exception
JSPGenerator.generate(): java.lang.StringIndexOutOfBoundsException:
String index out of range: -1
 
cause: java.lang.StringIndexOutOfBoundsException: String index out of
range: -1
 
The following is my code in the sitemap.xmap
 
       <map:match pattern="login">
          <map:generate type="jsp" src="xdocs/login/login.jsp"/>
          <map:transform src="stylesheets/login2document.xsl"/>
         <map:serialize type="html"/>
       </map:match>
 
       <map:match pattern="*.xsp">
            <map:aggregate element="site">
               <map:part src="cocoon:/bookmain-{1}.xml" />
 
               <map:part src="cocoon:/booktop-{1}.xml" />
 
               <map:part src="cocoon:/login" />
 
               <map:part src="cocoon:/body-{1}.xsp" label="content" />
            </map:aggregate>
 
            <map:transform src="stylesheets/sitemain2xhtml.xsl">
               <map:parameter name="use-request-parameters" value="true"
/>
 
               <map:parameter name="base-url" value="/clearinghouse" />
            </map:transform>
 
            <map:serialize />
         </map:match>
 
I am using cocoon 2.1.4. Thanks for your help and looking forward to
your reply soon.
 
Regards
Lau Sze Sze
Technical Consultant
E-Learning Competency Centre
National Institute of Education
1 Nanyang Walk
Singapore 637616
Tel: (65) 6790 3745
Fax: (65) 6861 7374
www.ecc.org.sg <http://www.ecc.org.sg/> 
www.elearninghouse.com <http://www.elearninghouse.com/> 
 
 

Re: JSPGenerator Error for

Posted by Joerg Heinicke <jo...@gmx.de>.
On 05.03.2004 03:21, LAU Sze Sze (ECC) wrote:
> Hi,
>  
> I am facing this problem for a long time and is not able to solve it.
> When I aggregate a jsp file within the <map:aggregate>, I can get the
> following error:
>  
> org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
> org.apache.cocoon.ProcessingException: Exception
> JSPGenerator.generate(): java.lang.StringIndexOutOfBoundsException:
> String index out of range: -1
>  
> cause: java.lang.StringIndexOutOfBoundsException: String index out of
> range: -1

...

> I am using cocoon 2.1.4. Thanks for your help and looking forward to
> your reply soon.

I remember having patched the source resolving of the JSPGenerator for
hadnling exactly that case: using cocoon:/ should work as long as you
don't use a path but only a file name after the protocol (cocoon:/login
should work, while cocoon:/path/login should not).

Now I do not really know where it's failing for you exactly. Can you
provide a few lines of the stacktrace please? And for the correct
version: you are using the release of Cocoon 2.1.4?

BTW, I don't get our JSP samples running in Tomcat 4.1.24, while they 
work in Tomcat 5.0.18. Javac throws following non-expressive exception:

Original Exception: org.apache.jasper.JasperException: Unable to compile 
class for JSP

An error occurred at line: -1 in the jsp file: null

Don't know since when the samples are broken, but after Unico's JSP 
refactoring they worked.

Joerg