Community
Participate
Working Groups
I have a jspc task in my ant script to do a test compile of jsp pages This worked under 3.0 but I get an exception to stdout under 3.1 java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at java.lang.String.substring(String.java:1444) at org.eclipse.ant.internal.ui.AntUtil.getLocationLink(AntUtil.java:491) at org.eclipse.ant.internal.ui.launchConfigurations.RemoteAntBuildListener.generateLink(RemoteAntBuildListener.java:255) at org.eclipse.ant.internal.ui.launchConfigurations.RemoteAntBuildListener.receiveTaskMessage(RemoteAntBuildListener.java:243) at org.eclipse.ant.internal.ui.launchConfigurations.RemoteAntBuildListener.receiveMessage(RemoteAntBuildListener.java:173) at org.eclipse.ant.internal.ui.launchConfigurations.RemoteAntBuildListener$ServerConnection.run(RemoteAntBuildListener.java:104) Ant file that produces the same bug looks like: <project name="Example" default="prepare" basedir="."> <target name="prepare"> <mkdir dir="${basedir}/work/org/apache/jsp" /> <jspc srcdir="${basedir}" destdir="${basedir}/work/org/apache/jsp" package="org.apache.jsp" > <include name="*.jsp" /> </jspc> </target> </project>
Thank you for the bug report. Can you provide a sample of the output that is causing the exception. With my quick tests I have been unable to reproduce the exception.
Created attachment 24596 [details] simple project demonstrating the problem I have uploaded a small project that demonstrates the bug for me. Invoke the build.xml file. I get only part of the console output then a stack trace to the terminal window where I started eclipse.
*** Bug 104217 has been marked as a duplicate of this bug. ***
I ran into this and 'fixed' it by adding a (if index == -1) return null; on the line prior to 491 the only thing weird I did was replace the default ANT_HOME with one from my project
ok some more info my project has a custom ant task to do the compiling I get the exception when eclipse tries to build a link (so that I can click on the task name and have the source brought up) the getLocationLink is supposed to be called with filename:line number but I only get filename the code looks backwards for the : and converts everything after it to a number on windows the exception is not seen but the link is not built either, the reason for this is that the paramter is: c:\project\srs\a\a.java so it parses the paramter to: filename: c line number: \project\srs\a\a.java then the line number is converted to a number which of course fails and the thrown excpetion is caught and null is returned. end result is on windows the exception is not seen but the link not there with my fix I handle the case of no : found and return null thus causing the same result someone that knows eclipse ant needs to test this on a unix platform and find a better fix, but till then my fix is better than what is there now
I'm having the same symptoms on Unix (Mac OS X) with the xmlbean custom task. The console stops printing the ant build progress although the build appears to continue. Of course I don't know what it's doing from that point forwards. This occurs with Version: 3.1.0 Build id: I20050627-1435 but didn't with 3.0 using exact same build file.
I did some rework in AntUtil to handle this case and to bail less expensively: no linenumber no need to go look for a file.
Please verify Kevin et al
verified
*** Bug 120181 has been marked as a duplicate of this bug. ***
I would like to propose this a potential bug for 3.1.2
Marking as 3.1.2 candidate
Changes released for AntUtil in the 3.1 maintenance stream. Map updated as well for maintenance stream build.
Please verify Kevin.
*** Bug 129313 has been marked as a duplicate of this bug. ***
*** Bug 130310 has been marked as a duplicate of this bug. ***
*** Bug 149231 has been marked as a duplicate of this bug. ***