4 Replies Latest reply on Oct 27, 2009 12:39 AM by markwen97

    Spring 2.5 Project Deployment to JBoss 5

    markwen97

      Hi Everyone,

      I have problem with deploying my Richfaces + Spring + Hibernate project to JBoss AS 5.0. The project has the following jar files in the web-inf/lib folder:

      acegi-jsf-1.1.3.jar
      activation-1.1.jar
      antlr-2.7.6.jar
      aopalliance-1.0.jar
      asm-1.5.3.jar
      asm-attrs-1.5.3.jar
      aspectjrt-1.6.0.jar
      aspectjweaver-1.6.0.jar
      avalon-framework-4.2.0.jar
      backport-util-concurrent-3.1.jar
      batik-all-1.7.jar
      bsh-2.0b4.jar
      cglib-2.1_3.jar
      commons-beanutils-1.7.0.jar
      commons-codec-1.3.jar
      commons-collections-3.2.jar
      commons-dbcp-1.2.1.jar
      commons-digester-1.8.1.jar
      commons-discovery-0.4.jar
      commons-el-1.0.jar
      commons-fileupload-1.2.1.jar
      commons-httpclient-3.0.jar
      commons-io-1.3.1.jar
      commons-lang-2.3.jar
      commons-logging-1.0.4.jar
      commons-pool-1.2.jar
      commons-validator-1.3.0.jar
      corejsf-validator-1.0.jar
      darkX-3.3.0.GA.jar
      displaytag-1.1.1.jar
      dom4j-1.6.1.jar
      dwr-2.0.1.jar
      ehcache-1.4.1.jar
      ejb3-persistence-1.0.1.GA.jar
      fop.jar
      freemarker-2.3.8.jar
      glassX-3.3.0.GA.jar
      hamcrest-core-1.1.jar
      hamcrest-library-1.1.jar
      hibernate-3.2.6.ga.jar
      hibernate-annotations-3.3.1.GA.jar
      hibernate-commons-annotations-3.0.0.ga.jar
      hibernate-core-3.3.0.CR1.jar
      hibernate-tools-3.2.0.ga.jar
      hibernate-validator-3.1.0.CR1.jar
      iText-2.1.0.jar
      jasperreports-3.1.4.jar
      jcommon-1.0.0.jar
      jfreechart-1.0.12.jar
      jhighlight-1.0.jar
      jmock-2.4.0.jar
      jmock-junit4-2.4.0.jar
      jsf-api-1.2_12.jar
      jsf-facelets-1.1.15.B1.jar
      jsf-impl-1.2_12.jar
      jsr107cache-1.0.jar
      jstl-1.2.jar
      jta-1.1.jar
      jtidy-r8-20060801.jar
      junit-4.4.jar
      junit-dep-4.4.jar
      jxl-2.6.jar
      laguna-3.3.0.GA.jar
      mail-1.4.jar
      mysql-connector-java-5.1.7-bin.jar
      nekohtml-0.9.5.jar
      oro-2.0.8.jar
      oscache-2.3.jar
      persistence-api-1.0.jar
      poi-3.2.jar
      richfaces-api-3.3.0.GA.jar
      richfaces-impl-3.3.0.GA.jar
      richfaces-ui-3.3.0.GA.jar
      serializer-2.7.0.jar
      shale-test-1.0.4.jar
      slf4j-api-1.4.2.jar
      slf4j-simple-1.4.2.jar
      spring-2.5.6.jar
      spring-aop-2.5.6.jar
      spring-aspects-2.5.6.jar
      spring-beans-2.5.6.jar
      spring-context-2.5.6.jar
      spring-context-support-2.5.6.jar
      spring-core-2.5.6.jar
      spring-dao-2.0.jar
      spring-jdbc-2.5.6.jar
      spring-jpa-2.0.jar
      spring-orm-2.5.6.jar
      spring-security-acl-2.0.4.jar
      spring-security-core-2.0.4.jar
      spring-security-core-tiger-2.0.4.jar
      spring-security-taglibs-2.0.4.jar
      spring-test.jar
      spring-tx-2.5.6.jar
      spring-web-2.5.6.jar
      spring-webmvc-2.5.6.jar
      standard.jar
      Tidy.jar
      tomahawk12-1.1.9.jar
      velocity-1.4.jar
      velocity-dep-1.4.jar
      xmlgraphics-commons-1.3.1.jar

      This project works perfectly under Tomcat 6.0.

      To deploy it under JBoss AS 5, I've already removed some jar files (log4j, xml-apis*.jar, xerces*.jar, xalan*.jar) from the this folder, as suggested by some posts on the internet. However, I still couldn't make it, and the root error message is:

      Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "javax.xml.parsers.DocumentBuilder.setEntityResolver(Lorg/xml/sax/EntityResolver;)V" the class loader (instance of
      org/jboss/classloader/spi/base/BaseClassLoader) of the current class, org/springframework/beans/factory/xml/DefaultDocumentLoader, and the class loader (instance of ) for resolved class,
      javax/xml/parsers/DocumentBuilder, have different Class objects for the type org/xml/sax/EntityResolver used in the signature
      at org.springframework.beans.factory.xml.DefaultDocumentLoader.createDocumentBuilder(DefaultDocumentLoader.java:132)
      at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:74)
      at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
      ... 71 more

      I've also tried isolated class-loading, which didn't work.

      Anyone has any idea of how to solve this kind of issue?

      Thanks in advance.

      Mark

        • 1. Re: Spring 2.5 Project Deployment to JBoss 5
          vickyk

          Was this application working in older version of Jboss?
          Also let us know if the application is packaged as WAR or EAR?
          You should not have the jsf specific jars inside the WAR, if you wanted it then you should have followed this
          http://www.jboss.org/community/wiki/RemoveJSF

          • 2. Re: Spring 2.5 Project Deployment to JBoss 5
            markwen97

            Thanks.

            It might be helpful to solve part of the problem because Richfaces did fail to initialize the state factory. But it more like there is a conflict between the spring context loader and the jboss class loader. Not sure how to get rid of it properly.

            Anyone could help?

            • 3. Re: Spring 2.5 Project Deployment to JBoss 5
              vickyk

               

              "markwen97" wrote:

              But it more like there is a conflict between the spring context loader and the jboss class loader. Not sure how to get rid of it properly.


              I would recommend you to isolate the issue by making the incremental changes in your application, you could build a sample application from scratch and keep adding the libraries one by one.
              This activity will help us to identify the jar who inclusion in the application is resulting in failure. Having a simpler application simulating the issue would be helpful to sort out the issue.

              • 4. Re: Spring 2.5 Project Deployment to JBoss 5
                markwen97

                Hi vickyk,

                I understand your point. It sounds quite a lot of work to pinpoint the exact jar file, which is more practical when doing a project from scratch, not after it's done.

                I will post the feedback after my experiment.

                Thanks.

                Mark