ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Armbrust, Daniel C." <>
Subject Very odd issue with jar task
Date Fri, 05 Dec 2003 19:51:25 GMT
I have a very frustrating problem that I hope someone may be able to shed a bit of light on....
 Sorry for the lengthy post, but I wanted to get all the details out here.

I am building a jar file which contains my compiled source files, and the contents of several
other jar files, with a task like this:

	<jar jarfile="${implAndDepend.jar}" basedir="${}" includes="**/*.class">
      		<zipgroupfileset refid="packageJars"/>
      		<zipgroupfileset refid="axisJars"/>
      		<zipgroupfileset dir="">
 				<include name="${wsdlJava.jar}"/>

Those refid's are defined like this:

		<path id="allJars">
			<fileset dir="${externalLib.dir}" id="packageJars">
				<include name="log4j-1.2.6.jar"/>
				<include name="gnu-regexp-1.1.4.jar"/>
				<include name="castor-0.9.4.jar"/>
				<include name="castor-0.9.4-xml.jar"/>
				<include name="jdbc-se2.0.jar"/>
				<include name="jta1.0.1.jar"/>
				<include name="allToolsModified.jar"/>
				<include name="pgjdbc2.jar"/>
			<fileset dir="${externalLib.dir}/axis/" id="axisJars">
				<include name="**/*.jar"/>

This works fine, I end up with one big jar file.  I have done this for several months without
an issue.  The resulting jar file works fine when used as a runtime library.

Now, I have another project that depends on this library.

My compile task in that project looks like this:

    <javac srcdir="${src}" destdir="${classes}">
    	<classpath path="${extLib}/implAndDepend.jar"/>

This has worked fine up until yesterday.  Now, when I run compile, I get this exception:
Buildfile: D:\Eclipse Projects\general-workspace\ctsbackend\build.xml
    [mkdir] Created dir: D:\Eclipse Projects\general-workspace\ctsbackend\antBuild
    [mkdir] Created dir: D:\Eclipse Projects\general-workspace\ctsbackend\antBuild\classes
    [javac] Compiling 8 source files to D:\Eclipse Projects\general-workspace\ctsbackend\antBuild\classes
    [javac] An exception has occurred in the compiler (1.4.2_02). Please file a bug at the
Java Developer Connection (  after checking the
Bug Parade for duplicates. Include your program and the following diagnostic in your report.
 Thank you.
    [javac] java.lang.IndexOutOfBoundsException
    [javac] at
    [javac] at
    [javac] at
    [javac] at
    [javac] at$ClassSymbol.complete(
    [javac] at
    [javac] at
    [javac] at
    [javac] at
    [javac] at
    [javac] at$Select.accept(
    [javac] at
    [javac] at
    [javac] at$MemberEnter.visitImport(
    [javac] at$Import.accept(
    [javac] at$MemberEnter.memberEnter(
    [javac] at$MemberEnter.memberEnter(
    [javac] at$MemberEnter.visitTopLevel(
    [javac] at$TopLevel.accept(
    [javac] at$MemberEnter.memberEnter(
    [javac] at$CompleteEnter.complete(
    [javac] at
    [javac] at$ClassSymbol.complete(
    [javac] at
    [javac] at
    [javac] at
    [javac] at
    [javac] at
    [javac] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [javac] at sun.reflect.NativeMethodAccessorImpl.invoke(
    [javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    [javac] at java.lang.reflect.Method.invoke(
    [javac] at
    [javac] at
    [javac] at
    [javac] at
    [javac] at
    [javac] at
    [javac] at
    [javac] at
    [javac] at
    [javac] at org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(
BUILD FAILED: file:D:/Eclipse Projects/general-workspace/ctsbackend/build.xml:38: Compile
failed; see the compiler error output for details.
Total time: 891 milliseconds

I can't figure out what I changed between yesterday and today to make this occur.  Here are
some additional oddities:

If I use the <unjar> task to unjar implAndDepend.jar into a temp folder, and then point
the <javac> task to that folder for the classpath, everything works fine.
If I manually (using winzip) unzip the file implAndDepend.jar, and then rezip it with winzip,
everything works fine.
If I execute jar -tf implAndDepend.jar it lists all the classes in the jar file without any

What could possibly be wrong with this jar file that is causing this exception?


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

View raw message