Please join us at the new JavaWorld Q&A Forums. Your existing login will work there. The discussions here are now read-only.


JavaWorld >> XML & Java

Pages: 1
skual
stranger


Reged: 06/25/04
Posts: 2
Digester hanging on new Digester() ?!
      #8296 - 06/25/04 08:49 PM

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!


Post Extras: Print Post   Remind Me!   Notify Moderator  
skual
stranger


Reged: 06/25/04
Posts: 2
Re: Digester hanging on new Digester() ?! [Re: skual]
      #8327 - 06/26/04 02:08 PM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
Jeroen
veteran


Reged: 07/07/03
Posts: 1490
Loc: The Netherlands
Re: Digester hanging on new Digester() ?! [Re: skual]
      #8366 - 06/28/04 04:54 AM

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.


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 0 anonymous users are browsing this forum.

Moderator:   

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 16137

Rate this topic

Jump to

Contact us JavaWorld

Powered by UBB.threads™ 6.5.5