I've decided to rework the web-services deployer for JBoss-Rails to try wielding Apache-CXF directly. The goal is to make configuration even easier. With JBossWS, it still expected a META-INF/ directory containing your WS-Security configuration file. In XML.
And we know that's not awesome for Rails folks.
But, during the process of playing with CXF, I found that some of its interceptors are slightly incompatible with the JBoss SOAP DOM implementation. After spending a day recompiling both CXF and the JBoss DOM bits, I finally located the bug, in CXF's StaxUtils class.
I filed my report in the CXF JIRA, but I don't want to wait around for another release. I also don't want to mangle the CXF jars I'm getting from the Maven repository or the JBoss DOM classes I get from the app-server.
The quick solution seemed to be replicating the StaxUtils class, with my bugfix, into my own source-tree, and getting it in front of the "official" class located in the CXF jar.
Firing up the JBoss-Rails deployer with my patched class still resulted in failure. It appears that the jars inside the deployer are loaded alphabetically, perhaps. CXF vs JBoss, it's hard to get my class in front.
As we've talked previously about structure deployers, and how they help Microcontainer recognize the shape and layout of some thing you deploy. They figure out where to look for classes, and where to look for meta-data.
MC also supports a declared-structure concept. The thing-being-deployed tells MC all of this structure information, through a jboss-structure.xml file. Using this facility within the JBoss-Rails deployer, I have more control over the jar search order:
<?xml version="1.0" encoding="UTF-8"?>
<structure>
<context>
<path name=""/>
<metaDataPath>
<path name="META-INF"/>
</metaDataPath>
<classpath>
<path name="lib/jboss-rails.jar"/>
<path name="lib/" suffixes=".jar" />
</classpath>
</context>
</structure>
This file says that starting from the top of the deployer's own archive, META-INF/ is for meta-data, and the classpath should include the jboss-rails.jar first, then everything else with a .jar extension.
Once again, Microcontainer saves the day with a handful of metadata.