LouZerr (3) [Avatar] Offline
#1
I am having great difficulty getting the webdoclet task to work. I went back and tried implementing the info task (@todo tags), and that seems to work fine. But when I attempt the webdoclet task it complains about not finding javax.servlet.Servlet in the classpath.

I have the following from my build file:

<path id="xdoclet.lib.path">
<pathelement location="${servlet.jar}"/>
<fileset dir="${xdoclet.lib.dir}" includes="*.jar"/>
</path>

...

<taskdef name="webdoclet" >
classname="xdoclet.modules.web.WebDocletTask"
classpathref="xdoclet.lib.path"/>

and I even tried echoing ${servlet.jar} to confirm that IS pointing to the correct place. (I trust the xdoclet.lib.path property, since it works fine for the documentDoclet/info task)

I did notice on xdoclet-1.2.2's documentation for webdoclet, that it requires SUN'S Servlet.class - would that be any different from the servlet.jar that comes with Tomcat 4.1.X?

I also know from experience that even if it points to "javax.servlet.Servlet", that it may in fact be a different library that's giving me problems. But that's not really helping, because I still have no idea what I'm doing wrong.

Any suggestions would be very helpful. I would really like to start having my TLDs autogenerated with xdoclet if I can!
LouZerr (3) [Avatar] Offline
#2
webdoclet not working - additional info
Just to try, I downloaded the previous version of xdoclet (1.2.1). Once I had set up to use that library instead, it came back with the same error about not seeing javax.servlet.Servlet.
LouZerr (3) [Avatar] Offline
#3
Re: webdoclet not working - additional info
I think I found the problem & solution looking at http://ant.apache.org/faq.html#delegating-classloader

I had placed the xdoclet libraries in my ANT_HOME/lib folder (my mistake) in desparation trying to get the documentDoclet to work. Since it could not find servlet.jar in the SAME classpath, it was not happy.

I had tried placing servlet.jar in ANT_HOME/lib as well, and that fixed the problem. But I was not at all happy with that solution.

By cleaning out my ANT_HOME/lib folder, it is now deferring to the classpath I specify to find all the xdoclet jars, AND the servlet.jar.

Boy! That's a strange quirk with Ant/java class loader!