views:

584

answers:

1

Hello all,

I'm having the following problem (reported there by someone else) when running my webapp under Glassfish, while 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 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)

A: 

The Metro (Glassfish's JAX-WS implementation) jars are probably being included with Glassfish, can you exclude them from the classpath? Since you're using maven, you should analyze the glassfish dependencies and using an exclusion for the metro jars.


It seems that you need to have the CXF jars on the applications classpath before the Metro jars. You probably can't modify the system classloader/classpath but you can change the Thread.currentThread().getContextClassLoader() such that it loads CXF first. There also might a classpath settings in Glassfish you can modify

Check out the source for javax.xml.ws.spi.FactoryFinder#find() to see how the provider is actually loaded

Kevin
This could very well be the case, but I'm unsure as to how to remedy this.. It's a compiled .war that I'm uploading to GlassFish, so will Maven excludes still have any effect after compilation? (Ie: will these excludes be passed along to the war and used on the server?)
Tim
So its picking up the Metro provider when you're application is deployed in to Glassfish, not during development?
Kevin
Development is done with Jetty.. There's no GlassFish dependency to exclude..
Tim
I misunderstood your situation, sorry. I've updated my posting
Kevin
Tim