6 Replies Latest reply on Jul 2, 2002 7:00 PM by Chris Olinger

    Deploying an existing WAR

    Chris Olinger Newbie

      All,

      I'm having some trouble deploying an existing WAR application that was working fine with 2.4.4. Basically, I have 6 jars in the WEB-INF/lib directory of the WAR. The servlet init() code depends on these jars. I see the messages:

      16:31:45,304 INFO [Engine] WebappLoader[/SecurityConsole]: Deploy JAR /WEB-INF/lib/data-access.jar to C:\Documents and
      Settings\colinger\Local Settings\Temp\nested-13276.war\WEB-INF\lib\jaxb-rt-1.0-ea.jar

      but then:

      16:31:47,226 ERROR [Engine] ----- Root Cause -----
      java.lang.NoClassDefFoundError: javax/xml/bind/MarshallableRootElement
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:493)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
      at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1631)
      at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:926)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1243)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:315)

      My questions are:

      1) Why is it unpacking to Documents and Settings
      2) Why can't JBoss find the jars after it has been inflated?

      Also, if I take the jar and drop it in the default/lib directory for the server then everything is ok. I'm sure I've done something stupid, but I can't see it.

      Any help would be appreciated...

      Thanks

      Chris

        • 1. Re: Deploying an existing WAR
          Chris Olinger Newbie

          oops... I forgot to say that I'm trying to run this app under JBoss 3.0.

          Chris


          > All,
          >
          > I'm having some trouble deploying an existing WAR
          > application that was working fine with 2.4.4.
          > Basically, I have 6 jars in the WEB-INF/lib directory
          > of the WAR. The servlet init() code depends on these
          > jars. I see the messages:
          >
          > 16:31:45,304 INFO [Engine]
          > WebappLoader[/SecurityConsole]: Deploy JAR
          > /WEB-INF/lib/data-access.jar to C:\Documents and
          > Settings\colinger\Local
          > Settings\Temp\nested-13276.war\WEB-INF\lib\jaxb-rt-1.0
          > ea.jar
          >
          > but then:
          >
          > 16:31:47,226 ERROR [Engine] ----- Root Cause -----
          > java.lang.NoClassDefFoundError:
          > javax/xml/bind/MarshallableRootElement
          > at java.lang.ClassLoader.defineClass0(Native
          > (Native Method)
          > at
          > at
          > at
          > t
          > java.lang.ClassLoader.defineClass(ClassLoader.java:493
          >
          > at
          > at
          > at
          > t
          > java.security.SecureClassLoader.defineClass(SecureClas
          > Loader.java:111)
          > at
          > at
          > at
          > t
          > org.apache.catalina.loader.WebappClassLoader.findClass
          > nternal(WebappClassLoader.java:1631)
          > at
          > at
          > at
          > t
          > org.apache.catalina.loader.WebappClassLoader.findClass
          > WebappClassLoader.java:926)
          > at
          > at
          > at
          > t
          > org.apache.catalina.loader.WebappClassLoader.loadClass
          > WebappClassLoader.java:1360)
          > at
          > at
          > at
          > t
          > org.apache.catalina.loader.WebappClassLoader.loadClass
          > WebappClassLoader.java:1243)
          > at
          > at
          > at
          > t
          > java.lang.ClassLoader.loadClassInternal(ClassLoader.ja
          > a:315)
          >
          > My questions are:
          >
          > 1) Why is it unpacking to Documents and Settings
          > 2) Why can't JBoss find the jars after it has been
          > inflated?
          >
          > Also, if I take the jar and drop it in the
          > default/lib directory for the server then everything
          > is ok. I'm sure I've done something stupid, but I
          > can't see it.
          >
          > Any help would be appreciated...
          >
          > Thanks
          >
          > Chris

          • 2. Re: Deploying an existing WAR
            Greg Turner Apprentice

            1. Default behavior

            2. It can. What makes you think it can't

            Your NoClassDefFoundError is probably coming from the fact that your code refers to some code that refers to some code that ... refers to the class not being found. You did not say which configuration of the server you are deploying into, or if you are rolling your own, but I would try dropping your war file into the all configuration.

            • 3. Re: Deploying an existing WAR
              Chris Olinger Newbie

              > 1. Default behavior

              ok

              > 2. It can. What makes you think it can't

              well, I'm pretty sure it can, but I can't figure out what I've done wrong, thus the question :)

              >Your NoClassDefFoundError is probably coming from the >fact that your code refers to some code that refers to >some code that ... refers to the class not being found. >You did not say which configuration of the server you >are deploying into, or if you are rolling your own, but >I would try dropping your war file into the all >configuration.

              I'm using the Jboss3.0/Tomcat4 version, dropping the war file in the default/deploy folder. The reason I ask this question is that the app I am trying to deploy is fully functioning in JBoss 2.4.4. The class that is not found is part of a jar that is in the WEB-INF/lib directory of the web app. If I move the jar file from the war file to the lib directory of the default server then it finds it. This implies to me that the classpath for the app is not being set to reflect the unpacked status of the war, or that I have missed some crucial config step.

              I tried dropping the war file in the all/deploy, default/deploy, and minimal/deploy directories. The only one that is picked up is the default directory.

              • 4. Re: Deploying an existing WAR
                Chris Olinger Newbie

                fyi... I just tried the jetty release and it works correctly (in default/deploy). My guess is there is something not right with the Tomcat release in how it unpacks everything...

                Thanks

                Chris

                • 5. Re: Deploying an existing WAR
                  Greg Turner Apprentice

                  OK. But the thing that is confusing about your error message is that is complaining about a java extension class. I think its highly irregular to be placing a jar file that contains java extensions in the war file.

                  • 6. Re: Deploying an existing WAR
                    Chris Olinger Newbie

                    No, it's a JAXB class. I am using JAXB to parse some XML config files. However, the class is irrelevant. If I take the jaxb jar and place it in the lib directory of jboss/server/default instead on WEB-INF/lib then it gets past the jaxb stuff ok, and then barfs on the next jar. In fact, *unpacked* classes in the WEB-INF/classes directory are not found either. It's as if anything below the WEB-INF level cannot be seen.

                    Chris