diff --git a/pom.xml b/pom.xml index a27dc6fab..049a0f1ba 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.xceptance xlt - 7.3.0 + 7.3.1 jar XLT @@ -462,6 +462,18 @@ me.tongfei progressbar 0.9.2 + + + + org.jline + jline + + + + + org.jline + jline + 3.23.0 diff --git a/resultbrowser/src/js/json-tree.js b/resultbrowser/src/js/json-tree.js index efb7735b4..c4376cde8 100644 --- a/resultbrowser/src/js/json-tree.js +++ b/resultbrowser/src/js/json-tree.js @@ -437,7 +437,9 @@ * @param {(string) => void} handler - consumes the JSON path of the target node */ onJsonNodeSelected(handler) { - attachEventHandlers(this.tree, (node) => handler(node.getJsonPath())); + if (this.tree) { + attachEventHandlers(this.tree, (node) => handler(node.getJsonPath())); + } } } diff --git a/src/main/java/com/xceptance/xlt/engine/socket/InstrumentedSocketImpl.java b/src/main/java/com/xceptance/xlt/engine/socket/InstrumentedSocketImpl.java index 5b8d5f4c8..b5660a4ff 100644 --- a/src/main/java/com/xceptance/xlt/engine/socket/InstrumentedSocketImpl.java +++ b/src/main/java/com/xceptance/xlt/engine/socket/InstrumentedSocketImpl.java @@ -181,6 +181,15 @@ class InstrumentedSocketImpl extends SocketImpl } } + /** + * Initializes this class for instrumentation. + */ + public static void initialize() + { + // Calling this method the first time implicitly triggers the static initializer block above to be executed + // once. Apart from that, there is nothing more to do here. + } + /** * The actual socket implementation. */ diff --git a/src/main/java/com/xceptance/xlt/engine/socket/InstrumentedSocketImplFactory.java b/src/main/java/com/xceptance/xlt/engine/socket/InstrumentedSocketImplFactory.java index 8396aec6a..729b95ca7 100644 --- a/src/main/java/com/xceptance/xlt/engine/socket/InstrumentedSocketImplFactory.java +++ b/src/main/java/com/xceptance/xlt/engine/socket/InstrumentedSocketImplFactory.java @@ -24,6 +24,15 @@ */ class InstrumentedSocketImplFactory implements SocketImplFactory { + /** + * Constructor. + */ + public InstrumentedSocketImplFactory() + { + // try to initialize and throw if initialization fails + InstrumentedSocketImpl.initialize(); + } + /** * {@inheritDoc} */ diff --git a/src/main/java/com/xceptance/xlt/engine/socket/XltSockets.java b/src/main/java/com/xceptance/xlt/engine/socket/XltSockets.java index c16c4aac6..1f1cfd23e 100644 --- a/src/main/java/com/xceptance/xlt/engine/socket/XltSockets.java +++ b/src/main/java/com/xceptance/xlt/engine/socket/XltSockets.java @@ -15,10 +15,15 @@ */ package com.xceptance.xlt.engine.socket; -import java.io.IOException; import java.net.Socket; import java.net.SocketImplFactory; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.xceptance.xlt.api.engine.Session; +import com.xceptance.xlt.api.util.XltException; import com.xceptance.xlt.api.util.XltProperties; import com.xceptance.xlt.common.XltConstants; @@ -35,6 +40,8 @@ */ public final class XltSockets { + private static final Logger LOG = LoggerFactory.getLogger(XltSockets.class); + private static final String PROP_COLLECT_NETWORK_DATA = XltConstants.XLT_PACKAGE_PATH + ".socket.collectNetworkData"; static @@ -46,9 +53,16 @@ public final class XltSockets // set the global socket impl factory Socket.setSocketImplFactory(new InstrumentedSocketImplFactory()); } - catch (final IOException ex) + catch (final Throwable ex) { - throw new RuntimeException("Failed to initialize XLT sockets", ex); + if (Session.getCurrent().isLoadTest()) + { + throw new XltException("Failed to initialize XLT sockets", ex); + } + else + { + LOG.warn("Failed to initialize XLT sockets: {}", ExceptionUtils.getRootCauseMessage(ex)); + } } } }