0 Replies Latest reply on Jan 14, 2010 3:32 AM by wciesiel

    How to properly use own JSF and Hibernate implementations on JBoss 4.2.3?

      Hi there,

       

      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"
             "http://www.jboss.org/j2ee/dtd/jboss-app_4_0.dtd">
      <jboss-app>
      <loader-repository>com.mycomp:loader=mycomp-www-ear.ear<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
      </loader-repository>
      </jboss-app>


      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
      required)?

      Precise questions are:
      1. where should I put my libs (war or ear)?
      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...

      TIA,
      Wojtek