Installing and troubleshooting Java updates in ColdFusion

With the recent ColdFusion releases, we have come across many queries regarding Java updates. The table below shows the default Java shipped with the supported versions.

 ColdFusion Version  Base Installer  Refreshed Installer
 ColdFusion 2016  1.8.0_72   NA
 ColdFusion 11  1.7.0_55   1.8 _25
 ColdFusion 10  1.6.0_29  1.7.0_15

 

Now, let us look at the supported Java versions for ColdFusion 2016,11 & 10.

Java Version  ColdFusion 2016  ColdFusion 11  ColdFusion 10
Java 1.8  All the updates  Update 3 and above  Update 14 and Above
Java 1.7  Not Supported  Update 2 and earlier  Update 8 and Above
Java 1.6  Not Supported  Not Supported  Update 7 and earlier

 

Once the support for a major version of Java is added, it also covers all the minor/sub versions.

 

Upgrading to Java 1.8:

  1. Download the latest version of Java from http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html. Please make sure that you download 64-bit Java for 64-bit ColdFusion and 32-bit Java for 32 bit ColdFusion.
  2. Run the installer to install Java.
  3. Take a backup of jvm.config(located at <cf_install_root>cfusionbin)
  4. To change from ColdFusion’s default Java, modify the Java home url in either jvm.config or in ColdFusion administrator (Settings ->Java and JVM -> Java virtual machine path).
  5. Restart ColdFusion after making the changes.
  6. To verify the update, log in to ColdFusion Administrator and see verify the newer Java version .

If you are using Web Services, please do the following:

  1. Take a backup of tools.jar from {cf_install_home}/cfusion/lib/
  2. Copy tools.jar from {JDK8_Home}/lib to {cf_install_home}/cfusion/lib/
  3. Clear the stubs from {cf_install_home}/cfusion/stubs/ to get the newly compiled classes.

 

Note: Any SSL certificates added to the previous JDK will also need to be re-added to the new JDK (cacerts) file.

You can use Java keytool tool located in Javajre1.8.0_XXbin to import the certificate.  You can use the below command:

keytool -import -alias name -keystore Javajre1.8.0_XXlibsecuritycacerts -file mycert.cer

 

Java upgrade issues and troubleshooting

  1. If you are unable to start ColdFusion after the Java update:
  • Check the location of Java home in jvm.config.
  • The Java auto-update modifies the Java install directory location, which causes failure to ColdFusion start. Disable the java auto upgrade.
  • Try starting ColdFusion from command line to see specific errors. If the error is "Error loading: C:Program FilesJavajdk1.X.Xjrebinserverjvm.dll", then copy the msvcr100.dll file to <cf_install_root>/cfusion/bin from {JDK8_Home}/bin (for Windows OS).
  1. After importing certificates, if you have issues related to SSL, then you need to enable debugging for SSL. Take a backup of jvm.config at ColdFusioncfusionbin and add -Djavax.net.debug=all under the “Arguments to VM” in jvm.config. This would require a CF service restart. The argument would append the debugging info to the coldfusion-out.log at ColdFusioncfusionlogs.

 

How to debug server restart when ColdFusion services refuse to start normally

We have received few incidents wherein users were not able
to start ColdFusion services after server reboot or while restarting the
services manually.

Reason:

Applications dynamically generate ColdFusion files and
sometimes also deletes them, but ColdFusion does not remove any old files from
the cfclasses folder.

{cf.root}/cfusion/wwwroot/WEB-INF/cfclasses

If you have a huge number of websites on one ColdFusion
server, it creates thousands of cfclasses depending on number of incoming
requests.  

Solution:

Deleting all the class files of cfclasses folder and
restarting the ColdFusion server.

If you are unable to delete the files, rename cfclasses
folder and create an empty cfclasses in the same location.

To avoid such issues in future, you can manually delete
class files at regular time intervals.

 

If you do not wish to save the class files, you can disable
this feature in administrator from Server
Settings > Caching

 

 Save class files 
When you select this option, the class files
generated by ColdFusion are saved to disk for reuse after the server restarts.
Adobe recommends this for production systems. During development, Adobe
recommends that you do not select this option.