Thursday, 4 June 2009

Spring Web Services - Deploying to WAS 6.1

If like me you've ever tried to deploy a Spring web service, that auto generates the WSDL, to WebSphere Application Server you've probably encoutered the same WSDLException that I have:
Caused by: WSDLException: faultCode=CONFIGURATION_ERROR: No Java extensionType found to represent a '{}schema' element in the context of a 'javax.wsdl.Types'.:
at javax.wsdl.extensions.ExtensionRegistry.createExtension(Unknown Source)

This is basically down to IBM's JDK shipping with old versions of WSDL4J, Xalan and Xerces and also has other side effects detailed in the following posts:

There seem to be many suggestions on how to solve this problem from setting environment variables to copying the correct version of the jars to lib/ext directory of the
WAS install but the best solution I've come across is to put the correct jars in the WEB-INF/lib directory of the web application and change the classloader mode to PARENT_LAST and WAR classloader policy to APPLICATION in the EAR's deployment descriptor.

One thing to note is that changing these settings just at the EAR level is not sufficient, you need to change them at the WAR level. This has the effect of telling your web application to locate classes using the WAR classloader first (WEB-INF/lib), if it cant find them then delegate to the EAR classloader and finally to the WASext classloader until they are found.

No comments:

Post a Comment

Search This Blog