How to manually update the Java version on the Linux Content Gateway server

1. Stop Content Gateway service (using the command service content-gateway stop). Note the JVM version printed.

     [root@javacg unix]# service content-gateway stop
          Stopping content-gateway ...
          YAJSW: yajsw-stable-11.09
          OS   : Linux/2.6.32-642.el6.x86_64/amd64
          JVM  : Oracle Corporation/1.8.0_121//usr/java/jre1.8.0_121/64
          Jan 20, 2017 4:48:48 AM org.apache.commons.vfs2.VfsLog info
          INFO: Using "/tmp/vfs_cache" as temporary files store.
          Jan 20, 2017 4:48:49 AM org.rzo.yajsw.os.posix.PosixService init
          INFO: /etc/init.d/content-gateway already exists
          ************* STOPPING content-gateway ***********************
           
          Jan 20, 2017 4:48:49 AM org.rzo.yajsw.os.posix.PosixService getPid
          INFO: wrapper pid file: /opt/airwatch/content-gateway/wrapper.content-gateway.pid
          Jan 20, 2017 4:48:49 AM org.rzo.yajsw.os.posix.PosixService stopProcess
          INFO: stop daemon with pid 30394
          Jan 20, 2017 4:48:55 AM org.rzo.yajsw.os.posix.PosixService getAppPid
          INFO: app pid file: /opt/airwatch/content-gateway/wrapper.java.content-gateway.pid
          Jan 20, 2017 4:48:55 AM org.rzo.yajsw.os.posix.PosixService stopProcess
          INFO: stop daemon app with pid -1
          Jan 20, 2017 4:48:55 AM org.rzo.yajsw.os.posix.PosixService getPid
          INFO: wrapper pid file: /opt/airwatch/content-gateway/wrapper.content-gateway.pid
          Service content-gateway stopped

 

2. Install the new Java version.

3. Start the Content Gateway service (using the command service content-gateway start) and identify the JVM version. If the new JVM version is found, it is directly consumed by Content Gateway without any configuration changes in Content Gateway. If this is the case, stop the service and skip to step 8.

4. Ensure the Java version is updated and get the Java location using the which command.

     [root@javacg unix]# java -version
          java version "1.8.0_121"
          Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
          Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
 
     [root@javacg service]# which java
          /usr/bin/java
          
     [root@javacg service]# ls -l /usr/bin/java
          lrwxrwxrwx. 1 root root 22 Jan 20 04:23 /usr/bin/java -> /etc/alternatives/java
          
     [root@javacg service]# ls -l /etc/alternatives/java
          lrwxrwxrwx. 1 root root 31 Jan 20 04:23 /etc/alternatives/java -> /usr/java/jre1.8.0_121/bin/java

 

5. Update the file sh under /opt/airwatch/content-gateway/service/unix/ with the new Java location. Look for the line beginning with java_exe= and update the path with the new installation.

6. Update the conf file under /opt/airwatch/content-gateway/service/conf/ with the new Java location. Look for the line beginning with wrapper.java.command= and update the path with the new installation.

7. Run the following commands to reinstall the service:

     [root@javacg service]# /opt/airwatch/content-gateway/service/unix/uninstallContentGatewayService.sh
          java version "1.8.0_121"
          Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
          Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
          YAJSW: yajsw-stable-11.09
          OS   : Linux/2.6.32-642.el6.x86_64/amd64
          JVM  : Oracle Corporation/1.8.0_121//usr/java/jre1.8.0_121/64
          Jan 20, 2017 4:57:49 AM org.apache.commons.vfs2.VfsLog info
          INFO: Using "/tmp/vfs_cache" as temporary files store.
          Jan 20, 2017 4:57:49 AM org.rzo.yajsw.os.posix.PosixService init
          INFO: /etc/init.d/content-gateway already exists
          
          ************* REMOVING content-gateway ***********************
          Jan 20, 2017 4:57:50 AM org.rzo.yajsw.os.posix.PosixService stop
          INFO: Stopping content-gateway ...
          YAJSW: yajsw-stable-11.09
          OS   : Linux/2.6.32-642.el6.x86_64/amd64
          JVM  : Oracle Corporation/1.8.0_121//usr/java/jre1.8.0_121/64
          
          ************* STOPPING content-gateway ***********************
          Service content-gateway stopped
          
          Jan 20, 2017 4:57:50 AM org.rzo.yajsw.os.posix.PosixService getPid
          INFO: wrapper pid file: /opt/airwatch/content-gateway/wrapper.content-gateway.pid
          Jan 20, 2017 4:57:50 AM org.rzo.yajsw.os.posix.PosixService getPid
          INFO: wrapper pid file: /opt/airwatch/content-gateway/wrapper.content-gateway.pid
          Service content-gateway removed
          
[root@javacg service]# /opt/airwatch/content-gateway/service/unix/installContentGatewayService.sh java version "1.8.0_121" Java(TM) SE Runtime Environment (build 1.8.0_121-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode) YAJSW: yajsw-stable-11.09 OS : Linux/2.6.32-642.el6.x86_64/amd64 JVM : Oracle Corporation/1.8.0_121//usr/java/jre1.8.0_121/64 Jan 20, 2017 4:58:00 AM org.apache.commons.vfs2.VfsLog info INFO: Using "/tmp/vfs_cache" as temporary files store. ************* INSTALLING content-gateway *********************** Jan 20, 2017 4:58:00 AM org.rzo.yajsw.os.posix.PosixService getPid INFO: wrapper pid file: /opt/airwatch/content-gateway/wrapper.content-gateway.pid Jan 20, 2017 4:58:00 AM org.rzo.yajsw.os.posix.PosixService install WARNING: created daemon script: /etc/rc.d/init.d/content-gateway Jan 20, 2017 4:58:00 AM org.rzo.yajsw.os.posix.PosixService install INFO: created link : /etc/rc4.d/S2content-gateway Jan 20, 2017 4:58:00 AM org.rzo.yajsw.os.posix.PosixService install INFO: created link : /etc/rc3.d/S2content-gateway Jan 20, 2017 4:58:00 AM org.rzo.yajsw.os.posix.PosixService install INFO: created link : /etc/rc5.d/S2content-gateway Jan 20, 2017 4:58:00 AM org.rzo.yajsw.os.posix.PosixService install INFO: created link : /etc/rc2.d/S2content-gateway Jan 20, 2017 4:58:00 AM org.rzo.yajsw.os.posix.PosixService install INFO: created link : /etc/rc0.d/K2content-gateway Jan 20, 2017 4:58:00 AM org.rzo.yajsw.os.posix.PosixService install INFO: created link : /etc/rc1.d/K2content-gateway Jan 20, 2017 4:58:00 AM org.rzo.yajsw.os.posix.PosixService install INFO: created link : /etc/rc6.d/K2content-gateway Service content-gateway installed

 

8. Attempt to restart the Content Gateway service (with the command service content-gateway restart).  If the services starts successfully, skip the remaining steps.  If this does not start successfully, continue on step 9.

9. Some OpenJDK distributions come with an unlimited strength jurisdiction policy pre-installed. If the service failed to start in the previous step with the error java.security.InvalidKeyException: Illegal key size, the Java installation must be patched with the appropriate Java Cryptography Extension (JCE) policy files.  

10. Download the JCE policy files (typically in the format jce_policy-#.zip) according to the Java version. For Java 8, this file is available here.

11. The zip file contains the local_policy.jar and US_export_policy.jar which must be copied into the lib/security location under the Java installation (for the above example, the location is: /usr/java/jre1.8.0_121/lib/security/). Note: The default files that exist in the location should be overwritten.

12. Restart the content gateway service and test (using the command service content-gateway restart).

Have more questions? Submit a request

0 Comments

Article is closed for comments.