skual
stranger
Reged: 06/25/04
Posts: 2
|
|
hi, i am a little bit newbie in java and very newbie in digester, but i am trying to do a really simple application doing absolutely nothing except creating a Digester object!! The thing is the project completely hangs at the new Digester() command.
Here is the code:
import java.io.File; import java.io.IOException;
import org.apache.commons.digester.Digester; import org.xml.sax.SAXException;
public class DigesterDriver { DigesterDriver(String filename) throws IOException, SAXException { Digester digester = new Digester(); digester.setValidating(true); File file = new File(filename); digester.parse("pouet"); System.out.println("pouet"); } public static void main(String[] args) throws Exception { System.out.println("test"); // this prints well new DigesterDriver(args[0]); // this hangs System.out.println("test2"); // this never prints } }
I am developping under Eclipse v 2.1.3 and i linked the project to http://apache.crihan.fr/dist/jakarta/commons/digester/binaries/commons-digester-1.5.zip . I also tried older version like the 1.3... it still does the same. Can anyone help me? thx!
|
skual
stranger
Reged: 06/25/04
Posts: 2
|
|
Still me, i modified my code and now i have an exception:
import java.io.File; import java.io.IOException;
import org.apache.commons.digester.Digester; import org.xml.sax.SAXException;
public class DigesterDriver { DigesterDriver(String filename) throws IOException, SAXException { System.out.println("test11"); Digester digester = new Digester(); System.out.println("test12"); digester.setValidating(true); File file = new File(filename); digester.parse("pouet"); System.out.println("pouet"); } public static void main(String[] args) throws Exception { System.out.println("test"); try { new DigesterDriver("pouet"); } catch (Exception e){ System.out.println("Erreur: " + e); } System.out.println("test2"); } }
Here is what the Console prints:
test test11 java.lang.NoClassDefFoundError: org/apache/commons/collections/ArrayStack at org.apache.commons.digester.Digester.<init>(Digester.java:189) at DigesterDriver.<init>(DigesterDriver.java:11) at DigesterDriver.main(DigesterDriver.java:22) Exception in thread "main"
!!! if anyone can help me thx
|
Jeroen
veteran
Reged: 07/07/03
Posts: 1490
Loc: The Netherlands
|
|
Just like the JRE tells you: it can not find the definition of a class that the code you are running needs. You'll have to add the Apache Commons Collections (a set of utility classes) to your classpath. The jar you must add is named something like commons-collections-3.0.jar (or another version number). If you do not have that on your system already, the web page can be found here
-------------------- With the light in our eyes, it's hard to see.
|