You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by David Weller <dg...@yahoo.com> on 2000/08/08 19:53:48 UTC

java task strangeness...

(By now, I'll bet Stefan has me lumped into the "Annoying Ant Newbie" category
:-)


Well, here's my next request for help....
I have a build file that simply invokes the java task:

<project name="subject" default="ejb_gen" basedir=".">
  <target name="ejb_gen">
    <echo message="    Generating Enterprise Java code ..."/>
    <java classname="tools.BeanBuilder" args="subject.def"
      classpath="c:/ant_test/tools/xml.jar;c:/ant_test/tools" />
  </target>
</project>  

Unfortunately, it raises a nasty/strange exception (fyi, I'm now using the 1.2
build from this morning)(Also, I've trimmed the exception stack, I'll repost
the full one if it's needed):
C:\ant_test\com\teachscape\common\subject>ant ejb_gen
Buildfile: build.xml

ejb_gen:
    Generating Enterprise Java code in directory
C:\ant_test\com\teachscape\comm
on\subject...
java.util.zip.ZipException: error in opening zip file
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:69)
        at java.util.zip.ZipFile.<init>(ZipFile.java:84)
        at
org.apache.tools.ant.AntClassLoader.getResourceStream(AntClassLoader.
java, Compiled Code)
...[deletia].....
        at org.apache.tools.ant.Target.execute(Target.java, Compiled Code)
        at org.apache.tools.ant.Project.runTarget(Project.java:720)
        at org.apache.tools.ant.Project.executeTarget(Project.java, Compiled
Cod
e)
        at org.apache.tools.ant.Project.executeTargets(Project.java, Compiled
Co
de)
        at org.apache.tools.ant.Main.runBuild(Main.java, Compiled Code)
        at org.apache.tools.ant.Main.main(Main.java:119)

BUILD FAILED

build.xml:18: Could not find tools.BeanBuilder. Make sure you have it in your
cl
asspath

Total time: 0 seconds


Oddly, what I _think_ is the same command from the command line works peachy:
C:\ant_test\com\common\subject>java -classpath
c:/ant_test/tools/xml.jar;c:/ant_test tools.BeanBuilder subject.def

Is this really a classpath problem in my buildfile, or am I misunderstanding
something?


__________________________________________________
Do You Yahoo!?
Kick off your party with Yahoo! Invites.
http://invites.yahoo.com/

RE: java task strangeness...

Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
David,

This is a bug in the AntClassLoader. It will fail if a jar or zip file in
the classpath does not exist. I have a fix which I will commit in about 12
hours.

Conor


--
Conor MacNeill
conor@cortexebusiness.com.au
Cortex eBusiness
http://www.cortexebusiness.com.au

> -----Original Message-----
> From: David Weller [mailto:dgweller@yahoo.com]
> Sent: Wednesday, 9 August 2000 3:54
> To: ant-user@jakarta.apache.org
> Subject: java task strangeness...
>
>
> (By now, I'll bet Stefan has me lumped into the "Annoying Ant
> Newbie" category
> :-)
>
>
> Well, here's my next request for help....
> I have a build file that simply invokes the java task:
>
> <project name="subject" default="ejb_gen" basedir=".">
>   <target name="ejb_gen">
>     <echo message="    Generating Enterprise Java code ..."/>
>     <java classname="tools.BeanBuilder" args="subject.def"
>       classpath="c:/ant_test/tools/xml.jar;c:/ant_test/tools" />
>   </target>
> </project>
>
> Unfortunately, it raises a nasty/strange exception (fyi, I'm now
> using the 1.2
> build from this morning)(Also, I've trimmed the exception stack,
> I'll repost
> the full one if it's needed):
> C:\ant_test\com\teachscape\common\subject>ant ejb_gen
> Buildfile: build.xml
>
> ejb_gen:
>     Generating Enterprise Java code in directory
> C:\ant_test\com\teachscape\comm
> on\subject...
> java.util.zip.ZipException: error in opening zip file
>         at java.util.zip.ZipFile.open(Native Method)
>         at java.util.zip.ZipFile.<init>(ZipFile.java:69)
>         at java.util.zip.ZipFile.<init>(ZipFile.java:84)
>         at
> org.apache.tools.ant.AntClassLoader.getResourceStream(AntClassLoader.
> java, Compiled Code)
> ...[deletia].....
>         at org.apache.tools.ant.Target.execute(Target.java, Compiled Code)
>         at org.apache.tools.ant.Project.runTarget(Project.java:720)
>         at
> org.apache.tools.ant.Project.executeTarget(Project.java, Compiled
> Cod
> e)
>         at
> org.apache.tools.ant.Project.executeTargets(Project.java, Compiled
> Co
> de)
>         at org.apache.tools.ant.Main.runBuild(Main.java, Compiled Code)
>         at org.apache.tools.ant.Main.main(Main.java:119)
>
> BUILD FAILED
>
> build.xml:18: Could not find tools.BeanBuilder. Make sure you
> have it in your
> cl
> asspath
>
> Total time: 0 seconds
>
>
> Oddly, what I _think_ is the same command from the command line
> works peachy:
> C:\ant_test\com\common\subject>java -classpath
> c:/ant_test/tools/xml.jar;c:/ant_test tools.BeanBuilder subject.def
>
> Is this really a classpath problem in my buildfile, or am I
> misunderstanding
> something?
>
>
> __________________________________________________
> Do You Yahoo!?
> Kick off your party with Yahoo! Invites.
> http://invites.yahoo.com/
>


RE: java task strangeness...

Posted by George McKInney <ge...@tantalus.com>.
It may be a typo in your mail but I noticed:
>       classpath="c:/ant_test/tools/xml.jar;c:/ant_test/tools" />
in the build.xml, and -classpath
> c:/ant_test/tools/xml.jar;c:/ant_test 
in the command line

I think this would cause ant to look for
C:/ant_test/tools/tools/BeanBuilder.class

George McKinney, Developer
tantalus communications inc.
500-1122 Mainland Street
Vancouver, BC, Canada V6B 5L1
george@tantalus.com

Direct  604.726.6753
Main    604.609.0700
Fax     604.609.0705
www.tantalus.com
"When eBusiness experience counts."