From 198792a7d9073575946de44c425ec3315c2a02db Mon Sep 17 00:00:00 2001
From: Simon Spinner <simon.spinner@uni-wuerzburg.de>
Date: Tue, 7 Jun 2016 13:55:31 +0200
Subject: [PATCH] Fix parsing of URL.

---
 .../interceptors/WebServiceOutgoingCallInterceptor.java       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools.descartes.prisma.agent.wildfly/src/main/java/tools/descartes/prisma/agent/wildfly/interceptors/WebServiceOutgoingCallInterceptor.java b/tools.descartes.prisma.agent.wildfly/src/main/java/tools/descartes/prisma/agent/wildfly/interceptors/WebServiceOutgoingCallInterceptor.java
index 8ac34e2..7bcc801 100644
--- a/tools.descartes.prisma.agent.wildfly/src/main/java/tools/descartes/prisma/agent/wildfly/interceptors/WebServiceOutgoingCallInterceptor.java
+++ b/tools.descartes.prisma.agent.wildfly/src/main/java/tools/descartes/prisma/agent/wildfly/interceptors/WebServiceOutgoingCallInterceptor.java
@@ -64,8 +64,8 @@ public class WebServiceOutgoingCallInterceptor extends GenericSOAPHandler {
 				String componentName = url.getPath().substring(1); // Remove first slash				
 				int idx = url.getPath().lastIndexOf("/");
 				if (idx > 0) {
-					application = componentName.substring(0, idx);
-					componentName = componentName.substring(idx + 1);
+					application = componentName.substring(0, idx - 1);
+					componentName = componentName.substring(idx);
 				}
 				ComponentRecord component = MonitoringService.INSTANCE.requireComponent(url.getHost(), application, "", componentName);
 				OperationRecord currentOperation = currentInvocation.requireEndpoint(component, caller.getDeclaringClass().getName(), "http", caller.getName());
-- 
GitLab