How to pick CXF over Metro on Glassfish

Tim picture Tim · Jan 14, 2010 · Viewed 7.2k times · Source

I'm having the following problem (reported there by someone else) when running my enterprise application under Glassfish. Under Jetty it works fine.

javax/xml/ws/spi/Provider mentions creating a META-INF/services/javax.xml.ws.spi.Provider resource, but this is already supplied with CXF and creating an additional resource file does not solve this problem under Glassfish.

Does anyone know how to ensure that CXF is picked up under GlassFish?
(I'm using a Maven Multi-modules project with CXF dependency 2.2.5)

Thanks!
Tim


EDIT #1

Skipping the problem for now and just working with Metro, but I'd really like to know how to use CXF instead if anyone has any pointers.. If nothing works I might have to switch web application container (or look into Metro to fill my requirements)


EDIT #2

Some of the solutions detail the fix for war's by adding <class-loader delegate="false"/> to the sun-web.xml file. However, this does not work for non-war ee apps.

Answer

Nightwolf picture Nightwolf · Dec 9, 2010

Add a sun-web.xml and set delegate=false to the class-loader:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD 
Application Server 9.0 Servlet 2.5//EN' 
'http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd'> 
<sun-web-app> 
    <class-loader delegate="false"/> 
</sun-web-app>