1 Reply Latest reply on Oct 21, 2002 9:04 PM by Joel Vogt

    Very strange NoClassDefFoundError

    Brien Voorhees Newbie

      We ran into a very strange problem while trying to deploy our WAR (as a .war directory) where the server seems to be ignoring certain JAR's in the WAR lib directory. NoClassDefFoundError's are generated for the XMLSerializer class, among others.

      After much searching on these forums, I ran across a thread regarding a similar problem at
      http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ . Someone there suggested moving the Xerces up to the server/deploy/lib directory. Noone in the thread was able to figure out why it was necessary, though. Doing this got rid of the XMLSerializer error but then it couldn't find my JDBC driver (in Sprinta2000.jar). I then moved the Sprinta2000.jar to the server/deploy/lib directory and my app runs (this was after a bunch of additional trial-and-error). The other JAR files seem to work fine in the i.war/WEB-INF/lib/ directory, though.

      Does anyone have any information as to what the problem is? I would rather not have WAR-specific jar files polluting the server lib directory, if possible. After many hours we're now at least able to get our application running but we'd like to know what caused the problem in the first place.

      Any help greatly appreciated,
      Brien Voorhees

      Here are more details in case they're helpful:

      OS: Windows XP Professional
      JBOSS: 3.03 with JBossWeb
      JDK: 1.4.1

      Directory structure :

      | about-the-company.html (and various other html files)
      | background.gif, etc.
      | jboss-web.xml
      | web.xml
      | \---com
      | \---inteleport
      | +--- (various class files)

      web.xml contents :

      <?xml version="1.0"?>






      jboss-web.xml contents :

        • 1. Re: Very strange NoClassDefFoundError
          Joel Vogt Master

          Xml parsers are a bit notorious for causing conflicts. As you would realise jboss needs one to run, so if you provide another in the classpath it does cause problems. Moving it up basically tells jboss to 'use this one' rather than making it confused. (I can give an even vauger answer if you want). With your jdbc drivers, generally jboss needs to access them at a container level so it can provide the connection pooling etc which is external to your war file. These are generally a good idea to have available to all apps anyway, so if they use the same db they don't end up using different drivers and causing wierd bugs.