javaweb-servicessoapjax-rpcjrockit

Weblogic/JRockit Exception handling on JAX-RPC (Soap) webservices


I am maintaining old soap webservices running on JAX-RPC (Weblogic implementation). But I am experiencing an NPE without any complete stack trace :

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault><faultcode>env:Server</faultcode><faultstring>Failed to invoke end component com.old.service.MyService (POJO), operation=listUsers
 -&gt; Failed to invoke method
</faultstring><detail><java:string xmlns:java="java.io">java.lang.NullPointerException
</java:string></detail></env:Fault></env:Body></env:Envelope> 

Is there is a way to find the full stack trace ? Is there is a way to programmatically handling webservices exception like @HandlerChain annotation in Jax-WS (for logging purpose) ?


Solution

  • Solution :

    I finally found a solution here : https://docs.oracle.com/middleware/1212/wls/WSRPC/jax-rpc-handlers.htm#WSRPC414 by using @HandlerChain(file = "jaxrpc-soap-handler-chain.xml", name="JaxRpcSOAPHandlerChain") with specific handler config file (with BEA namespaces instead of JEE namespaces) that references a class that implements javax.xml.rpc.handler.Handler

    jaxrpc-soap-handler-chain.xml :

    <?xml version="1.0" encoding="UTF-8" ?>
    <jwshc:handler-config xmlns:jwshc="http://www.bea.com/xml/ns/jws"
        xmlns:soap1="http://HandlerInfo.org/Server1" xmlns:soap2="http://HandlerInfo.org/Server2"
        xmlns="http://java.sun.com/xml/ns/j2ee">
        <jwshc:handler-chain>
            <jwshc:handler-chain-name>JaxRpcSOAPHandlerChain</jwshc:handler-chain-name>
            <jwshc:handler>
                <handler-name>JaxRpcSOAPLoggerHandler</handler-name>
                <handler-class>com.old.service.ws.handler.JaxRpcSOAPLoggerHandler</handler-class>
            </jwshc:handler>
        </jwshc:handler-chain>
    </jwshc:handler-config>