How Do I Disable Metro On Glassfish?

2k views Asked by At

is there anyway that I could tell glassfish 3 to disable metro? i'm currently using CXF as my library. CXF is working but it is also publishing its own web services.

Is there anyway that I could tell glassfish not to publish these additional web services? These are the benans that were annotated by @WebService

I tried declaring a sun-web.xml that contains this but it's still not working

Glassfish 3 i automatically publishing it and it's creating two instances of the web service instead of one.

thanks a lot

2

There are 2 answers

0
Sylvain On

CXF Interceptors will not work in Glassfish without this sun-web.xml file to configure the classloader. By default, Glassfish will use Metro for JAX-WS services so the classloader needs to be configured to allow CXF libraries to provide JAX-WS services. The following sun-web.xml xml source was added to /WEB-INF to resolve this issue:

<?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>

The explaination from CXF website : http://cxf.apache.org/docs/application-server-specific-configuration-guide.html#ApplicationServerSpecificConfigurationGuide-Glassfish

0
gcvt On

To disable Metro monitoring, go to admin console, Configurations -> server-config, and add the following JVM option:

-Dcom.sun.xml.ws.monitoring.endpoint=false

Restart the server to apply this setting.