Tomcat and JAVA: No Class Def Found Error.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Tomcat and JAVA: No Class Def Found Error.

  1. #1
    Jose Rodz Guest

    Tomcat and JAVA: No Class Def Found Error.


    I implemented a Java Servlet to read data from a XML file. I am using Tomcat
    4.0.1. When I am trying to execute the servlet it gave me the following error:

    "java.lang.NoClassDefFoundError:com/sun/xml/tree/XmlDocument"

    I have the same servlet implemented as Java Application and it runs properly.
    But the servlet version using the same functions does not.

    Can anyone help me on this? Thanks in advance.

  2. #2
    Ravi Guest

    Re: Tomcat and JAVA: No Class Def Found Error.


    please try this

    On Windows systems, if you have installed the JDK or Java 2 SDK in D:\java:
    C:\> set PATH=D:\java\bin;%PATH%
    C:\> set JAVA_HOME=D:\java






    "Jose Rodz" <rodriguezj.orion@afwtf.navy.mil> wrote:
    >
    >I implemented a Java Servlet to read data from a XML file. I am using Tomcat
    >4.0.1. When I am trying to execute the servlet it gave me the following

    error:
    >
    >"java.lang.NoClassDefFoundError:com/sun/xml/tree/XmlDocument"
    >
    >I have the same servlet implemented as Java Application and it runs properly.
    >But the servlet version using the same functions does not.
    >
    >Can anyone help me on this? Thanks in advance.



  3. #3
    Jose Rodz Guest

    Re: Tomcat and JAVA: No Class Def Found Error.


    Thanks...
    I don't have problem with the other java classes. The PATH and JAVA HOME
    variables are correctly set. The problem is with XMLDocument class that is
    not standard class of JDK. This class is part of the XML.JAR file that I
    downloaded. I set the CLASSPATH to include this JAR file and as a Java Standalone
    Application it works properly. But when I implemented the class as a Servlet
    it gave the error. In my opinion is that Tomcat does not have the path for
    this JAR file. How I can define this path? Or where I can put the JAR file
    so can it be accessed by Tomcat. Thanks in advance

    "Ravi" <ravis@etlsys.com> wrote:
    >
    >please try this
    >
    > On Windows systems, if you have installed the JDK or Java 2 SDK in D:\java:
    > C:\> set PATH=D:\java\bin;%PATH%
    > C:\> set JAVA_HOME=D:\java
    >
    >
    >
    >
    >
    >
    >"Jose Rodz" <rodriguezj.orion@afwtf.navy.mil> wrote:
    >>
    >>I implemented a Java Servlet to read data from a XML file. I am using Tomcat
    >>4.0.1. When I am trying to execute the servlet it gave me the following

    >error:
    >>
    >>"java.lang.NoClassDefFoundError:com/sun/xml/tree/XmlDocument"
    >>
    >>I have the same servlet implemented as Java Application and it runs properly.
    >>But the servlet version using the same functions does not.
    >>
    >>Can anyone help me on this? Thanks in advance.

    >



  4. #4
    Jose Rodz Guest

    Re: Tomcat and JAVA: No Class Def Found Error.


    I am trying to send you the info that you asked me, but it keep send me back
    with an undeliverable message. I will try again later on.
    "Ravi" <ravis@etlsys.com> wrote:
    >
    >please try this
    >
    > On Windows systems, if you have installed the JDK or Java 2 SDK in D:\java:
    > C:\> set PATH=D:\java\bin;%PATH%
    > C:\> set JAVA_HOME=D:\java
    >
    >
    >
    >
    >
    >
    >"Jose Rodz" <rodriguezj.orion@afwtf.navy.mil> wrote:
    >>
    >>I implemented a Java Servlet to read data from a XML file. I am using Tomcat
    >>4.0.1. When I am trying to execute the servlet it gave me the following

    >error:
    >>
    >>"java.lang.NoClassDefFoundError:com/sun/xml/tree/XmlDocument"
    >>
    >>I have the same servlet implemented as Java Application and it runs properly.
    >>But the servlet version using the same functions does not.
    >>
    >>Can anyone help me on this? Thanks in advance.

    >



  5. #5
    Ravi Guest

    Re: Tomcat and JAVA: No Class Def Found Error.


    Dear Jose

    Thanks a lot for your efforts. Please check your mail.


    "Jose Rodz" <rodriguezj.orion@afwtf.navy.mil> wrote:
    >
    >I am trying to send you the info that you asked me, but it keep send me

    back
    >with an undeliverable message. I will try again later on.
    >"Ravi" <ravis@etlsys.com> wrote:
    >>
    >>please try this
    >>
    >> On Windows systems, if you have installed the JDK or Java 2 SDK in D:\java:
    >> C:\> set PATH=D:\java\bin;%PATH%
    >> C:\> set JAVA_HOME=D:\java
    >>
    >>
    >>
    >>
    >>
    >>
    >>"Jose Rodz" <rodriguezj.orion@afwtf.navy.mil> wrote:
    >>>
    >>>I implemented a Java Servlet to read data from a XML file. I am using

    Tomcat
    >>>4.0.1. When I am trying to execute the servlet it gave me the following

    >>error:
    >>>
    >>>"java.lang.NoClassDefFoundError:com/sun/xml/tree/XmlDocument"
    >>>
    >>>I have the same servlet implemented as Java Application and it runs properly.
    >>>But the servlet version using the same functions does not.
    >>>
    >>>Can anyone help me on this? Thanks in advance.

    >>

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center