4 Replies Latest reply on Sep 29, 2011 10:22 AM by dfredmota

    I Have a Problem with the configuration in jboss as 7 + hibernate 4 + jsf

    dfredmota

      Good Morning,

       

      Guys i have a problem with my configuration jboss as 7 + hibernate 4 + jsf + spring 3.0:

       

      i configured libs in folder /lib

      but i have a problem with dom4j.jar library, as discribed below:

       

      Caused by: java.lang.ClassCastException: org.dom4j.DocumentFactory cannot be cast to org.dom4j.DocumentFactory

       

      does Anybody know how to solve this problem? i have been facing in this trouble for a long time.

       

       


        • 1. Re: I Have a Problem with the configuration in jboss as 7 + hibernate 4 + jsf
          beve

          Hi,

           

          looking at the hibernate module.xml it has a dependency to 'org.dom4j' . If you want the dom4j.jar from your deployments lib directory to be used you can add an exclusion for the 'org.dom4j' module:

           

          <jboss-deployment-structure>
            <deployment>
              <exclusions>
                  <module name="org.jdom4j"/>
              </exclusions>
            </deployment>
          </jboss-deployment-structure>
          
          

           

          You can find more information about the jboss-depoyment-structure.xml file in the section "JBoss Deployment Structure File" of the Developer Guide.

           

          Regards,

           

          /Daniel

          • 2. Re: I Have a Problem with the configuration in jboss as 7 + hibernate 4 + jsf
            dfredmota

            Hello Daniel,

             

            Thanks for your reply

             

            I did what you suggested me but it still fails.
            i followed the steps below:

            1 - I created the file: jboss-deployment-structure.xml
            2 - with the content you gave me:
            <jboss-deployment-structure>
               <deployment>
                 <exclusions>
                     <module name="org.dom4j"/>
                 </ exclusions>
               </ deployment>
            </ jboss-deployment-structure>

            The error kept happening.
            so I tried to enter the directory and manually delete the module dom4j but then I eventually get the error ClassNotFoundError: dom4j
            dom4j.jar also tried to delete my / lib folder and had the same error. is it possible to disable the hibernate validator 4?

            Do you have any other suggestions for me. I'm sorry for my english I'm learning.

            • 3. Re: I Have a Problem with the configuration in jboss as 7 + hibernate 4 + jsf
              swd847

              Add a

               

              Dependencies: org.dom4j

               

              line into your manifest, and remove dom4j from your war file.

              • 4. Re: I Have a Problem with the configuration in jboss as 7 + hibernate 4 + jsf
                dfredmota

                Good Morning,

                 

                Guys i resolve change my project to EJB+ + CDI + JSF using jboss examples projects and works fine i change my structure projects.

                 

                Thanks Guys.