It depends on which server you're running, but generically you want the
compiled classes to end up in the WEB-INF/classes/Starter.class and
WEB-INF/classes/dip/OrdreReader.class directories (based on the package
statements).
(*Chris*)
----- Original Message -----
From: "Anders J�rvad (RWDK)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, September 24, 2002 12:32 AM
Subject: [SERVLET-INTEREST] java.lang.NoClassDefFoundError
> Hi all;
>
> i have a problem with a servlet where the code is like this;
>
> import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
> import java.util.*;
> import java.text.*;
> import java.net.*;
> import java.net.URL;
> import java.sql.*;
>
> import org.w3c.dom.Document;
> import org.w3c.dom.NamedNodeMap;
> import org.w3c.dom.Node;
> import org.w3c.dom.NodeList;
>
> import org.xml.sax.*;
> import org.xml.sax.SAXException;
> import org.xml.sax.SAXParseException;
>
> import org.apache.crimson.tree.XmlDocument;
>
> import javax.xml.parsers.*;
> import javax.xml.transform.stream.StreamSource;
>
> import dip.OrdreReader;
>
> public class Starter extends HttpServlet
> {
> .....
> public void service( javax.servlet.http.HttpServletRequest req,
> javax.servlet.http.HttpServletResponse res) {
> .....
> OrdreReader Order = new OrdreReader();
> ...
>
> Order.ReadOrder(ordre.item(o).getChildNodes(), name);
>
> ....
> }
> ....
> }
>
> The reference classe goes lige this
>
> package dip;
>
> import org.w3c.dom.Document;
> import org.w3c.dom.NamedNodeMap;
> import org.w3c.dom.Node;
> import org.w3c.dom.NodeList;
>
>
>
> public class OrdreReader {
>
> String[][] Data = new String[999][999];
>
> public void ReadOrder(NodeList ordre, String NName) {
> String param = new String();
>
> int i = ordre.getLength();
> // System.out.println("----------------------" +
NName
> + "---------------Linier:" + i + "-");
>
> for (int s = 0; s < i ;s++ ){
>
> String name = ordre.item(s).getLocalName();
> String ValueNode = ordre.item(s).getNodeValue();
> String vardi = new String();
>
>
> if(name != null) {
> // System.out.println("
*******************"
> + name + "****************Linie:" + s + "-");
> vardi =
> ReadTextValue(ordre.item(s).getChildNodes());
> }
> //System.out.println(vardi.length());
> //if (vardi.length() != 0 && name != null) {
> if (vardi.length() > 0) {
> //System.out.println("Len=" +
vardi.length()
> + " Svar = " + name + "=" + vardi + " Linier;" +
> ordre.item(s).getChildNodes().getLength());
> }
>
>
> if (ordre.item(s).getChildNodes().getLength() > 1)
{
> ReadOrder(ordre.item(s).getChildNodes(),
> name);
> }
>
>
> }
>
>
> }
>
>
> private String ReadTextValue(NodeList tekster) {
> String retur = new String();
> int i = tekster.getLength();
> // System.out.println("
> -----------------TextElements---------------Linier:" + i + "-");
> for (int s = 0; s < i ;s++ ){
> String name = tekster.item(s).getLocalName();
> String ValueNode = tekster.item(s).getNodeValue();
> if(ValueNode != null ){
> return ValueNode;
> }
> }
>
> return null;
>
> }
>
> }
>
>
> When i compile the 2 classes i get no error, but when i run the servlet i
> get the following message;
>
> root cause
>
> java.lang.NoClassDefFoundError: dip/OrdreReader
> at Starter.service(Starter.java, Compiled Code)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> FilterChain.java:247)
> at
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> ain.java:193)
> at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
> .....
>
>
> Does anyone see the problem?
>
> Regards
> Anders
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html