4 Replies Latest reply on Apr 23, 2007 11:21 AM by thierry baudouin

    packaging a war file with struts 1.3.8 for jboss 4.0.4

    thierry baudouin Newbie

      hello,

      i try to port a web application from jboss 3.2.0 to jboss4.0.4.

      i have a problem with classNotFound exception for struts (see log):

      23:53:26,500 INFO [EJBDeployer] Deployed: file:/home/baudouin/site/binaires/jboss-4.0.4.GA/server/default/deploy/siloDonnees.jar
      23:53:26,890 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
      23:53:30,301 ERROR [MainDeployer] Could not create deployment: file:/home/baudouin/site/binaires/jboss-4.0.4.GA/server/default/deploy/siteweb.war
      java.lang.NoClassDefFoundError: org/apache/struts/action/ActionServlet
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:251)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:55)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
      at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:672)
      at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:652)




      i respect configuration and packaging for struts (http://struts.apache.org/1.3.8/userGuide/configuration.html#dd_config_modules),
      it say top copy struts jar files in WEB-INF/lib of my web application.
      i do this but jboss don't find class.
      I have forgotten something in web.xml, jboss-web.xml ?

      Do you have a idea ?

        • 1. Re: packaging a war file with struts 1.3.8 for jboss 4.0.4
          thierry baudouin Newbie


          i try a solution but i have still a prblem (not same).

          i build an ear file with contain :
          * one file war
          * 2 file jar
          * struts file struts-2.0.6/lib/commons-beanutils-1.6.jar
          struts-2.0.6/lib/commons-chain-1.1.jar
          struts-2.0.6/lib/commons-logging.jar
          struts-2.0.6/lib/commons-validator-1.3.0.jar
          struts-2.0.6/lib/struts-core-1.3.5.jar
          struts-2.0.6/lib/struts2-codebehind-plugin-2.0.6.jar
          struts-2.0.6/lib/struts2-config-browser-plugin-2.0.6.jar
          struts-2.0.6/lib/struts2-core-2.0.6.jar
          struts-2.0.6/lib/struts2-jasperreports-plugin-2.0.6.jar
          struts-2.0.6/lib/struts2-jfreechart-plugin-2.0.6.jar
          struts-2.0.6/lib/struts2-jsf-plugin-2.0.6.jar
          struts-2.0.6/lib/struts2-pell-multipart-plugin-2.0.6.jar
          struts-2.0.6/lib/struts2-plexus-plugin-2.0.6.jar
          struts-2.0.6/lib/struts2-sitegraph-plugin-2.0.6.jar
          struts-2.0.6/lib/struts2-sitemesh-plugin-2.0.6.jar
          struts-2.0.6/lib/struts2-spring-plugin-2.0.6.jar
          struts-2.0.6/lib/struts2-struts1-plugin-2.0.6.jar
          struts-2.0.6/lib/struts2-tiles-plugin-2.0.6.jar
          * META-INF/application.xml
          * META-INF/jboss-app.xml which is:
          <jboss-app>
          <loader-repository>orvault:loader=orvault.ear
          <loader-repository-config>
          java2ParentDelegation=false
          </loader-repository-config>
          </loader-repository>
          </jboss-app>


          i have also changed MANIFEST file for war package like this :
          Manifest-Version: 1.0
          Class-Path: ./struts-2.0.6/lib/struts-core-1.3.5.jar ./struts-2.0.6/lib/commons-beanutils-1.7.0.jar ./struts-2.0.6/lib/commons-logging-1.0.4.jar



          it resolve the problem of ClassNotFound ActionServlet but now log jboss say this :

          Caused by: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: org.apache.commons.logging.LogConfigurationException: Invalid class loader hierarchy. You have more than one version of 'org.apache.commons.logging.Log' visible, which is not allowed.


          i try to remove commons-logging-1.0.4.jar from manifest, struts directory and also copy commons-logging file from server jboss but not efficient.

          how can i manage to execute my ear application ?

          thanks.

          • 2. Re: packaging a war file with struts 1.3.8 for jboss 4.0.4
            jaikiran pai Master

             

            and also copy commons-logging file from server jboss


            Dont maintain any commons-logging file in your application. Its already present in the JBoss' lib folder and will be picked up for your application.

            • 3. Re: packaging a war file with struts 1.3.8 for jboss 4.0.4
              thierry baudouin Newbie

              ok, i removed all commons-logging.jar from my ear file, war file and jar file.
              Also removed in MANIFEST file.

              But now, i have this message :

              13:57:36,459 INFO [EjbModule] Deploying OrdreRencontre
              13:57:37,056 ERROR [MainDeployer] Could not create deployment: file:/home/baudouin/site/binaires/jboss-4.0.4.GA/server/default/tmp/deploy/tmp12426orvault.ear-contents/siteweb.war
              java.lang.NoClassDefFoundError: org/apache/struts/action/ActionServlet
              at java.lang.ClassLoader.defineClass0(Native Method)
              at java.lang.ClassLoader.defineClass(ClassLoader.java:539)

              • 4. Re: packaging a war file with struts 1.3.8 for jboss 4.0.4
                thierry baudouin Newbie

                it works now !

                i missed some jar files (struts) in my ear file and manifest.
                thanks