On Dec 15, 2008, at 11:55 AM, Jazon wrote:

Hi,
I am trying to deploy a web app to Geronimo 2.2-SNAPSHOT. In my geronimo-web.xml, I have <dep:inverse-classloading/> But when the web app starts, I got the following Exception, Can anybody tell me how to solve this problem?

org.apache.geronimo.gbean.InvalidConfigurationException: Getter return type in wrong classloader: type: interface javax.management.j2ee.statistics.Stats wanted in classloader: [org.apache.geronimo.kernel.classloader.JarFileClassLoader id=com.test/testwar/1.0/war] actual: [org.apache.geronimo.kernel.classloader.JarFileClassLoader id=org.apache.geronimo.framework/jee-specs/2.2-SNAPSHOT/car]

Looks like you're including java ee spec classes (e.g. javax.management.j2ee.statistics.Stats) in your application ClassLoader. You've directed us to load the class from your application ClassLoader. However, this is causing a conflict with internal operations.

I usually prefer to avoid <inverse-classloading>, and use <filter><hidden-classes>, to filter appropriate packages from the application classloader. E.g.:

       <hidden-classes>
           <filter>org.jaxen</filter>
           <filter>org.springframework</filter>
           <filter>META-INF/spring</filter>
           <filter>org.apache.cxf</filter>
           <filter>org.apache.commons</filter>
       </hidden-classes>

You can perform conceptually similar filtering using inverse- classloading, with <non-overridable-classes>. Try this for starters:

       <non-overridable-classes>
           <filter>javax</filter>
       </non-overridable-classes>

--kevan

Reply via email to