WebSphere Application Server & Liberty

WebSphere Application Server & Liberty

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Problem creating Web Services with JAX WS-SUN library

  • 1.  Problem creating Web Services with JAX WS-SUN library

    Posted Fri January 20, 2012 08:19 PM

    * CONTEXT OF THE PROBLEM:
    I consume a Web service methods exposed by an institution outside the mine, the web service was generated by JAX WS-SUN.
    Implement other web service for domestic consumption of my institution which encapsulates the methods exposed by the outsourcer, use JAX WS-SUN (not IBM), initially had some problems with the recognition of some jar.
    Try setting the shared libraries on the server to use the jar with the class loader PARENT_LAST and did not work.
    Try reliza with JAX WS-IBM libraries but had no success, so do so with JAX WS-SUN (libraries used by the external service provider)
    Then I found a solution using the "endorsed" folder (this folder already existed but was empty) that is in the sdk directory tree included in the WAS 7.0 and copying other jar in the "classes" folder, which are physically located (in my PC):
     
    endorsed: E: \ IBM \ SDP \ jdk \ jre \ lib \ Endorsed
    jar copied: - saaj-api.jar
                   - Saaj-impl.jar
                   - Serializer-2.7.1.jar
                   - Stax-1.2.0.jar
                   - Stax-ex.jar
                   - Streambuffer.jar
                   - Xalan-2.7.1.jar
                   - XercesImpl-2.9.0.jar
                   - Xml-apis-1.3.04.jar
    classes: E: \ IBM \ SDP \ runtimes \ base_v7 \ profiles \ AppSrv01 \ classes
    jar copied: - jaxb-api.jar
                  - Jaxb-impl.jar
                  - Jaxb-xjc.jar
                  - Jaxp-ri-1.4.2.jar
                  - Jaxws-api.jar
                  - Jaxws-rt.jar
                  - Jaxws-tools.jar
                  - Webservices-api.jar
                  - Webservices-rt.jar
    To deploy the application using the WAS 7.0 that is included in the RSA 7.5 (Rational Software Architect) which is installed on Windows Server 2003 EE - 32bit. So far so good, do my test query exposed methods and get the expected response
     
    * THE PROBLEM:
    The problem arises when I deploy the EAR to WAS 7.0 that is installed on linux (RedHat) kernel 2.6.18 - 64 bits.
     
    In this case I had to create the folder it was not endorsed directory and put the jar in each directory listed above, which are physically located in:
     
    Endorsed: / opt / IBM / WebSphere / AppServer / java / jre / lib / endorsed
    classes: / opt/IBM/WebSphere/AppServer/profiles/AppSrv01/classes
     
    Then I do my tests and trace gives the following error:
     
    [01/20/2012 9:11:54] ERROR [class: pe.gob.pj.WsBiometriaImpl] error
    javax.xml.ws.WebServiceException: java.lang.NoSuchMethodError: com / sun / xml / stream / buffer / Stax / StreamWriterBufferCreator.setCheckAttributeValue (Z) V
     at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processRequest (SecurityClientTube.java: 170)
     at com.sun.xml.ws.api.pipe.Fiber.__doRun (Fiber.java: 598)
     at com.sun.xml.ws.api.pipe.Fiber._doRun (Fiber.java: 557)
     at com.sun.xml.ws.api.pipe.Fiber.doRun (Fiber.java: 542)
     at com.sun.xml.ws.api.pipe.Fiber.runSync (Fiber.java: 439)
     at com.sun.xml.ws.client.Stub.process (Stub.java: 222)
     at com.sun.xml.ws.client.sei.SEIStub.doProcess (SEIStub.java: 135)
     at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke (SyncMethodHandler.java: 109)
     at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke (SyncMethodHandler.java: 89)
     at com.sun.xml.ws.client.sei.SEIStub.invoke (SEIStub.java: 118)
     at $ Proxy158.login (Unknown Source)
     at reniec.ws.AccessWS.loginWSBIO (AccessWS.java: 36)
     at pe.gob.pj.WsBiometriaImpl.loginWSBIO (WsBiometriaImpl.java: 74)
     at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java: 45)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java: 37)
     at java.lang.reflect.Method.invoke (Method.java: 599)
     com.sun.xml.ws.api.server.InstanceResolver at $ 1.invoke (InstanceResolver.java: 246)
     com.sun.xml.ws.server.InvokerTube at $ 2.invoke (InvokerTube.java: 146)
     at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke (EndpointMethodHandler.java: 257)
     at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest (SEIInvokerTube.java: 93)
     at com.sun.xml.ws.api.pipe.Fiber.__doRun (Fiber.java: 598)
     at com.sun.xml.ws.api.pipe.Fiber._doRun (Fiber.java: 557)
     at com.sun.xml.ws.api.pipe.Fiber.doRun (Fiber.java: 542)
     at com.sun.xml.ws.api.pipe.Fiber.runSync (Fiber.java: 439)
     com.sun.xml.ws.server.WSEndpointImpl at $ 2.process (WSEndpointImpl.java: 243)
     com.sun.xml.ws.transport.http.HttpAdapter at $ HttpToolkit.handle (HttpAdapter.java: 444)
     at com.sun.xml.ws.transport.http.HttpAdapter.handle (HttpAdapter.java: 244)
     at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle (ServletAdapter.java: 135)
     at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet (WSServletDelegate.java: 129)
     at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost (WSServletDelegate.java: 160)
     at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost (WSServlet.java: 75)
     at javax.servlet.http.HttpServlet.service (HttpServlet.java: 738)
     at javax.servlet.http.HttpServlet.service (HttpServlet.java: 831)
     at com.ibm.ws.webcontainer.servlet.ServletWrapper.service (ServletWrapper.java: 1657)
     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java: 939)
     at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java: 502)
     at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest (ServletWrapperImpl.java: 179)
     at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest (CacheServletWrapper.java: 91)
     at com.ibm.ws.webcontainer.WebContainer.handleRequest (WebContainer.java: 864)
     at com.ibm.ws.webcontainer.WSWebContainer.handleRequest (WSWebContainer.java: 1583)
     at com.ibm.ws.webcontainer.channel.WCChannelLink.ready (WCChannelLink.java: 186)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination (HttpInboundLink.java: 445)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest (HttpInboundLink.java: 504)
     at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest (HttpInboundLink.java: 301)
     at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete (HttpICLReadCallback.java: 83)
     at
     at com.ibm.io.async.AbstractAsyncFuture.invokeCallback (AbstractAsyncFuture.java: 217)
     at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions (AsyncChannelFuture.java: 161)
     at com.ibm.io.async.AsyncFuture.completed (AsyncFuture.java: 138)
     at com.ibm.io.async.ResultHandler.complete (ResultHandler.java: 204)
     at com.ibm.io.async.ResultHandler.runEventProcessingLoop (ResultHandler.java: 775)
     com.ibm.io.async.ResultHandler at $ 2.run (ResultHandler.java: 905)
     at com.ibm.ws.util.ThreadPool $ Worker.run (ThreadPool.java: 1604)
    Caused by: java.lang.NoSuchMethodError: com / sun / xml / stream / buffer / Stax / StreamWriterBufferCreator.setCheckAttributeValue (Z) V
     at com.sun.xml.ws.security.opt.impl.message.SOAPBody.cachePayLoad (SOAPBody.java: 204)
     at com.sun.xml.ws.security.opt.impl.dsig.SignedMessagePart.writeTo (SignedMessagePart.java: 147)
     at com.sun.xml.ws.security.opt.impl.crypto.JAXBDataImpl.writeTo (JAXBDataImpl.java: 117)
     at com.sun.xml.ws.security.opt.crypto.dsig.Exc14nCanonicalizer.transform (Exc14nCanonicalizer.java: 181)
     at com.sun.xml.ws.security.opt.crypto.dsig.Transform.transform (Transform.java: 178)
     at com.sun.xml.ws.security.opt.crypto.dsig.Reference.transform (Reference.java: 183)
     at com.sun.xml.ws.security.opt.crypto.dsig.Reference.digest (Reference.java: 124)
     at com.sun.xml.ws.security.opt.crypto.dsig.Signature.sign (Signature.java: 214)
     at com.sun.xml.ws.security.opt.impl.dsig.SignatureProcessor.sign (SignatureProcessor.java: 122)
     at com.sun.xml.wss.impl.filter.SignatureFilter.sign (SignatureFilter.java: 544)
     at com.sun.xml.wss.impl.filter.SignatureFilter.process (SignatureFilter.java: 506)
     at com.sun.xml.wss.impl.HarnessUtil.processWSSPolicy (HarnessUtil.java: 93)
     at com.sun.xml.wss.impl.HarnessUtil.processDeep (HarnessUtil.java: 268)
     at com.sun.xml.wss.impl.SecurityAnnotator.processMessagePolicy (SecurityAnnotator.java: 186)
     at com.sun.xml.wss.impl.SecurityAnnotator.secureMessage (SecurityAnnotator.java: 147)
     at com.sun.xml.wss.jaxws.impl.SecurityTubeBase.secureOutboundMessage (SecurityTubeBase.java: 390)
     at
     at com.sun.xml.wss.jaxws.impl.SecurityClientTube.processRequest (SecurityClientTube.java: 167)
     ... 53 more


    I would appreciate if you could give me some idea of ??the origin of the problem or any way to fix it.



  • 2.  Problem creating Web Services with JAX WS-SUN library

    Posted Sat January 21, 2012 08:55 AM
    Hi Victorin,

      the problem is an

    java.lang.NoSuchMethodError: com / sun / xml / stream / buffer / Stax / StreamWriterBufferCreator.setCheckAttributeValue (Z) V

      i'm not sure but i think that you have two jar loaded with the same name and the application is taken the wrong, that is find the class with same name but implemented diferent.

      I suggest the next approch:

      1.- Active in the server Classloader Viewer in the server where you are deploying

      Servers->Other Properteis/Services->Classloader Viewer Services->Check enable at startup

      This services is in the server configuration page at the botton off the properties

      After enable restart the server.

      2.- When the server is started, login in console and go to:

      Trubbleshotting-> Classloader Viewer->find Class and search for

    com.sun.xml.wss.jaxws.impl.SecurityClientTube.processRequest class to see whats classloader is loading class and if is more than one classloaders.

      I think in that case that the better approach is to use shared librarys and play with class loader orders at the application level in this way you always can isolate classes. 

     Hope this helps if you need more help say here

    regards




  • 3.  Problem creating Web Services with JAX WS-SUN library

    Posted Tue January 24, 2012 10:58 AM

    I put in the search filter chain: * SecurityClientTube *. And I do not show any result, I understand that that is not loading the class, perhaps it is because of the folder "endorsed" is not recognized?



  • 4.  Problem creating Web Services with JAX WS-SUN library

    Posted Tue January 24, 2012 12:55 PM
    Hi victorin,


      If the class is not loaded and is necesary NotClassDefFoundException arise always.
       
     With the classloader viewer you can see all the classloaders and hierachy of them for the application and see if the "endorsed" folder is in some of them.  In the top are system classloaders and in the botton application classloaders.

      Can you found other classes? is to see if the classloader viewer service is activated.


    regards
     


  • 5.  Problem creating Web Services with JAX WS-SUN library

    Posted Tue January 24, 2012 01:03 PM
    another thing Victorin, with classloader viewer service no activated you can't search individual classes but you can search jar, could you find these jars?

    - saaj-api.jar
    - Saaj-impl.jar
    - Serializer-2.7.1.jar
    - Stax-1.2.0.jar
    - Stax-ex.jar
    - Streambuffer.jar
    - Xalan-2.7.1.jar
    - XercesImpl-2.9.0.jar


  • 6.  Problem creating Web Services with JAX WS-SUN library

    Posted Tue January 24, 2012 01:30 PM
    Hi Gabriel, the box is checked to see classes loaded. But I can not find any jar that I put in the folder "endorsed", but I can see the jar that I put in the "classes":- Jaxb-api.jar- Jaxb-impl.jar- Jaxb-xjc.jar- Jaxp-ri-1.4.2.jar- Jaxws-api.jar- Jaxws-rt.jar- Jaxws-tools.jar- Webservices-api.jar- Webservices-rt.jar


  • 7.  Problem creating Web Services with JAX WS-SUN library

    Posted Tue January 24, 2012 01:36 PM
    La aplicacion desplegado en el WAS que viene incluido en el RSA, instalado en SO windows funciona correctamente. El problema surge cuando despliego el archivo EAR en un WAS instalado en linux, hay alguna diferencia entre estos 2 sistemas operativos???


  • 8.  Problem creating Web Services with JAX WS-SUN library

    Posted Tue January 24, 2012 01:52 PM
    The application deployed in WAS that is included in the RSA, installed on windows OS is working properly. The problem arises when it deploys the EAR file in WAS installed on linux, there is a difference between these 2 operating systems??


  • 9.  Problem creating Web Services with JAX WS-SUN library

    Posted Tue January 24, 2012 02:58 PM
    Hola Victorin,

      El problema esta en los classlaoder, el directorio "endoresed" no esta dentro de los que el WAS reconoce o tiene por defecto, no tiene que ver con el SO. Puedes añadir el directorio a nivel del servidor de aplicaciones en las propiedades de definición de proceso.

      lo que no entiendo es que no teniendo el directorio al excepcion sea NoSuchMethod. 

    Hi Victorin,

      The problem is with the classloader, the folder "endorsed" isn't in the well known classpaths by default for WAS, the OS is not the problem.

      You can add the endorsed folder to classpath at the server level in the process definition.

       What i don't understand is why if the folder isn't in the classpath the exception is NoSuchMethod. 


  • 10.  Problem creating Web Services with JAX WS-SUN library

    Posted Tue January 24, 2012 03:43 PM
    "endorsed" folder already existed in windows but not linux so I had to create it in:
    /opt/IBM/WebSphere/AppServer/java/jre/lib/endorsed, I think is the correct location to create the directory, or do am I wrong? Please could you give me some guidelines on how to set this directory in the "Process Definition" that do not try it before, maybe that's the solution


  • 11.  Problem creating Web Services with JAX WS-SUN library

    Posted Wed January 25, 2012 01:04 PM
    Hi,

    The path should be correct. Another forum recommends you to read the guidelines. Did you follow the guidelines? Still not working?


    publib.boulder.ibm.com/infocenter/wasinf...