4

I use JAX-WS RI for SOAP XML exchanging with another service. I am trying to see full error log of my soap xml sending, but can't do this because of truncating message:

    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)
    at org.apache.cxf.transpo

Message has been truncated

use com.sun.xml.ws.transport.http.HttpAdapter.dumpTreshold property to increase the amount of printed part of the message
--------------------

And I can't correct this using these settings:

System.setProperty("com.sun.xml.ws.transport.http.client.HttpTransportPipe.dump", "true");
        System.setProperty("com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.dump", "true");
        System.setProperty("com.sun.xml.ws.transport.http.HttpAdapter.dump", "true");
        System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dump", "true");
        System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dumpTreshold", "999999");

I mean dumpTreshold = 999999

Any help will be appreciated.

Leo
  • 1,029
  • 4
  • 19
  • 40
  • As a suggestion only, you may consider setting this property on server startup command line just to make sure it is considered. Some properties may only be read on startup. – dimplex Oct 26 '16 at 08:27
  • I use it on client, and it must apply the settings, but doesn't do it – Leo Oct 26 '16 at 12:57

3 Answers3

12

I've changed line

System.setProperty("com.sun.xml.internal.ws.transport.http.HttpAdapter.dumpTreshold", "999999");

with

System.setProperty("com.sun.xml.ws.transport.http.HttpAdapter.dumpTreshold", "999999");

and now I can see full log.

Leo
  • 1,029
  • 4
  • 19
  • 40
  • 2
    I always add both package names as a matter of course. Same goes for the other JAX-RS flags: https://stackoverflow.com/a/16338394/295797 – Roy Truelove May 02 '18 at 14:26
1

You can also set it in the environment.

For jetty I use:

export MAVEN_OPTS=" \
-Dcom.sun.xml.ws.transport.http.client.HttpTransportPipe.dump=true \
-Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dumpTreshold=999999 \ 
-Dcom.sun.xml.ws.transport.http.HttpAdapter.dumpTreshold=999999"
MrSmith42
  • 9,961
  • 6
  • 38
  • 49
0

HttpAdapter class has:

static {
    ...
    try {
        dump_threshold = Integer.getInteger(HttpAdapter.class.getName() + ".dumpTreshold", 4096);
    } catch (SecurityException se) {
        if (LOGGER.isLoggable(Level.CONFIG)) {
            LOGGER.log(Level.CONFIG, "Cannot read ''{0}'' property, using defaults.",
                    new Object[] {HttpAdapter.class.getName() + ".dumpTreshold"});
        }
    }
    ...

and:

 pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold"));

Set parameter name depending on location of HttpAdapter.class.

Or just set both variations (Sun internal RI WS is repackaged with adding intermediate package level .internal.):

java ... \
-Dcom.sun.xml.ws.transport.http.HttpAdapter.dumpTreshold=99999 \
-Dcom.sun.xml.internal.ws.transport.http.HttpAdapter.dumpTreshold=99999 \

Default is:

public static volatile int dump_threshold = 4096;
gavenkoa
  • 45,285
  • 19
  • 251
  • 303