Bug 25597 - ArrayIndexOutOfBoundsException
Summary: ArrayIndexOutOfBoundsException
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 4
Classification: Unclassified
Component: Jasper (show other bugs)
Version: 4.1.27
Hardware: Sun other
: P3 major (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-17 17:59 UTC by Tracy Pleasant
Modified: 2005-07-01 14:32 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tracy Pleasant 2003-12-17 17:59:35 UTC
Before upgrading to tomcat 4.1.27, thsi worked fine. Now I get this exception: 

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 14
	at org.apache.jasper.JspC.locateUriRoot(JspC.java:628)
	at org.apache.jasper.JspC.execute(JspC.java:759)
	at org.apache.jasper.JspC.main(JspC.java:823)
Is there any issues with tomcat 4 and jspc?
Comment 1 Mark Thomas 2004-06-27 19:23:35 UTC
There are no issues I am aware of.

Without any steps to reproduce the issue, my best guess from looking at the 
code is the command you are using is somehow malformed. I would suggest that 
the tomcat-user mailing list is the best place to seek further help.
Comment 2 Anders Soee 2005-06-30 10:31:50 UTC
The exception occurs when calling the jspc ant target with a srcdir without a 
WEB-INF root

considering the following directory structure:
c:
- src
   - myapp
      - web
      - src
      - build

with a simple .jsp file in the web dir.

The following ant target wil generate the exception 

  <target name="jsp-compile-test">

      <property name="app-dir" value="c:\src\myapp"/>
      <property name="genjsp" value="${app-dir}/build/gensrc" />
      <property name="web" value="${app-dir}/web"/>

      <delete dir="${genjsp}" failonerror="false"/>
      <mkdir dir="${genjsp}"/>

      <jspc destdir="${genjsp}"
         verbose="1"
         srcdir="${web}"
         compiler="jasper41"
         classpathref="jasper.classpath">
         <include name="**/*.jsp"/>
      </jspc>

   </target>

However, if the dir WEB-INF exists it works fine.

Granted, it makes sense that the WEB-INF dir must exist, but a more userfriendly 
error message would be nice.

OS : WinXP Pro sp2
JDK : Sun 1.4.2_08
TOMCAT : 4.1.31
Comment 3 Mark Thomas 2005-07-01 22:32:12 UTC
This has been fixed in CVS and will be included in 4.1.32+