Spring web services in Websphere
I'm working on my first Spring proof of concept for a project I'm working on. I've got the application working in a WAS 6.0 server instance and I'm using Spring 2.1.
Now I would like to expose logic in a Spring Bean as a SOAP/HTTP Web Service. The first thing I tried was using RAD to generate the web service via the Web Services Wizard...BUT...I was pretty sure that wouldn't work since WAS wouldn't give Spring the opportunity to inject the object dependencies. And of course it didn't work...NullPointerException.
What I'm trying to figure out is
1) Has anyone got something like this working in WAS 6.0?
2) What is the recommended approach for exposing Spring Beans as web services in Websphere?
Thanks in advance!
Spring WS and Websphere 6.0
I'm currently trying to get Spring Web Services running in WAS 6.0 and struggling. Since WAS 6.0 is JDK 1.4 you've got to override the lib endorsed jars as per the FAQ on the Spring WS website. Once you've done this I cannot get anything deployed as some of the jars remove a class that is used during WAS deployment. Yes there's probably a workaround for that as a deployment in essence simply copies files to different areas but when in a controlled corporate environment to have to implement workaround after workaround is not real good. I think I'll have to move to AXIS2.
FYI, the deployment Exception received is
Code:
java.lang.NoClassDefFoundError: org/apache/xml/serializer/TreeWalker
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:389)
at com.ibm.wtp.internal.emf.xml.EMF2DOMRenderer.serializeDocument(EMF2DOMRenderer.java:180)
at com.ibm.wtp.internal.emf.xml.EMF2DOMRenderer.doSave(EMF2DOMRenderer.java:84)
at com.ibm.wtp.emf.xml.TranslatorResourceImpl.doSave(TranslatorResourceImpl.java:216)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:802)
at com.ibm.etools.j2ee.commonarchivecore.strategy.SaveStrategyImpl.saveMofResource(SaveStrategyImpl.java:160)
at com.ibm.etools.j2ee.commonarchivecore.strategy.ZipStreamSaveStrategyImpl.saveMofResource(ZipStreamSaveStrategyImpl.java:78)
at com.ibm.etools.j2ee.commonarchivecore.strategy.SaveStrategyImpl.saveMofResource(SaveStrategyImpl.java:150)
at com.ibm.etools.j2ee.commonarchivecore.strategy.SaveStrategyImpl.basicSaveMofResources(SaveStrategyImpl.java:194)
at com.ibm.etools.j2ee.commonarchivecore.strategy.SaveStrategyImpl.saveMofResources(SaveStrategyImpl.java:187)
at com.ibm.etools.j2ee.commonarchivecore.strategy.SaveStrategyImpl.save(SaveStrategyImpl.java:84)
at com.ibm.etools.j2ee.commonarchivecore.impl.ArchiveImpl.save(ArchiveImpl.java:1240)
at com.ibm.etools.j2ee.commonarchivecore.impl.ModuleFileImpl.save(ModuleFileImpl.java:345)
at com.ibm.ws.management.application.client.AppInstallHelper.createEarWrapper(AppInstallHelper.java:479)
at com.ibm.ws.management.application.client.AppInstallHelper.createEarWrapper(AppInstallHelper.java:315)
at com.ibm.ws.management.application.client.AppInstallHelper.createEarWrapper(AppInstallHelper.java:295)
at com.ibm.ws.console.appmanagement.action.UploadAction.formUpload(UploadAction.java:415)
at com.ibm.ws.console.appmanagement.action.UploadAction.execute(UploadAction.java:129)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:275)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1486)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:528)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1572)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1521)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:136)
at com.ibm.ws.console.core.servlet.WSCUrlFilter.continueStoringTaskState(WSCUrlFilter.java:311)
at com.ibm.ws.console.core.servlet.WSCUrlFilter.doFilter(WSCUrlFilter.java:185)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:142)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:121)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:82)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:759)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3177)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:253)
at com.ibm.ws.webcontainer.VirtualHost.handleRequest(VirtualHost.java:229)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1970)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:114)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:472)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:411)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:101)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.requestComplete(WorkQueueManager.java:566)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.attemptIO(WorkQueueManager.java:619)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager.workerRun(WorkQueueManager.java:952)
at com.ibm.ws.tcp.channel.impl.WorkQueueManager$Worker.run(WorkQueueManager.java:1039)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
SWS 1.5M2 + WAS6.x working like a charm...
Hi...
I've managed to setup a SWS project on both WAS6.0 and WAS6.1. I'm using 1.5M2 with the same runtime classpath on both servers.
As you pointed out, WAS6.0 is JAVA 1.4 and you have to provide your own XERCES, XALAN and XML_APIS. I didn't endorse them, i just put them in the WEB-INF/lib and i run the app with APPLICATION CLASSLOADER FIRST. Also, i'm forcing SAAJ 1.2 in the runtime classpath on both servers...
Hope this helps, ask for any info...
Cheers!
Spring WS and Websphere 6.0
Thanks miha and fbascheper, you're right this works fine. Setting the class loader to 'Parent Last' is all i needed.