Deploying CXF Web Services in WebSphere 7.0 - Websphere

This is a discussion on Deploying CXF Web Services in WebSphere 7.0 - Websphere ; Hi all, I deployed a CXF web Services under WebSphere 7.0 and when I call a service I got the following exception. Am I missing some jar files? I am using IBM jdk instead of Sun's jdk. I deploy the ...

+ Reply to Thread
Results 1 to 9 of 9

Thread: Deploying CXF Web Services in WebSphere 7.0

  1. Deploying CXF Web Services in WebSphere 7.0

    Hi all,
    I deployed a CXF web Services under WebSphere 7.0 and when I call a service I got the following exception.
    Am I missing some jar files? I am using IBM jdk instead of Sun's jdk.
    I deploy the same web services under WebLogic and it runs fine.

    javax.xml.ws.soap.SOAPFaultException: Unable to internalize message
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWs ClientProxy.java:145)
    at $Proxy41.login(Unknown Source)
    at com.primavera.wsclient.AuthenticationServiceJAXWSC lient.testLogin(AuthenticationServiceJAXWSClient.j ava:154)
    at com.primavera.wsclient.AuthenticationServiceJAXWSC lient.main(AuthenticationServiceJAXWSClient.java:3 8)
    Caused by: org.apache.cxf.binding.soap.SoapFault: Unable to internalize message
    at org.apache.cxf.binding.soap.interceptor.Soap11Faul tInInterceptor.unmarshalFault(Soap11FaultInInterce ptor.java:75)
    at org.apache.cxf.binding.soap.interceptor.Soap11Faul tInInterceptor.handleMessage(Soap11FaultInIntercep tor.java:46)
    at org.apache.cxf.binding.soap.interceptor.Soap11Faul tInInterceptor.handleMessage(Soap11FaultInIntercep tor.java:35)
    at org.apache.cxf.phase.PhaseInterceptorChain.doInter cept(PhaseInterceptorChain.java:236)
    at org.apache.cxf.interceptor.AbstractFaultChainIniti atorObserver.onMessage(AbstractFaultChainInitiator Observer.java:96)
    at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInter ceptor.handleMessage(SOAPHandlerInterceptor.java:1 35)
    at org.apache.cxf.jaxws.handler.soap.SOAPHandlerInter ceptor.handleMessage(SOAPHandlerInterceptor.java:6 9)
    at org.apache.cxf.phase.PhaseInterceptorChain.doInter cept(PhaseInterceptorChain.java:236)
    at org.apache.cxf.endpoint.ClientImpl.onMessage(Clien tImpl.java:641)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedO utputStream.handleResponseInternal(HTTPConduit.jav a:2108)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedO utputStream.handleResponse(HTTPConduit.java:1987)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedO utputStream.close(HTTPConduit.java:1912)
    at org.apache.cxf.transport.AbstractConduit.close(Abs tractConduit.java:66)
    at org.apache.cxf.transport.http.HTTPConduit.close(HT TPConduit.java:611)
    at org.apache.cxf.interceptor.MessageSenderIntercepto r$MessageSenderEndingInterceptor.handleMessage(Mes sageSenderInterceptor.java:62)
    at org.apache.cxf.phase.PhaseInterceptorChain.doInter cept(PhaseInterceptorChain.java:236)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientIm pl.java:469)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientIm pl.java:299)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientIm pl.java:251)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(Cli entProxy.java:73)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWs ClientProxy.java:124)

    Thanks
    Steve

  2. Re: Deploying CXF Web Services in WebSphere 7.0

    Hi all,
    Here are some more info. Currently I am using CXF2.2.2 for my Web Services.
    I had deployed CXF2.1 WebServices under WebSphere6.1 and it works. Are there any jar files changes in WebSphere7.0? Especially jaxp related jar files.


    Thanks
    Steve

  3. Re: Deploying CXF Web Services in WebSphere 7.0

    Steve,

    WAS 6.1 did not have any support for JAX-WS based web services. You had to add web services feature pack to add that support. Whereas in WAS 7.0 JAX-WS is already bundled into the app server itself. So yes, please create a PMR with IBM support. You will need to flip class loaders and may need to set up some isolated shared libraries with the CXF jars.

    thanks,
    dims

  4. Re: Deploying CXF Web Services in WebSphere 7.0

    Hi Dims,
    Can you please give me some more info on how to create a PMR with IBM support?

    Thanks
    Steve

  5. Re: Deploying CXF Web Services in WebSphere 7.0

    Steve,

    Please see here:
    http://www.ibm.com/developerworks/we...ort.html#step6

    thanks,
    dims

  6. Re: Deploying CXF Web Services in WebSphere 7.0

    Hi Steve,

    Could you please keep us updated concerning your issue?
    We're also facing some troubles by using CXF within WAS 7.

    The only way seems to put CXF Jars in a specific folder and to modify class loading features accordingly (or by using a shared library). But which Jars should be overloaded? Is there an exhaustiv list?

    Thanks a lot.

    BR

  7. Re: Deploying CXF Web Services in WebSphere 7.0

    Hi,

    Any news concerning this issue?

    Thanks a lot.

  8. Re: Deploying CXF Web Services in WebSphere test server 6.1/RAD 7.5

    I am unable to deploy an application using a simple "Hello World" type CXF application in WebSphere 6.1 test server (part of RAD 7.5 IDE) that uses Servlet 2.4 specification.

    Can you please tell me the versions of all the jar files that you have in web-inf/lib folder?


    It will be fine if I can get it working using CXF 2.1 in WebSphere 6.1.

    However, in my current endeavor, I am using CXF 2-2-3. I have placed all the jar files that are downloaded from CXF 2-2-3 in the web-inf/lib folder of the web application. I add that application in the WebSphere 6.1 test server. When I start the server, I get the following error:

    Publishing failed
    Deploying MyPocWebService
    Deployment from com.ibm.ast.ws.jaxws.deployer.JAXWSDeployer had errors:

    Tools for WebSphere V6.1 must be installed in order to generate WebSphere V6.1 compliant code.

    Any suggestion will be appreciated.

    As I mentioned, it will be fine if I have CXF 2.1.6 running in WebSphere 6.1. I do not have to use CXF 2-2-3, in case it has any limitation with WebSphere 6.1.

    Now, I changed the jar files in the web-in/lib project from CXF with all the jar files obtained from CXF2.1.6. I do not get the same error and the application deploys successfully. When I run the client, I get the error below:

    ID: 1
    Address: http://localhost:9081/authManager/services/cxfAuth
    Encoding: UTF-8
    Content-Type: text/xml
    Headers: {SOAPAction=[""], Accept=[*/*]}
    Payload: 0223938
    --------------------------------------
    Sep 18, 2009 1:31:00 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
    WARNING: Interceptor has thrown exception, unwinding now
    org.apache.cxf.interceptor.Fault: Could not send Message.
    at org.apache.cxf.interceptor.MessageSenderIntercepto r$MessageSenderEndingInterceptor.handleMessage(Mes sageSenderInterceptor.java:64)
    at org.apache.cxf.phase.PhaseInterceptorChain.doInter cept(PhaseInterceptorChain.java:236)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientIm pl.java:472)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientIm pl.java:302)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientIm pl.java:254)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(Cli entProxy.java:73)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWs ClientProxy.java:127)
    at $Proxy48.getEmployee(Unknown Source)
    at com.company.auth.client.Client.main(Client.java:21 )
    Caused by: java.io.IOException: Not Found
    at org.apache.cxf.transport.http.HTTPConduit$WrappedO utputStream.handleResponseInternal(HTTPConduit.jav a:2068)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedO utputStream.handleResponse(HTTPConduit.java:2019)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedO utputStream.close(HTTPConduit.java:1944)
    at org.apache.cxf.io.CacheAndWriteOutputStream.postCl ose(CacheAndWriteOutputStream.java:47)
    at org.apache.cxf.io.CachedOutputStream.close(CachedO utputStream.java:188)
    at org.apache.cxf.transport.AbstractConduit.close(Abs tractConduit.java:66)
    at org.apache.cxf.transport.http.HTTPConduit.close(HT TPConduit.java:632)
    at org.apache.cxf.interceptor.MessageSenderIntercepto r$MessageSenderEndingInterceptor.handleMessage(Mes sageSenderInterceptor.java:62)
    ... 8 more
    Exception in thread "main" javax.xml.ws.WebServiceException: org.apache.cxf.interceptor.Fault: Could not send Message.
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWs ClientProxy.java:145)
    at $Proxy48.getEmployee(Unknown Source)
    at com.company.auth.client.Client.main(Client.java:21 )
    Caused by: org.apache.cxf.interceptor.Fault: Could not send Message.
    at org.apache.cxf.interceptor.MessageSenderIntercepto r$MessageSenderEndingInterceptor.handleMessage(Mes sageSenderInterceptor.java:64)
    at org.apache.cxf.phase.PhaseInterceptorChain.doInter cept(PhaseInterceptorChain.java:236)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientIm pl.java:472)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientIm pl.java:302)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientIm pl.java:254)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(Cli entProxy.java:73)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWs ClientProxy.java:127)
    ... 2 more
    Caused by: java.io.IOException: Not Found
    at org.apache.cxf.transport.http.HTTPConduit$WrappedO utputStream.handleResponseInternal(HTTPConduit.jav a:2068)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedO utputStream.handleResponse(HTTPConduit.java:2019)
    at org.apache.cxf.transport.http.HTTPConduit$WrappedO utputStream.close(HTTPConduit.java:1944)
    at org.apache.cxf.io.CacheAndWriteOutputStream.postCl ose(CacheAndWriteOutputStream.java:47)
    at org.apache.cxf.io.CachedOutputStream.close(CachedO utputStream.java:188)
    at org.apache.cxf.transport.AbstractConduit.close(Abs tractConduit.java:66)
    at org.apache.cxf.transport.http.HTTPConduit.close(HT TPConduit.java:632)
    at org.apache.cxf.interceptor.MessageSenderIntercepto r$MessageSenderEndingInterceptor.handleMessage(Mes sageSenderInterceptor.java:62)
    ... 8 more


    Following is the client code:

    package com.company.auth.client;

    import org.apache.cxf.interceptor.LoggingInInterceptor;
    import org.apache.cxf.interceptor.LoggingOutInterceptor;
    import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

    import com.company.auth.bean.Employee;
    import com.company.auth.service.AuthService;

    public class Client {

    public static void main(String[] args) {
    JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();

    factory.getInInterceptors().add(new LoggingInInterceptor());
    factory.getOutInterceptors().add(new LoggingOutInterceptor());
    factory.setServiceClass(AuthService.class);
    factory.setAddress("http://localhost:9081/authManager/services/cxfAuth");
    AuthService client = (AuthService) factory.create();

    Employee employee = client.getEmployee("0223938");
    System.out.println("Server said: " + employee.getLastName() + ", " + employee.getFirstName());
    System.exit(0);

    }
    }

    Could anybody please answer the following questions:

    1. Has anyone been able to run CXF2.2.3 in WebSphere 6.1?
    2. What could be the problem with my client for running CXF 2.1.6 in WebSphere 6.1? I am using the example from http://www.benmccann.com/dev-blog/we...th-apache-cxf/ that is using CXF2.1.6

  9. Re: Deploying CXF Web Services in WebSphere 7.0

    For WAS7.0 you can try these options and see if the CXF application works:

    1) Remove the geronimo-servlet_ _spec-.jar from the web-inf/lib of CXF war.
    2) Modify the MANIFEST.mf file your CXF war and add the following property
    UseWSFEP61ScanPolicy: false
    alternatively you can set a system property com.ibm.websphere.webservices.UseWSFEP61ScanPolicy =false.
    3) Flip the WAR Module Class loader to PARENT_LAST.

    For WAS 6.1 with Feature Pack.

    1) You will need a PMR, there is a fix provided by IBM that enables a property setting to turn off IBM JAX-WS Engine, once you set that property the CXF application should start.
    2) Next you will have to make sure that you remove the geronimo-servlet jar as CXF packages 2.5 servlet and WAS 6.1 does not support 2.5.
    3) Flip the module class loader to use “Classes loaded with application class loader first”.

    Hope this helps.

    -Nikhil.

+ Reply to Thread