Java Server Configurations

Logi products work with a variety of Java-based web servers, which often require specific configurations to work correctly and for optimum performance.

IMPORTANT: Do not upgrade to JDK 8 release build 261 (1.8.0_261), or any later build of JDK 8. Doing so affects Logi Info and Logi Ad Hoc running the Java engine. If you perform this upgrade, your web server will stop responding indefinitely the first time it has to process a web request. This issue affects both Oracle JDK 8 and OpenJDK 8. This note will be updated when we have found a resolution.

This topic provides the details of these configurations for each server, including: 

 

About Java Server Configurations

Please note the following important information:

Oracle has changed its Java usage policies - see Java Usage Policy for important information.

  • The Oracle JDK or OpenJDK 7, 8, 11, 12, 13, or 14 is required for non-Apple platforms, or as noted in individual configuration sections below. JDK 7 is required for Apple platforms. The JRE is not sufficient.

  • It's possible to use Logi products on systems that use symbolic links or the Filesystem Hierarchy Standard (FHS), but it makes configuration much more complicated and we don't recommend it.
  • When Logi Studio creates a new application, it's deployed in exploded format within a single "Logi application folder", not as a WAR file. WAR deployments by Studio are not supported at this time.

JDK/OpenJDK 11 is supported starting with this version but its use requires these configuration steps:

  1. In JVM options, set --illegal-access=permit
  2. In the server's server.xml file, set relaxedQueryChars="[]"
  3. Copy <LogiAppFolder>/rdTemplate/Java11/jaxb-api-2.4.0-b180830.0359.jar to <LogiAppFolder>/WEB-INF/lib.

Setting Java Options

In general, the following JVM flags should be added to the Java options settings that are used to tune/monitor the JVM.

The Performance Settings are strongly recommended for the Oracle JDK, whereas the JConsole and Tracing Settings are optional but recommended, at least during initial implementation.
 

Typical Performance Settings

 -server (JDK)
 -Xmx4096m (JDK)
 -XX:MaxPermSize=256m (JDK)
 -XX:-DisableExplicitGC (JDK)
 -XX:CompileThreshold=8000 (JDK)
 -Djava.awt.headless=true (JDK)
 -Djava.net.preferIPv4Stack=true (needed if sending email and using Java 1.7+)
 -d64 (JDK - for 64-bit JVMs only)

 The Java heap space setting, -Xmx4096m, shown above and in individual sections below is sufficient for a minimal development system, not for a production system. A setting more appropriate for a 64-bit production server would be something like -Xmx8192m. Consult your production server administrator.

64-bit JVMs require the -d64 flag in the Performance Settings to force the JVM to use 64-bit addressing.
 

JConsole Settings (optional, for monitoring)

 -Dcom.sun.management.jmxremote
 -Djava.rmi.server.hostname=<your host ip addr>
 -Dcom.sun.management.jmxremote.port=1099
 -Dcom.sun.management.jmxremote.authenticate=false
 -Dcom.sun.management.jmxremote.ssl=false
 -Dnashorn.args="--no-deprecation-warning" (for JDK 11/12 only, to reduce console noise)

The JDK includes the Java Monitoring and Management Console (JConsole) tool. It uses the extensive instrumentation of the Java virtual machine to provide information on the performance and resource consumption of applications running on the Java platform using Java Management Extension (JMX) technology. For more information about JConsole, see this article.
 

Tracing Settings (optional, for testing)

 -verbose:gc
 -Xprof
 -XX:-CITime
 -XX:-PrintCompilation
 -Xloggc:$CATALINA_HOME/logs/gc.log
 -XX:+PrintGCDetails
 -XX:+PrintGCTimeStamps

The $CATALINA_HOME environment variable in the example refers to the folder into which Apache-Tomcat has been installed; for other web servers substitute the appropriate variable.
 

About the Performance Settings

What do the Performance Settings recommended above actually do? Here's an explanation:
 

Setting Description

-server

This option instructs the launcher to run the Java JVM in Server Mode. The JVM can optimize a number of things for server environments, improving performance.

-Xmx

This option sets the maximum amount of memory that can be allocated to the JVM heap, improving performance. Minimum requiredment is 4096 MB (4GB).

-XX:MaxPermSize

This option sets the maximum amount of memory that can be used for the permanent generation, or "PermGen", Java's fixed block of memory for loading class files. Failure to set this to at least 128m will cause errors to occur and a setting of 256m is recommended.

-XX:-DisableExplicitGC

This option disables calls to the function System.gc(), which is often run explicitly by many classes. When it runs, it triggers a full garbage collection process, which consumes a lot of execution time and results in inefficient heap usage. When it's disabled, the JVM still performs garbage collection nonetheless, whenever necessary.

-XX:CompileThreshold

This option sets the number of method invocations/branches before compiling. The JVM usually waits for a method to be executed a certain number of times before it's compiled. Not compiling every method helps startup time and reduces RAM footprint. This option allows you to control that threshold.

-Djava.awt.headless

This option, when set to true, prevents graphics rendering code from assuming that a graphics console exists, avoiding any chance of encountering an obscure Java bug related to X-servers and graphics rendering.

"Hot Deployment" Caution

Be aware that Tomcat, JBOSS, WebLogic, and other servers that offer "Hot" or "Auto" deployment may produce errors when using Logi Studio wizards. If this deployment feature is enabled, the changes the wizard makes may be deployed before the wizard completes all of its steps, causing an error.

Typically, "Hello World"-type Logi apps will work fine in this environment but use of Studio wizards to build more complex apps will not.

To avoid this problem, either disable the hot or auto deployment feature (technique varies by server) or increase the "scan interval" used by the feature substantially.

Apache-Tomcat 5.5 / 6 / 7 / 8/ 9

1. Logi application folders must be stored beneath the webapps folder.

2. Use the environment variable $CATALINA_OPTS to pass in the JVM flags described above to the Tomcat start-up script. The $CATALINA_HOME environment variable in the example refers to the folder into which Apache Tomcat has been installed.

Under Windows, when Tomcat is installed as an application, the JVM flags can be set by creating the file $CATALINA_HOME\bin\setenv.bat and placing a line of text similar to this in it:

set "CATALINA_OPTS = -server -d64 -Xmx4096m -XX:MaxPermSize=256m -XX:CompileThreshold=8000
-XX:-DisableExplicitGC -Djava.awt.headless=true"

The -d64 flag assumes 64-bit software and note that the double-quotes enclose everything except the set command word.

Under Windows, when Tomcat is installed as a service, the JVM flags can be set by using the administrative tool installed with Tomcat (version number varies): $CATALINA_HOME\bin\tomcat8w.exe:

In the administrative tool, select the Java tab and add the JVM flags to the Java Options, as shown above.
 

Queries That Use Square Brackets with Tomcat 8.5+

Tomcat 8.5+ will reject queries that include square brackets [ ] unless the following highlighted code is added to  $CATALINA_HOME\conf\server.xml:

<Connector port="8080" protocol="HTTP/1.1"
   connectionTimeout="20000"
   relaxedQueryChars="[]"
   redirectPort="8443" />

EC Crypto Issue with Tomcat 8.5 and JDK 1.8.0.181 for SQL Server 2008

If you're using Apache-Tomcat 8.5 and JDK 1.8.0.181 under Windows and attempting to connect to SQL Server 2008, you'll encounter a security error. To remedy this issue:

  1. Use File Explorer to find and edit C:\Program Files\Java\jre1.8.0_181\lib\security\java.security
  2. On or about line #650, look for this property:

    jdk.tls.disabledAlgorithms=SSLv3, RC4, DES, MD5withRSA, DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC
     
  3. Delete the value 3DES_EDE_CBC and the preceeding comma. Save the file.
Special Connection Pooling for Oracle in Connection-Intensive Environments

Logi applications may quickly open and close dozens of database connections and, in some connection-intensive environments, this may cause server resource problems. The following configuration changes for Tomcat implement connection pooling and have been tested with our Connection.JDBC and Connection.Oracle elements:

For server-wide connection pooling, change these files:

1. Add this to the file $CATALINA_HOME/conf/web.xml:

    <resource-ref>
          <description> DB Connection Pooling</description>
          <res-ref-name> jdbc/Oraclecp</res-ref-name>
          <res-type> javax.sql.DataSource</res-type>
          <res-auth> Container</res-auth>
    </resource-ref>

2. Create a new file $CATALINA_HOME/conf/context.xml, containing the following (note variation for Apache 8.0):


    <Context>
      <Resource name="jdbc/Oraclecp" auth="Container"
        type="javax.sql.DataSource" removeAbandoned="true"
        logAbandoned="false"
        maxActive="20" maxIdle="3" maxWait="10000"
        removeAbandonedTimeout="30"
        username= "<yourUsername>"
        password="<yourPassword>"
        factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"  (Apache 5.5 - 7.x)
        factory="org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory" (Apache 8.x)

        driverClassName="oracle.jdbc.OracleDriver"
        url="jdbc:oracle:thin:@<yourServerName>:1521/<yourSID>"/>
    </Context>

3. Copy the "ojdbc6.jar" file from <LogiAppFolder>/WEB-INF/lib to $CATALINA_HOME/common/lib

4. Manually edit your Connection element attributes in _Settings.lgx (using the Source tab in Studio's Workspace) to be:

    Connection String = jndi-datasource-name=jdbc/Oraclecp

These links provide additional information about connection pooling:

https://people.apache.org/~fhanik/jdbc-pool/jdbc-pool.html
https://tomcat.apache.org/tomcat-8.5-doc/jndi-datasource-examples-howto.html

JBoss 7.1

The following configuration details apply for JBoss 7. We do not recommend using JBoss 6.

1. Auto-deploy is used with this server so either manually or through Logi Studio's New Application wizard, give the root folder for your Logi application a .war file extension. Ensure that this folder is placed beneath whatever folder you've configured as your auto-deploy folder, for example: jboss/server/default/deploy/myLogiApp.war

See the Hello World! Tutorial for some examples of working with the New Application wizard.

2. Set the Java options by editing $JBOSS_HOME/bin/run.conf so that it includes:

    -Xmx4096m
    -XX:CompileThreshold=8000
    -Djava.awt.headless=true

3. Edit <LogiAppFolder>/WEB-INF/web.xml and add the following:

    <context-param>
        <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
        <param-value>true</param-value>
    </context-param>

4. If your JBoss server isn't capable of dynamic deployment, or you're not sure about the server settings, restart your JBoss server, using bin/standalone.sh.

5. Use a specific port and parameter when browsing the Logi applications. For example:

        http://localhost:port#/yourLogiApp/rdpage.aspx?rdReport=Default

    and be sure to use the correct case-sensitive spelling of the Logi report definition file name, e.g. Default vs default.

JBoss 5.1

The following configuration details apply for JBoss 5.1:

1. Auto-deploy is used with this server so either manually or through Logi Studio's New Application wizard, give the root folder for your Logi application a .war file extension. Ensure that this folder is placed beneath whatever folder you've configured as your auto-deploy folder, for example: jboss/server/default/deploy/myLogiApp.war

See the Hello World! Tutorial for some examples of working with the New Application wizard.

2. Set the Java options by editing $JBOSS_HOME/bin/run.confso that it includes:

    -Xmx4096m
    -XX:CompileThreshold=8000
    -Djava.awt.headless=true

3. Edit <LogiAppFolder>/WEB-INF/web.xml:

    Add the following:

    <context-param>
        <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
        <param-value>true</param-value>
    </context-param>

    Replace the following:

    <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee web-app_3_0.xsd" version="3.0" id="WebApp_ID">

    with:

    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"[]>
    <web-app id="WebApp_ID">

    Delete the following:

    <cookie-config>
        <http-only>true</http-only>
    </cookie-config>

4. Delete the following .jar files from the <LogiAppFolder>/WEB-INF/lib folder prior to deploying:

    xml-apis-1.3.04.jar
    xml-apis-ext-1.304.jar
    xercesImpl-2.7.1.jar
    xalan-2.7.1.jar

5. Download the following files and save them to <LogiAppFolder>/WEB-INF/lib:

JBoss 4

The following configuration details apply for JBoss 4:

1. Delete these files:
   <LogiAppFolder>/
WEB-INF/lib/log4j-1.2.8.jar
   <LogiAppFolder>/
WEB-INF/classes/log4j.properties

2. Auto-deploy is used with this server so either manually or through Logi Studio's New Application wizard, give the root folder for your Logi application a .war file extension. Ensure that this folder is placed beneath whatever folder you've configured as your auto-deploy folder, for example: jboss/server/default/deploy/myLogiApp.war

See the Hello World! Tutorial for some examples of working with the New Application wizard.

3. The startup batch file "run.bat" may include the following line: set JAVA_OPTS=%JAVA_OPTS% -Xms128m -Xmx512m. This must be prevented from overriding our required Java Options environment settings (see the General section, above). Users can either modify the batch file or the environment variable.

4. JBoss ships with a xerces library that conflicts with Logi's implementation of it, so remove the following .jar files from the <LogiAppFolder>/WEB-INF/libfolder prior to deploying:

    xml-apis-1.3.04.jar
    xml-apis-ext-1.304.jar
    xercesImpl-2.7.1.jar

Glassfish 4.1

1. Deploy your Logi application folder into glassfish4/glassfish/domains/domain1/autodeploy.

2. Use the Glassfish Admin Console at http://<yourServer>:4848/common/index.jsf to configure the Java options.

3. In addition to the recommended options listed in the Setting Java Options section earlier, set the -XX:MaxPermSize setting to a minimum of 300m.

4. Click this link glassfish-web.xml to open it in your browser. Right-click and select "View page source" (or similar) to see a plain text version of the code. Save this code as <LogiAppFolder>/WEB-INF/glassfish-web.xml.

4. Click this link faces-config.xml to open it in your browser. Right-click and select "View page source" (or similar) to see a plain text version of the code. Save this code as <LogiAppFolder>/WEB-INF/faces-config.xml.

5. You may see warnnig in the Glassfish log about JDBC4 drivers. If desired, these warning can be suppressed by moving the .jar files identified in the log entries to glassfish4/glassfish/domains/domain1/lib/ext.

Glassfish 3.0 / 3.1 / 4.0

1. (Glassfish 3.x only) Manually add a .war extension to the Logi application folder. Deploy your application manually using the Glassfish Admin Console.

2. In addition to the recommended options listed in the Setting Java Options section earlier, set the -XX:MaxPermSize setting to a minimum of 300m.

3. Click this link sun-web.xml to open it in your browser. Right-click and select "View page source" (or similar) to see a plain text version of the code. Save this code as <LogiAppFolder>/WEB-INF/sun-web.xml.

4. Click this link faces-config.xml to open it in your browser. Right-click and select "View page source" (or similar) to see a plain text version of the code. Save this code as <LogiAppFolder>/WEB-INF/faces-config.xml.

Glassfish 2.1

1. Manually add a .war extension to the Logi application folder. Deploy your application manually using the Glassfish Admin Console.

2. Click this link sun-web.xml to open it in your browser. Right-click and select "View page source" (or similar) to see a plain text version of the code. Save this code as <LogiAppFolder>/WEB-INF/sun-web.xml.

WebLogic 12c

1. Auto-deploy is used with this server. Logi application folders must be manually given a .war file extension.

2. The JVM settings described above can be changed by editing them in

    $WL_HOME/user_projects/domains/<Logi_Domain>/bin/setDomainEnv.sh      (Linux/UNIX)

    $WL_HOME/user_projects/domains/<Logi_Domain>/bin/setDomainEnv.cmd     (Windows)

3. Click this link weblogic.xml to open it in your browser. Right-click and select "View page source" (or similar) to see a plain text version of the code. Save this code as <LogiAppFolder>/WEB-INF/weblogic.xml.

4. If using requests that return a large amount of data, performance can be improved by configuring the "TCP Chunk" parameters. You must pass -D weblogic.Chunksize=65535 for Logi to work properly under Weblogic. See the following information: Tune the Chunk Parameters

WebLogic 10

1. Auto-deploy is used with this server. Logi application folders must be manually given a .war file extension.

2. The JVM settings described above can be changed by editing them in

    $WL_HOME/user_projects/domains/<Logi_Domain>/bin/setDomainEnv.sh      (Linux/UNIX)

    $WL_HOME/user_projects/domains/<Logi_Domain>/bin/setDomainEnv.cmd     (Windows)

3. WebLogic 10 - 10.2: Click this link weblogic10.xml to open it in you browser. WebLogic 10.3: Click this link weblogic103.xml to open it in your browser. Right-click and select "View page source" (or similar) to see a plain text version of the code. Save this code as <LogiAppFolder>/WEB-INF/weblogic.xml.

4. If using requests that return a large amount of data, performance can be improved by configuring the "TCP Chunk" parameters. You must pass -D weblogic.Chunksize=65535 for Logi to work properly under Weblogic. See the following information: Tune the Chunk Parameters

Websphere 7 / 8.5

For best performance, Websphere 8.5 users should ensure that they're using SDK 7. Information about the SDK can be found here and it can be downloaded using the from IBM Installation Manager from here.
 

WildFly 8 / 9 / 10

JBoss has been rebranded as WildFly. It requires JDK 1.8+ or OpenJDK 8+.

For Widfly 8 and 9, use Step 1 below to deploy and use JBoss 7: Steps 2-5 to configure.

The following configuration details apply for WildFly 10:

1. Auto-deploy is used with this server so either manually or through Logi Studio's New Application wizard, give the root folder for your Logi application a .war file extension. Ensure that this folder is placed in whatever folder you've configured as your auto-deploy folder, for example: wildfly-10.0.0.Final/standalone/deployments/myLogiApp.war. In addition, create an empty marker (text) file named myLogiApp.war.dodeploy in the same folder.

2. Set the Java options by editing $JBOSS_HOME/bin/run.conf so that it includes:

-Xmx4096m
-XX:CompileThreshold=8000
-Djava.awt.headless=true

    And run $JBOSS_HOME/bin/standalone.conf.bat.
     

3. Edit <LogiAppFolder>/WEB-INF/web.xml and add the following:

    <context-param>
        <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
        <param-value>true</param-value>
    </context-param>


4. Edit the deployment-scanner attribute in $JBOSS_HOME/standalone/configuration/standalone.xml to be:

    <deployment-scanner scan-interval="5000" relative-to="jboss.server.base.dir" path="deployments" auto-deploy-zipped="true" auto-deploy-exploded="false"/>


5. If your WildFly server isn't capable of dynamic deployment, or you're not sure about the server settings, restart your WildFly server, using bin/standalone.sh.

6. Use a specific port and parameter when browsing the Logi applications. For example:

        http://localhost:port#/yourLogiApp/rdpage.aspx?rdReport=Default

    and be sure to use the correct case-sensitive spelling of the Logi report definition file name, e.g. Default vs default.