[jboss-user] How to properly use own JSF and Hibernate implementations on JBoss 4.2.3?

Wojciech Ciesielski wciesielski at gmail.com
Thu Jan 14 02:58:31 EST 2010

Hi there,

I can't get a grip on classloader configuration in JBoss :( I did not
manage to force my .war to use it's own JSF (RI 1.2) and Hibernate
(3.3.1) implementations without problems.

What I was able to do was to pack my WAR into an EAR - after moving
libs from WAR to <ear>/lib and adding this to jboss-app.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss-app PUBLIC
	"-//JBoss//DTD J2EE Application 1.4//EN"

But I get class cast exceptions - it seems that classes loaded by
web-app classloader are not regarded the same as those loaded by EAR
classloader. So my question is:

What is a proper way to accomplish what I need to accomplish
(overriding default JSF and Hibernate implementations - in fact either
setting classloader priority "EAR/WAR first, server's libs next" or
complete separation - not using server's lib at all - if that's

Precise questions are:
1. where should I put my libs?
2. what should I add to jboss-specific deployment descriptors?
3. is this possible to force JBoss to use common classloader for EAR
and embedded WARs so classes loaded by them are regarded same and do
not cause ClassCastExceptions ?

I swear I tried to google this out, but I could not find proper
documentation for this particular JBoss version...


More information about the jboss-user mailing list