Results 1 to 6 of 6

Thread: Spring web services in Websphere

  1. #1
    Join Date
    Dec 2007
    Posts
    1

    Default 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!

  2. #2
    Join Date
    Mar 2008
    Posts
    11

    Default 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))

  3. #3
    Join Date
    Jul 2005
    Location
    Zagreb, Croatia
    Posts
    69

    Default 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!

  4. #4
    Join Date
    Oct 2007
    Posts
    28

    Default

    Exactly, this works just fine. We are using the same setup in a production environment (albeit with the jars inside an ear instead of web-inf/lib, and the classpath entry in the manifest of the webservice war referring to them) and the classloaders (WAR/EAR) set to parent last.

    Maybe this can be added to the FAQ?

  5. #5
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Quote Originally Posted by fbascheper View Post
    Maybe this can be added to the FAQ?
    Will do. See http://jira.springframework.org/browse/SWS-312
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  6. #6
    Join Date
    Mar 2008
    Posts
    11

    Default 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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •