Michael Bushe
2003-02-18 14:47:09 UTC
Howdy,
I'm having trouble building the latest. This may be an Ant problem, as
I am fairly inexperienced with Ant, and new to Middlegen, but I figured
I'd try here first. I'm using Ant 1.5 on XP. In short, if I let the
ant script figure out the classpath, the build doesn't work. However,
if I set the same classpath in the shell and then run ant, it works. I
do have ANT_HOME set in my environment.
In Long:
I pulled Middlegen from the CVS, set my classpath to nothing (as the
home page says), then ran ant.
The build told me to run the download-deps target from the samples,
which I did (How cool is that! I owe a beer to whoever checked that
in). I copied the files from the samples lib to the Middlegen lib. (I
did have two FileNotFounds - ejb.jar and jdbc-2.0.jar. That's not my
problem, but if you know where I should get these, let me know. My
guess is Sun's j2ee kit?).
I ran the build again and it failed on "fail-if-no-xdoclet-1.2". This
comes from the line:
<available property="xdoclet1.2+"
classname="xdoclet.modules.ejb.EjbDocletTask" classpathref="classpath"/>
The build told me to re-download the libs, but I knew it was there. To
prove it, I added this to the build.xml:
<property name="classpath" refid="classpath"/>
and added in the init task:
<echo message=" classpath =${ classpath }"/>
The next build output a huge classpath. I opened a new shell, set the
classpath to the output and ran "javap
xdoclet.modules.ejb.EjbDocletTask" (javap is a handy disassembler that
comes with the JDK. Most folks don't know about it, but it's a great
way to solve classpath problems - better than JWhich, because of reasons
below). javap output "Error: No binary file 'Task'" This means that
EjbDoclet is on the classpath (otherwise a ClassNotFound error would
appear), but, most likely, it's parent class or related class could not
be resolved.
So, the remedy is to stick the Ant jar in the classpath, right? I'm not
sure if this is right, shouldn't it be there anyway? Well, to test I
added this:
<property name="antlib.dir"
value="C:\java\jakarta-ant-1.5.1\lib"/>
and this:
<path id="classpath">
<fileset dir="${antlib.dir}">
<include name="*.jar"/>
</fileset>
But this didn't help the build! Using ant -verbose I got:
[available] Unable to load class xdoclet.modules.ejb.EjbDocletTask to
set proper
ty xdoclet1.2+
However, I'm sure the classpath had enough info to resolve the class. I
proved it by opening another shell, set the classpath to the output'ed
classpath, and ran javap again. This time it worked (the signature for
the xdoclet.modules.ejb.EjbDocletTask was output.
My lame workaround is to set the classpath to this big honking classpath
and then run ant. If I do that, it builds successfully. Can someone
tell me what I'm doing wrong?
I've done a lot of looking around in the Ant book I have and on various
lists, but I'm not seeing the issue.
Much Thanks In Advance!
Michael Bushe
Bushe Enterprises, Inc.
I'm having trouble building the latest. This may be an Ant problem, as
I am fairly inexperienced with Ant, and new to Middlegen, but I figured
I'd try here first. I'm using Ant 1.5 on XP. In short, if I let the
ant script figure out the classpath, the build doesn't work. However,
if I set the same classpath in the shell and then run ant, it works. I
do have ANT_HOME set in my environment.
In Long:
I pulled Middlegen from the CVS, set my classpath to nothing (as the
home page says), then ran ant.
The build told me to run the download-deps target from the samples,
which I did (How cool is that! I owe a beer to whoever checked that
in). I copied the files from the samples lib to the Middlegen lib. (I
did have two FileNotFounds - ejb.jar and jdbc-2.0.jar. That's not my
problem, but if you know where I should get these, let me know. My
guess is Sun's j2ee kit?).
I ran the build again and it failed on "fail-if-no-xdoclet-1.2". This
comes from the line:
<available property="xdoclet1.2+"
classname="xdoclet.modules.ejb.EjbDocletTask" classpathref="classpath"/>
The build told me to re-download the libs, but I knew it was there. To
prove it, I added this to the build.xml:
<property name="classpath" refid="classpath"/>
and added in the init task:
<echo message=" classpath =${ classpath }"/>
The next build output a huge classpath. I opened a new shell, set the
classpath to the output and ran "javap
xdoclet.modules.ejb.EjbDocletTask" (javap is a handy disassembler that
comes with the JDK. Most folks don't know about it, but it's a great
way to solve classpath problems - better than JWhich, because of reasons
below). javap output "Error: No binary file 'Task'" This means that
EjbDoclet is on the classpath (otherwise a ClassNotFound error would
appear), but, most likely, it's parent class or related class could not
be resolved.
So, the remedy is to stick the Ant jar in the classpath, right? I'm not
sure if this is right, shouldn't it be there anyway? Well, to test I
added this:
<property name="antlib.dir"
value="C:\java\jakarta-ant-1.5.1\lib"/>
and this:
<path id="classpath">
<fileset dir="${antlib.dir}">
<include name="*.jar"/>
</fileset>
But this didn't help the build! Using ant -verbose I got:
[available] Unable to load class xdoclet.modules.ejb.EjbDocletTask to
set proper
ty xdoclet1.2+
However, I'm sure the classpath had enough info to resolve the class. I
proved it by opening another shell, set the classpath to the output'ed
classpath, and ran javap again. This time it worked (the signature for
the xdoclet.modules.ejb.EjbDocletTask was output.
My lame workaround is to set the classpath to this big honking classpath
and then run ant. If I do that, it builds successfully. Can someone
tell me what I'm doing wrong?
I've done a lot of looking around in the Ant book I have and on various
lists, but I'm not seeing the issue.
Much Thanks In Advance!
Michael Bushe
Bushe Enterprises, Inc.