You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Da...@lawson.com on 2000/12/11 16:30:41 UTC

Ant 1.2, jdk1.2.2 and class loaders



I posted a message about this on Friday 12/8, but have thus far received no
response.

I have successfully installed (running bootstrap.sh, etc) ant 1.2 on a Solaris
5.7 box using jdk1.3.  When I try to do the
same thing using jdk1.2.2, I get the following output:

**********************************************************************************************************************

... Bootstrapping Ant Distribution
... Compiling Ant Classes
... Copying Required Files
... Building Ant Distribution
Searching for build.xml ...
Buildfile: /jeedev/univ/java/src/ant/build.xml

BUILD FAILED

No JAXP compliant XML parser found. See http://java.sun.com/xml for the
reference implementation.
java.lang.NoClassDefFoundError: javax/xml/parsers/SAXParserFactory
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass0(Compiled Code)
        at java.lang.ClassLoader.defineClass(Compiled Code)
        at java.security.SecureClassLoader.defineClass(Compiled Code)
        at java.net.URLClassLoader.defineClass(Compiled Code)
        at java.net.URLClassLoader.access$1(Compiled Code)
        at java.net.URLClassLoader$1.run(Compiled Code)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessController.doPrivileged(Compiled Code)
        at java.net.URLClassLoader.findClass(Compiled Code)
        at java.lang.ClassLoader.loadClass(Compiled Code)
        at java.lang.ClassLoader.loadClass(Compiled Code)
        at sun.misc.Launcher$AppClassLoader.loadClass(Compiled Code)
        at java.lang.ClassLoader.loadClass(Compiled Code)
        at java.lang.ClassLoader.loadClassInternal(Compiled Code)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName0(Compiled Code)
        at java.lang.Class.forName(Compiled Code)
        at
javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:81)
        at
org.apache.tools.ant.ProjectHelper.getParserFactory(ProjectHelper.java:637)
        at org.apache.tools.ant.ProjectHelper.parse(ProjectHelper.java:102)
        at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:85)
        at org.apache.tools.ant.Main.runBuild(Compiled Code)
        at org.apache.tools.ant.Main.main(Main.java:149)

Total time: 0 seconds
... Cleaning Up Build Directories
... Done Bootstrapping Ant Distribution

******************************************************************************************

It seems to be unable to load the javax.xml.parsers.SAXParserFactory class a
second time.  I say "for the second time", because
it clearly loads it once (sixth line from bottom of stack trace).  So I'm
guessing what I have here is a class loader problem of some sort
arising from jdk1.2.2.  Any suggestions?

Thanks,

--dave



Re: Ant 1.2, jdk1.2.2 and class loaders

Posted by Peter Donald <do...@apache.org>.
At 09:30  11/12/00 -0600, David.Bailey@lawson.com wrote:
>It seems to be unable to load the javax.xml.parsers.SAXParserFactory class a
>second time.  I say "for the second time", because
>it clearly loads it once (sixth line from bottom of stack trace).  So I'm
>guessing what I have here is a class loader problem of some sort
>arising from jdk1.2.2.  Any suggestions?

Can you echo your classpath before you execute ant. ie place 

echo %LOCALCLASSPATH% (on win32)
echo $LOCALCLASSPATH (on *nix)

before actual call to see classpath exactly. hopefully that will outline
it. Could you also describe what classes you have in ext directory.


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               |
*-----------------------------------------------------*