Skip to content

Commit

Permalink
Show application server customization in servlet log (#1474)
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanbrakel committed Feb 15, 2021
1 parent ac4902e commit fec21ea
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
5 changes: 2 additions & 3 deletions TESTING_WITH_IAF-TEST.md
Expand Up @@ -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.
Expand Down
@@ -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.
Expand Down Expand Up @@ -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);
}
}
Expand Down
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions core/src/main/resources/AppConstants.properties
Expand Up @@ -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
Expand Down

0 comments on commit fec21ea

Please sign in to comment.