Skip to main content
Participant
April 30, 2023
Answered

Coldfusion 2021 update JVM

  • April 30, 2023
  • 1 reply
  • 492 views

Recently I tried to upgrade colfusion 2021's JVM to newest version from 11.0.1 to 11.0.19. By doing that I get db connection error now. I am using aws Aurora db service. Any pointers please? Thanks

exact error is :

com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

if I point back to old JVM i.e. is 11.0.1 all works fine

    This topic has been closed for replies.
    Correct answer BKBK

     What is the version of your MySQL Connector/J driver? Let's begin by ruling this out. Is it a recent version?

     

    Assuming the driver is a recent one, then the cause of the problem might indeed be Java-related. Here then are some suggestions, in order of importance:

    1.  As from Java 11.0.11, TLS 1.0 and TLS 1.1 are disabled by default. So, add the following flags to JVM arguments:
      -Djdk.tls.client.protocols=TLSv1.3,TLSv1.2 
      -Dhttps.protocols=TLSv1.3,TLSv1.2 ​

      After that, open the ColdFusion Administrator, and go to the datasources page. For each MySQL datasource, click the edit-button. Then click on Show Advanced Settings. In the Connection String input field, enter 

      enabledTLSProtocols=TLSv1.2

      and press the Submit button. Restart ColdFusion and see if that helps. 

    2. Compare in a text editor the contents of \cfusion\bin\jvm.config and \cfusion\bin\jvm.bak. If there is a difference, please share it with the forum. It could be a clue. 
    3.  Open \cfusion\runtime\conf\server.xml in a text editor. Does any of the elements have an attribute of the form address="::1"? If so, delete the address attribute, restart ColdFusion and see if that helps.

    4. Add 

    -Djava.net.preferIPv4Stack=true

    to the JVM arguments, restart ColdFusion and see if it helps.

     

    I hope one or more of the above helps. If not, try some of the suggestions in this Stackoverflow page.

    1 reply

    BKBK
    Community Expert
    BKBKCommunity ExpertCorrect answer
    Community Expert
    April 30, 2023

     What is the version of your MySQL Connector/J driver? Let's begin by ruling this out. Is it a recent version?

     

    Assuming the driver is a recent one, then the cause of the problem might indeed be Java-related. Here then are some suggestions, in order of importance:

    1.  As from Java 11.0.11, TLS 1.0 and TLS 1.1 are disabled by default. So, add the following flags to JVM arguments:
      -Djdk.tls.client.protocols=TLSv1.3,TLSv1.2 
      -Dhttps.protocols=TLSv1.3,TLSv1.2 ​

      After that, open the ColdFusion Administrator, and go to the datasources page. For each MySQL datasource, click the edit-button. Then click on Show Advanced Settings. In the Connection String input field, enter 

      enabledTLSProtocols=TLSv1.2

      and press the Submit button. Restart ColdFusion and see if that helps. 

    2. Compare in a text editor the contents of \cfusion\bin\jvm.config and \cfusion\bin\jvm.bak. If there is a difference, please share it with the forum. It could be a clue. 
    3.  Open \cfusion\runtime\conf\server.xml in a text editor. Does any of the elements have an attribute of the form address="::1"? If so, delete the address attribute, restart ColdFusion and see if that helps.

    4. Add 

    -Djava.net.preferIPv4Stack=true

    to the JVM arguments, restart ColdFusion and see if it helps.

     

    I hope one or more of the above helps. If not, try some of the suggestions in this Stackoverflow page.

    BKBK
    Community Expert
    Community Expert
    May 8, 2023

    Hi @harpreets72075604 , Please share the steps you took to solve the problem. That will help someone else in future.