Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The output of wsgen will appear in the geronimo.log file.

AccessControlException when deploying Web Services using CXF

When deploying JAX-WS Web Services using CXF you might see the following exception:

No Format

Caused by: java.security.AccessControlException: access denied (javax.xml.ws.WebServicePermission publishEndpoint)
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:264)
    at java.security.AccessController.checkPermission(AccessController.java:427)
    at org.apache.cxf.jaxws.EndpointImpl.checkPublishPermission(EndpointImpl.java:389)
    at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:248)
    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:201)
    at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:394)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    ...

As per JSR-109 specification application servers are supposed to block publishing new Web Service endpoints via the Endpoint API. However, this can be disabled by setting the org.apache.cxf.jaxws.checkPublishEndpointPermission system property to false. For example, start the server after setting the following property:

Code Block

export JAVA_OPTS=-Dorg.apache.cxf.jaxws.checkPublishEndpointPermission=false