I'm not a web services expert at all...

If you put cxf jars in your app then you should not expect any container managed web services stuff to work at all and you should just turn off the cxf and cxf-deployer plugins in config.xml. If the classes aren't available in geronimo you shouldn't need to use the hidden-classes.

Another approach that might possibly work if cxf 2.2 is sufficiently backwards compatible with 2.1.4 is to put the 2.2 cxf jars in the appropriate places in the geronimo repository and add artifact-alias entries for each one. It's possible that you'd then be able to run geronimo using 2.2.

If this doesn't work.... you could revise the geronimo cxf integration to work with cxf 2.2 and give us a patch :-)

hope this helps
david jencks

On Feb 20, 2010, at 9:24 AM, Alexandros Karypidis wrote:

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