1 Reply Latest reply on Jul 9, 2011 11:17 AM by jaikiran

    ear deployment with hibernate 3.6 and without legacy validator

    slappie

      Hi All,

       

      I am facing the following problem. I am trying to deploy my ear to jBoss 6.0.0.Final. This ear contains a war file which contains the hibernate libraries 3.6. It also contains the latest validator jar from hibernate (so according to the JSR 333 spec).

       

      However when I deploy the ear and run my application, hibernate checks with reflection if the legancy class is present. This class is not present in my ear but it is part of jBoss so it will find the class. As this is an incompatible version this resultst in a ClassCastException.

       

      What I would like to accomplish is to hide the classes from the jBoss jar for my application. I did some googling and I have reada about jboss-classloader.xml and jboss-classloader-domain.xml but I cannot figure out how to configure my ear that the jBoss hibernate validator classes are hidden. Can anyone help me how the jboss-classloader[-domain].xml should look like, or maybe someone has a sample ear with such a configuration I can take a look at.

       

      I also read solutions that suggest removing jars from the jBoss libraries but that doesn't seem a proper solution to me as this may impact other application on the jBoss server.

       

      I couldn't find an easy 'how to use jboss-classloader[-domain].xml' as well (can be my limited googling skills), so if someone has pointer for me that would also be appreciated.

       

      Any help will be appreciated!

       

      Best regards,

      Marc