CXF webservices on Domino

Since Domino 6 I have only seen people use Apache Axis (up to 1.4) as a web service framework and quite frankly it’s a bit long in the tooth; we want to use a newer framework and if we are sticking with the popular frameworks (i.e. native support in Eclipse), that leaves us with Axis 2 and CXF (yes yes! I know that X or Y is the latest and greatest but given the sedentary nature of large corporations I’ll settle for a functionally rich, well-rounded standard that works and in 2 years time can still be supported).

Anyhow, all my clients seem to have plumped for CXF, so this blog is to show you how to get a CXF client working on Domino 8+ (CXF needs Java 5 or greater).

I am assuming that you have already generated your class files (either via Eclipse wizards or via wsdl2J). If you have not, this is a good Link:

Normally when you are writing / testing a Java agent you just bung the supporting jar files in the agent itself, and give it a run. Unfortunately even if you get all the right jar files, you will get this error:

at org.apache.cxf.wsdl11.WSDLServiceFactory.< init> (
at org.apache.cxf.jaxws.ServiceImpl.initializePorts(
at org.apache.cxf.jaxws.ServiceImpl.< init> (
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(
at< init> (

This means that CXF can’t verify your WSDL (yes it’s a naff error) due to security reasons, so you’re going to have to put the jar files in the ext directory on the server.

CXF uses more jar files than Axis. When you download the binary from you will find a “WHICH_JAR” text file in the lib directory that tells you which files you will need to include for which function. As my client is using quite a few of the extra functions (such as WS security), I ended up putting the following files in a directory called “CXF” inside the Dominojvmlibext directory (the extra sub-directory is just so I don’t get the files mixed up):

– cxf.jar
– commons-logging.jar
– geronimo-activation.jar
– geronimo-annotation.jar
– geronimo-stax-api.jar
– neethi.jar
– jaxb-api.jar
– jaxb-impl.jar
– XmlSchema.jar
– wstx-asl.jar
– wsdl4j.jar
– geronimo-ws-metadata.jar
– geronimo-jaxws_2.1_spec-1.0.jar
– saaj-api.jar
– saaj-impl.jar
– asm.jar
– geronimo-servlet.jar
– jetty.jar
– jetty-util.jar
– sl4j.jar & sl4j-jdk14.jar (optional – but improves logging)
– bcprov-jdk15.jar
– xalan.jar
– serializer.jar
– wss4j.jar
– xmlsec.jar

(NOTE: If you are already using Java heavily in domino you may already some of these in your ext directory, so be careful to not double-up or give yourself conflicts).

The next bubble of joy will be the following error message (or something very similar): Access denied
(java.lang.RuntimePermission setContextClassLoader)
at<init> (
at java.lang.SecurityManager.checkPermission(
at java.lang.Thread.setContextClassLoader(
at $Proxy27.getAdjustedLocationValues(Unknown Source)

This is a security message, and means you will have to edit the dominojvmlibsecurityjava.policy file. The exact entry will depend on the error you are getting, but this one: Access denied
(java.lang.RuntimePermission setContextClassLoader)

… meant I put the following lines in:

grant {
permission java.lang.RuntimePermission setContextClassLoader;

Restart your server and that should be it, your CXF calls should work fine.

PS. I have included full error messages to help future lost souls find this post.

PPS. This posts was corrected and sanitised by Mr Poole to make it readable (thank you)
Old Comments
##### Olle Thalen(05/01/2011 14:11:04 GMT)
I get the following exception all the time when I try to run a web service consumer using cxf in domino environment:

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 24 in XML document from class path resource [META-INF/cxf/cxf.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element ‘beans’.
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(
at org.apache.cxf.bus.spring.SpringBusFactory.createBus(
at org.apache.cxf.BusFactory.getDefaultBus(
at org.apache.cxf.BusFactory.getThreadDefaultBus(
at org.apache.cxf.BusFactory.getThreadDefaultBus(
at org.apache.cxf.jaxws.spi.ProviderImpl.createServiceDelegate(

Got any ideas?

Leave a Reply

Your email address will not be published.