You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Steve Wilkinson <st...@acm.org> on 2000/09/19 02:40:28 UTC

Compile Error

I can't get the src from 2000-09-16 to build.  I get the following
error.

java.lang.NoClassDefFoundError: org/xml/sax/ext/LexicalHandler

Here are the packages that I'm using:
Java2 (jdk1.2.2)
Apache servlet.jar from Tomcat 3.1 release (latest stable, downloaded
ages ago, but works great.)
Ant 1.1
XML parser javaxp1.0.1 downloaded from developer.java.sun.com
Xalan-j_1_2 installed from binary distribution xalan-j_1_2_D02.zip

Here is my classpath:
.;c:\jakarta-ant\lib\ant.jar;c:\jaxp1.0.1\jaxp.jar;c:\jaxp1.0.1\parser.jar;c:\jakarta-tools\servlet-2.2.0.jar;c:\jakarta-xalanJ\xalan.jar;c:\jakarta-xalanJ\bsf.

jar;c:\jakarta-xalanJ\bsfengines.jar

Here is the result of running build.bat
$ build.bat
Setting SERVLETAPI_HOME=..\jakarta-tomcat\lib
Buildfile: build.xml

prepare.library:

compile.library:
style
    [style] Transforming into C:\build\struts\library

BUILD FAILED

build.xml:69: java.lang.NoClassDefFoundError:
org/xml/sax/ext/LexicalHandler
java.lang.NoClassDefFoundError: org/xml/sax/ext/LexicalHandler
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:442)
        at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:101)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
        at java.net.URLClassLoader.access$1(URLClassLoader.java:216)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:191)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:290)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)

        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at
org.apache.tools.ant.taskdefs.optional.XalanLiaison.<init>(XalanLiaison.java:74)

        at java.lang.Class.newInstance0(Native Method)
        at java.lang.Class.newInstance(Class.java:241)
        at
org.apache.tools.ant.taskdefs.XSLTProcess.setProcessor(XSLTProcess.java:207)

        at
org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:132)
        at org.apache.tools.ant.Target.execute(Target.java:132)
        at org.apache.tools.ant.Project.runTarget(Project.java:717)
        at org.apache.tools.ant.Project.executeTarget(Project.java:448)
        at org.apache.tools.ant.Project.executeTargets(Project.java:422)

        at org.apache.tools.ant.Main.runBuild(Main.java:279)
        at org.apache.tools.ant.Main.main(Main.java:107)


--
-----------------------------------------------------------------
Steven D. Wilkinson, stevendwilkinson@acm.org
President, Elkhorn Creek Software, Inc.

Co-author: Professional JSP, Wrox Press Inc.; ISBN: 1861003625
Silent author: Developing Java Servlets, Sams; ISBN: 0672316005



Re: Compile Error

Posted by Steve Wilkinson <st...@acm.org>.
Oh.  I'm new to XML parsers, so you'll have to forgive me.

The reference that you are looking for is on this page:
http://jakarta.apache.org/struts/installation.html

In this bullet under Prerequisite Software:
XML Parser - Struts requires the presence of an XML parser that is compatible with the Java API
                       for XML Parsing (JAXP) specification. You can download and install the JAXP reference
                       implementation, which is required for building the Struts source distribution. In Struts-based web
                       applications, you may replace the reference implementation classes with any other JAXP compliant
                       parser, such as Xerces. See detailed instructions related to the parser in the instructions for building
                       and installing Struts, below.


Steve


"Craig R. McClanahan" wrote:

> Steve Wilkinson wrote:
>
> > Craig,
> >
> > I switched from javaxp1.0.1 to Xerces and it worked fine.  Thanks.
> > Why does the installation documents say that you can't use Xerces to do the compile?  Does that need to be changed?
> >
>
> Now that Xerces is JAXP-compatible, the docs do need to be changed (that was the problem before).  Do you remember where you saw that referenence?  I thought I had
> updated them all already.
>
> >
> > Steve
> >
>
> Craig
>

--
-----------------------------------------------------------------
Steven D. Wilkinson, stevendwilkinson@acm.org
President, Elkhorn Creek Software, Inc.

Co-author: Professional JSP, Wrox Press Inc.; ISBN: 1861003625
Silent author: Developing Java Servlets, Sams; ISBN: 0672316005



Re: Compile Error

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Steve Wilkinson wrote:

> Craig,
>
> I switched from javaxp1.0.1 to Xerces and it worked fine.  Thanks.
> Why does the installation documents say that you can't use Xerces to do the compile?  Does that need to be changed?
>

Now that Xerces is JAXP-compatible, the docs do need to be changed (that was the problem before).  Do you remember where you saw that referenence?  I thought I had
updated them all already.

>
> Steve
>

Craig

====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat



Re: Compile Error

Posted by Steve Wilkinson <st...@acm.org>.
Craig,

I switched from javaxp1.0.1 to Xerces and it worked fine.  Thanks.
Why does the installation documents say that you can't use Xerces to do the compile?  Does that need to be changed?

Steve


"Craig R. McClanahan" wrote:

> Steve Wilkinson wrote:
>
> > I can't get the src from 2000-09-16 to build.  I get the following
> > error.
> >
> > java.lang.NoClassDefFoundError: org/xml/sax/ext/LexicalHandler
> >
> > Here are the packages that I'm using:
> > Java2 (jdk1.2.2)
> > Apache servlet.jar from Tomcat 3.1 release (latest stable, downloaded
> > ages ago, but works great.)
> > Ant 1.1
> > XML parser javaxp1.0.1 downloaded from developer.java.sun.com
> > Xalan-j_1_2 installed from binary distribution xalan-j_1_2_D02.zip
> >
> > Here is my classpath:
> > .;c:\jakarta-ant\lib\ant.jar;c:\jaxp1.0.1\jaxp.jar;c:\jaxp1.0.1\parser.jar;c:\jakarta-tools\servlet-2.2.0.jar;c:\jakarta-xalanJ\xalan.jar;c:\jakarta-xalanJ\bsf.
> >
> > jar;c:\jakarta-xalanJ\bsfengines.jar
> >
>
> It is possible that having both parsers (JAXP and Xerces) in the class path at the same time could cause problems.  Try removing jaxp.jar and parser.jar from
> CLASSPATH, leaving only Xalan and Xerces, and see if it compiles.  (That's the way I build Struts, by the way).
>
> > Steven D. Wilkinson, stevendwilkinson@acm.org
> >
>
> Craig
>
> ====================
> See you at ApacheCon Europe <http://www.apachecon.com>!
> Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
> Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
>                                     Applications to Tomcat

--
-----------------------------------------------------------------
Steven D. Wilkinson, stevendwilkinson@acm.org
President, Elkhorn Creek Software, Inc.

Co-author: Professional JSP, Wrox Press Inc.; ISBN: 1861003625
Silent author: Developing Java Servlets, Sams; ISBN: 0672316005



Re: Compile Error

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
Steve Wilkinson wrote:

> I can't get the src from 2000-09-16 to build.  I get the following
> error.
>
> java.lang.NoClassDefFoundError: org/xml/sax/ext/LexicalHandler
>
> Here are the packages that I'm using:
> Java2 (jdk1.2.2)
> Apache servlet.jar from Tomcat 3.1 release (latest stable, downloaded
> ages ago, but works great.)
> Ant 1.1
> XML parser javaxp1.0.1 downloaded from developer.java.sun.com
> Xalan-j_1_2 installed from binary distribution xalan-j_1_2_D02.zip
>
> Here is my classpath:
> .;c:\jakarta-ant\lib\ant.jar;c:\jaxp1.0.1\jaxp.jar;c:\jaxp1.0.1\parser.jar;c:\jakarta-tools\servlet-2.2.0.jar;c:\jakarta-xalanJ\xalan.jar;c:\jakarta-xalanJ\bsf.
>
> jar;c:\jakarta-xalanJ\bsfengines.jar
>

It is possible that having both parsers (JAXP and Xerces) in the class path at the same time could cause problems.  Try removing jaxp.jar and parser.jar from
CLASSPATH, leaving only Xalan and Xerces, and see if it compiles.  (That's the way I build Struts, by the way).

> Steven D. Wilkinson, stevendwilkinson@acm.org
>

Craig

====================
See you at ApacheCon Europe <http://www.apachecon.com>!
Session VS01 (23-Oct 13h00-17h00):  Sun Technical Briefing
Session T06  (24-Oct 14h00-15h00):  Migrating Apache JServ
                                    Applications to Tomcat