jBoss classloader strategy is very powerful if you understand it... but it can 
bite you since it does not necessarily follow the JEE standard.  

Instead of deploying your WAR file... try encapsulating the WAR in an EAR
and use a META-INF/jboss-app.xml to enforce isolation.  The content would
be something like this:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-app>
        <loader-repository>
                com.yourcompany.cas:archive=cas.ear
                <loader-repository-config>
                        java2ParentDelegation=false
                </loader-repository-config>
        </loader-repository>
</jboss-app>

I use that approach on jBoss 4.3 to avoid CAS-jBoss classloader problems.

-----Original Message-----
From: Marvin Addison [mailto:[email protected]] 
Sent: Thursday, May 07, 2009 8:27 AM
To: [email protected]
Subject: Re: [cas-user] CAS 3.3.2 and JBoss 5.0.1 with JpaTicketReistry 
connecting to MS-SQL

> That got me farther,  but new error:
>
> 21:46:15,229 ERROR [AbstractKernelController] Error installing to Start:
> name=persistence.unit:unitName=#CasPersistence state=Create
> java.lang.ClassCastException: org.hibernate.ejb.HibernatePersistence cannot
> be cast to javax.persistence.spi.PersistenceProvider

This is almost certainly a classloader problem since
org.hibernate.ejb.HibernatePersistence clearly implements
javax.persistence.spi.PersistenceProvider,
http://docs.jboss.org/hibernate/stable/entitymanager/api/org/hibernate/ejb/HibernatePersistence.html.
 Recall that in Java a class must assignment compatible _and_ sourced
from the same classloader in order for a cast to succeed; a
ClassCastException will be thrown if both conditions are not met.

> Is anyone out there using Jboss 5.0.1 with CAS 3.3.2 ?

Thankfully, no.  We run CAS 3.0.6 in production on JBoss 4.0.4, but
we're moving to Tomcat 6 in the near future.  JBoss is simply too
complex for our needs with respect to CAS.  Complicating that, JBoss
5.0 is new and dramatically different.  I've looked at a lot of JBoss
4.x stack traces over the past few years, but what you cited is
completely foreign to me.  The new JBoss microkernel/microcontainer is
just a totally new beast.

M

-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

-- 
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to