Hello,

I need to use CXF 2.2 in my WAR. I have therefore included it in my WEB-INF/lib and hidden the Geronimo 2.2 classes (it embeds CXF 2.1.4) using the following declarations in geronimo-web.xml:

<hidden-classes>
<filter>org.springframework</sys:filter>
<filter>org.apache.cxf</sys:filter>
</hidden-classes>

When loading the CXFServlet during my war's startup, a CXF extension is activated (META-INF/cxf/cxf-extension-geronimo.xml) that probably uses classes loaded from the Geronimo-included CXF (2.1.4) causing class definition mismatch (Cannot convert value of type [org.apache.cxf.resource.ClasspathResolver] to required type [org.apache.cxf.resource.ResourceResolver]).

The relevant stack trace is:

---------------------------------------------------------------------------------
2010-02-20 19:08:05,050 WARN [SpringBusFactory] Initial attempt to crate application context was unsuccessful. org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.cxf.resource.ResourceManager' defined in class path resource [META-INF/cxf/cxf-extension-geronimo.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.util.List]: Could not convert constructor argument value of type [java.util.ArrayList] to required type [java.util.List]: Failed to convert value of type [java.util.ArrayList] to required type [java.util.List]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.apache.cxf.resource.ClasspathResolver] to required type [org.apache.cxf.resource.ResourceResolver]: no matching editors or conversion strategy found
...
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.apache.cxf.resource.ResourceManager' defined in class path resource [META-INF/cxf/cxf-extension-geronimo.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [java.util.List]: Could not convert constructor argument value of type [java.util.ArrayList] to required type [java.util.List]: Failed to convert value of type [java.util.ArrayList] to required type [java.util.List]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [org.apache.cxf.resource.ClasspathResolver] to required type [org.apache.cxf.resource.ResourceResolver]: no matching editors or conversion strategy found at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:565)
....

---------------------------------------------------------------------------------

Now, since "cxf-extension-geronimo.xml" comes from a Geronimo library (http://repo2.maven.org/maven2/org/apache/geronimo/modules/geronimo-cxf/2.2/geronimo-cxf-2.2.pom), how can I prevent the CXF embedded inside my WAR to ignore it? It's not a package, but rather a classpath resource (it's in META-INF/cxf) so there's no point in "hiding" a package. For example, I tried the following, which simply led to a ClassNotFoundException:

<hidden-classes>
<filter>org.springframework</sys:filter>
<filter>org.apache.cxf</sys:filter>
-> <filter>org.apache.geronimo.cxf</sys:filter>
</hidden-classes>

This is normal, as CXF can still see the META-INF/cxf/cxf-extension-geronimo.xml resource in its classpath and still tries to load the extension, only this time it's hidden and results in the ClassNotFoundException...

Is there any way to get around this?

Reply via email to