
Originally Posted by
sbirnie
One few more things. I'm building the war and ear with Maven. I've gone through and excluded all references to xerces and xalan so that it will pick up Websphere's version.
I'm also building the schema directory using a maven plugin that reads the XSD. I don't know which one is the most popular out there, but right now I'm using:
groupId=com.sun.tools.xjc.maven2
artifactId=maven-jaxb-plugin
If that's old or there's a better one out there I'd love to know.
I do not use maven and i can not provide you any maven dependencies.
To generate java from XSD i use ant jaxb task.
But straight to the point:
My application is a single ear that conatins EJB jar and 2 wars. Only one of the wars utilizes SWS.
Spring Framework jars (not SWS) are located directly under ear and are referenced from wars by Class-Path entries in Manifest.mf files.
If you do pack your application differently the steps i provide below should work but i have not tested them in a different configuration
Inside WEB-INF/lib of SWS war i have:
Code:
activation-1.1.1.jar jaxb-api-2.1.jar jaxb-impl-2.1.5.jar spring-oxm-1.5.2.jar spring-oxm-tiger-1.5.2.jar spring-webmvc.jar spring-ws-core-1.5.2.jar spring-ws-core-tiger-1.5.2.jar spring-ws-support-1.5.2.jar spring-xml-1.5.2.jar stax-api-1.0.1.jar XmlSchema-1.3.2.jar
I am not sure if all these jars are necessary in 100 %. But asfaik i copied them from lib folder of SWS 1.5.2.
Next step is to override some websphere jars.
You can do it in a multiple ways:
Setting ParentLast classloading policy on War,
Setting ParentLast classloading policy on EAR,
Create custom classloader.
I have decided to use the latter solution, cause i do not have a good experience with Parent - last policy.
You can read on a forum that some of the folks were successful with Parent-last policy, so it is up to you.
Steps to define custom classloader you can find in a Webphere reference - it is about defining shared library, creating new classloader and point it to the library.
The most important are:
1)set this classloader to parent last(application first)
2)define correct jars in this library
I have defined the following jars:
Code:
wsdl4j-1.6.1.jar
xalan-2.7.0.jar
xercesImpl-2.8.1.jar
All these jars are again copied from SWS 1.5.2 lib folder.
In the beginning i also had xml-apis-1.3.04.jar but encountered some problems:application worked correctly but during first invocation of webservice ClassCastExceptions was logged and SWS failed to discover SAAJ 1.2 runtime and failed to SAAJ 1.1
After i removed xml-apis from my custom classloader shared library everything started working as a charm.
I have also spent some time trying to create SAAJ 1.3 runtime (websphere implements only SAAJ 1.2) but reference implementation i downloaded from java.net uses classes from com.sun.org.apache.xerces or sth like that are bundled in JRE but SUN JRE not IBM JRE.
Since i do not need SAAJ 1.3 up to now, i haven't tried to drill the issue further.
I hope it helps.