Let me see if I understand you correctly. If I have the task in the
foo.jar and my tasks depends on xalan.jar, xerces.jar, ant.jar, and
optional.jar. I should put the those jars in the CLASSPATH (the
classplath that I invoke Ant from) and not the foo.jar? It seems to be
what I'm doing. What is the classpath I should set when I do a taskdef
then?
Will
Peter Donald wrote:
>
> At 02:12 6/3/01 -0800, William Lee wrote:
> >At first I thought it's a classpath error.
>
> I think it still is ;)
>
> >I tried to write a custom
> >script that includes ONLY classpath with xalan.jar, xerces.jar, ant.jar,
> >and optional.jar when I invoke Ant. This doesn't work, however. I
> >still get the aboved error on the line:
> >
> > DOMSource domSource = new DOMSource(doc);
> >
> >The strange thing is, when I copy over the DOM2DOM.java sample, compile,
> >and run it inside Ant I actually get it to work using the same
> >classpath.
>
> this works as a completely new classloader is created.
>
> >Can somebody tell me what's going wrong?
>
> Odd classpath behaviour. If you need to load a task then any dependent
> classes have to be in classloader or parent classloaders. So make sure that
> the task is NOT in normal CLASSPATH if its dependent jars are in supplied
> classpath.
>
> Also double check the ext dirs, ant/lib dir and any other similar dir for
> stray jars.
>
> Cheers,
>
> Pete
>
> *-----------------------------------------------------*
> | "Faced with the choice between changing one's mind, |
> | and proving that there is no need to do so - almost |
> | everyone gets busy on the proof." |
> | - John Kenneth Galbraith |
> *-----------------------------------------------------*