diff -r cc682329886b -r b0610cd08440 src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java --- a/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java Thu Sep 26 10:43:28 2013 -0700 +++ b/src/share/jaxws_classes/com/sun/xml/internal/ws/transport/http/HttpAdapter.java Fri Oct 04 16:21:34 2013 +0100 @@ -89,6 +89,8 @@ */ public class HttpAdapter extends Adapter { + private static final Logger LOGGER = Logger.getLogger(HttpAdapter.class.getName()); + /** * {@link com.sun.xml.internal.ws.api.server.SDDocument}s keyed by the query string like "?abc". * Used for serving documents via HTTP GET. @@ -852,7 +854,14 @@ } } } - buf.writeTo(baos); + if (buf.size() > dump_threshold) { + byte[] b = buf.getRawData(); + baos.write(b, 0, dump_threshold); + pw.println(); + pw.println(WsservletMessages.MESSAGE_TOO_LONG(HttpAdapter.class.getName() + ".dumpTreshold")); + } else { + buf.writeTo(baos); + } pw.println("--------------------"); String msg = baos.toString(); @@ -946,6 +955,8 @@ */ public static volatile boolean dump = false; + public static volatile int dump_threshold = 4096; + public static volatile boolean publishStatusPage = true; public static synchronized void setPublishStatus(boolean publish) { @@ -954,19 +965,32 @@ static { try { - dump = Boolean.getBoolean(HttpAdapter.class.getName()+".dump"); - } catch( Throwable t ) { - // OK to ignore this + dump = Boolean.getBoolean(HttpAdapter.class.getName() + ".dump"); + } catch (SecurityException se) { + if (LOGGER.isLoggable(Level.CONFIG)) { + LOGGER.log(Level.CONFIG, "Cannot read ''{0}'' property, using defaults.", + new Object[] {HttpAdapter.class.getName() + ".dump"}); + } } try { - setPublishStatus(System.getProperty(HttpAdapter.class.getName()+".publishStatusPage").equals("true")); - } catch( Throwable t ) { - // OK to ignore this + 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"}); + } + } + try { + setPublishStatus(Boolean.getBoolean(HttpAdapter.class.getName() + ".publishStatusPage")); + } catch (SecurityException se) { + if (LOGGER.isLoggable(Level.CONFIG)) { + LOGGER.log(Level.CONFIG, "Cannot read ''{0}'' property, using defaults.", + new Object[] {HttpAdapter.class.getName() + ".publishStatusPage"}); + } } } public static void setDump(boolean dumpMessages) { HttpAdapter.dump = dumpMessages; } - private static final Logger LOGGER = Logger.getLogger(HttpAdapter.class.getName()); }