From fec21eab98ae83adc185d3a2edfa3fcabc290233 Mon Sep 17 00:00:00 2001 From: Gerrit van Brakel Date: Mon, 15 Feb 2021 15:15:22 +0100 Subject: [PATCH] Show application server customization in servlet log (#1474) --- TESTING_WITH_IAF-TEST.md | 5 ++--- .../lifecycle/IbisApplicationInitializer.java | 5 +++-- .../main/java/nl/nn/adapterframework/util/AppConstants.java | 1 + core/src/main/resources/AppConstants.properties | 2 ++ 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/TESTING_WITH_IAF-TEST.md b/TESTING_WITH_IAF-TEST.md index 61e71d12e30..23903295a3d 100644 --- a/TESTING_WITH_IAF-TEST.md +++ b/TESTING_WITH_IAF-TEST.md @@ -11,12 +11,11 @@ To prevent problems with data transactionality, we will be using an Oracle datab ## 1. Proprietary modules and JAR dependencies Download the following JAR files. We advice you to place them in the Servers\lib folder of your Eclipse workspace. If you don't have this folder, you can create it. -* [activemq-core-5.6.0.jar](https://mvnrepository.com/artifact/org.apache.activemq/activemq-core/5.6.0) +* [activemq-all-5.6.0.jar](https://mvnrepository.com/artifact/org.apache.activemq/activemq-core/5.6.0) * [geronimo-j2ee-management\_1.1_spec-1.0.1.jar](https://mvnrepository.com/artifact/org.apache.geronimo.specs/geronimo-j2ee-management_1.1_spec/1.0.1) * [geronimo-jms\_1.1_spec-1.1.1.jar](https://mvnrepository.com/artifact/org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1) * [geronimo-jta\_1.1_spec-1.1.1.jar](https://mvnrepository.com/artifact/org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1) -* [kahadb-5.6.0.jar](https://mvnrepository.com/artifact/org.apache.activemq/kahadb/5.6.0) -* [ojdbc7.jar](https://www.oracle.com/technetwork/database/features/jdbc/jdbc-drivers-12c-download-1958347.html) +* [ojdbc8.jar](https://www.oracle.com/database/technologies/appdev/jdbc-ucp-183-downloads.html) * [service-dispatcher-1.5.jar](https://mvnrepository.com/artifact/org.ibissource/service-dispatcher) In Tomcat's launch configuration (found in the Tomcat Overview window), go to the Classpath tab. Click on the User Entries item and click on the [ Add JARs... ] button. Select all JARs in the lib folder, press OK, and press OK again. diff --git a/core/src/main/java/nl/nn/adapterframework/lifecycle/IbisApplicationInitializer.java b/core/src/main/java/nl/nn/adapterframework/lifecycle/IbisApplicationInitializer.java index 820759018d3..3fe21553506 100644 --- a/core/src/main/java/nl/nn/adapterframework/lifecycle/IbisApplicationInitializer.java +++ b/core/src/main/java/nl/nn/adapterframework/lifecycle/IbisApplicationInitializer.java @@ -1,5 +1,5 @@ /* - Copyright 2019 Nationale-Nederlanden, 2020 WeAreFrank! + Copyright 2019 Nationale-Nederlanden, 2020, 2021 WeAreFrank! Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -118,11 +118,12 @@ private void determineApplicationServerType(ServletContext servletContext) { //has it explicitly been set? if not, set the property String serverType = System.getProperty(AppConstants.APPLICATION_SERVER_TYPE_PROPERTY); + String serverCustomization = System.getProperty(AppConstants.APPLICATION_SERVER_CUSTOMIZATION_PROPERTY,""); if (autoDeterminedApplicationServerType.equals(serverType)) { //and is it the same as the automatically detected version? servletContext.log("property ["+AppConstants.APPLICATION_SERVER_TYPE_PROPERTY+"] already has a default value ["+autoDeterminedApplicationServerType+"]"); } else if (StringUtils.isEmpty(serverType)) { //or has it not been set? - servletContext.log("determined ApplicationServer ["+autoDeterminedApplicationServerType+"]"); + servletContext.log("determined ApplicationServer ["+autoDeterminedApplicationServerType+"]"+(StringUtils.isNotEmpty(serverCustomization)? " customization ["+serverCustomization+"]":"")); System.setProperty(AppConstants.APPLICATION_SERVER_TYPE_PROPERTY, autoDeterminedApplicationServerType); } } diff --git a/core/src/main/java/nl/nn/adapterframework/util/AppConstants.java b/core/src/main/java/nl/nn/adapterframework/util/AppConstants.java index b19e0c9b61a..8946e0d820c 100644 --- a/core/src/main/java/nl/nn/adapterframework/util/AppConstants.java +++ b/core/src/main/java/nl/nn/adapterframework/util/AppConstants.java @@ -52,6 +52,7 @@ public final class AppConstants extends Properties implements Serializable { private final static String APP_CONSTANTS_PROPERTIES_FILE = "AppConstants.properties"; private final static String ADDITIONAL_PROPERTIES_FILE_KEY = "ADDITIONAL.PROPERTIES.FILE"; public static final String APPLICATION_SERVER_TYPE_PROPERTY = "application.server.type"; + public static final String APPLICATION_SERVER_CUSTOMIZATION_PROPERTY = "application.server.type.custom"; public final static String JDBC_PROPERTIES_KEY = "AppConstants.properties.jdbc"; private VariableExpander variableExpander; diff --git a/core/src/main/resources/AppConstants.properties b/core/src/main/resources/AppConstants.properties index 5bbbdc816fe..ce652189780 100644 --- a/core/src/main/resources/AppConstants.properties +++ b/core/src/main/resources/AppConstants.properties @@ -3,6 +3,8 @@ # Application Constants # +# use application.server.type to set the type of application server, if it is not properly autodetected +# set application.server.type.custom to e.g. 'ACTIVEMQ' or 'TIBCO', to enable additional features. SPRING.CONFIG.LOCATIONS=springIbisTestTool${ibistesttool.custom}.xml,spring${application.server.type}${application.server.type.custom}.xml,springCustom.xml # These files will be loaded in the specified order