Jboss 5.1 and hibernate jars
armahdi Jul 6, 2010 8:52 AMI was following this blog post online, It was quite helpful. But I have the same issue that the last commentor had. I tried to find his post but I couldnt really find it.
my issue is pretty similar to his :
I ahve jboss 5.1 which has some hibernate jars in it common/lib folder. I dont want to use those jars and what to use the ones I have packaged in my war.
the libs are in the WEB-INF/lib folder there is one particular jar : hibernate-validator.jar. this is very different from the one jboss has its own lib folder. the structure is very different.
I made a jboss-web.xml file and placed it in the WEB-INF folder.
/********************************************/
<?xml version="1.0" encoding="UTF-8"?><jboss-web><context-root>my-app</context-root><class-loading java2ClassLoadingCompliance="false"><loader-repository>com.example:loader=my-app.war<loader-repository-config>java2ParentDelegation=false</loader-repository-config></loader-repository></class-loading><resource-ref><res-ref-name>jdbc/myappDS</res-ref-name><res-type>javax.sql.DataSource</res-type><jndi-name>java:/jdbc/myappDS</jndi-name></resource-ref></jboss-web>
/********************************************/
It still is picking up the older hibernate-validator.jar in the commons/lib folder. how can I make corrections to this so that my classloading works.
I also tried the exact listing from the link for the xml file and it still didnt work. i also created jboss-app.xmla nd placed it in the WEB-INF/ folder and it didnt work either.
the exception coming is :
Caused by: java.lang.NoSuchMethodException: org.hibernate.validator.ClassValidator.<init>(java.lang.Class, java.util.ResourceBundle, org.hibernate.validator.MessageInterpolator, java.util.Map, org.hib ernate.annotations.common.reflection.ReflectionManager) at java.lang.Class.getConstructor0(Class.java:2706) at java.lang.Class.getDeclaredConstructor(Class.java:1985) at org.hibernate.cfg.AnnotationConfiguration.applyHibernateValidatorLegacyConstraintsOnDDL(AnnotationConfiguration.java:443) ... 134 more
I have checked that classValidator is in the jboss/common/lib/hibernate-validator.jar
The one that I have does not have this class.