[jdom-interest] Strange "ClassNotFoundException" when I try JDOM with JServ

steven.gould at cgiusa.com steven.gould at cgiusa.com
Thu Feb 8 02:17:03 PST 2001

Antonios Peris wrote:

> Hey there this is my problem:
> I'm trying to implement JDOM in servlets and replace exisitng w3c.Dom
> Implementations but I get a strange problem. In Jserv log files I'm always
> receiving the following errors:
> java.lang.NoClassDefFoundError: com/sun/java/util/collections/HashMap
> java.lang.NoClassDefFoundError: com/sun/java/util/collections/List

This looks like you are using the JDK 1.1 build of JDOM. These are the collections
classes as in the Collections API for JDK 1.1. In Java 2, they are named
java.util.*. I'd suggest getting the latest source code for JDOM and building using
the build.sh or build.bat command (not the build11.* commands).

> and also java.lang.NoClassDefFoundError: org/jdom/Namespace !!! (what that
> has to do with it?!).

This is one of the JDOM classes. It looks like this is *not* in JServ's CLASSPATH.
Edit the jserv.conf file to add your JDOM jar file to your JServ CLASSPATH. Just to
be safe, add it at the beginning too!

> Anyway I know that there are distributions of JDOM that uses the above
> Interface implementations of HashMap and List but the one I use has the the
> more ususal java.util representations of them! (did check the source code)
> So is there anyone who can help me out with this?

The source code should use java.util. It all depends on how you build the source
code - see my comments above.

> I use the following software:
>     Apache WebServer
>     Apache JServ 1.1.2
>     JDOM 5
>     jdk1.2.2
> Respect Antonios..

More information about the jdom-interest mailing list