Skip to main content
Inspiring
December 6, 2022
Answered

CF2021 - Could not initialize class com.microsoft.sqlserver.jdbc.DriverJDBCVsrsion

  • December 6, 2022
  • 1 reply
  • 1155 views

Good afternoon,

In an attempt to finally upgrade my environment from CF2016 to CF2021, one of my servers is experiencing an issue with losing connectivity to the data sources. Upon reviewing the coldfusion-error.log I find the following error on each of the data sources: "java.lang.NoClassDefFoundError: Could not initialize class com.microsoft.sqlserver.jdbc.DriverJDBCVersion.".

The required files are installed to cfusion>lib: mssql-jdbc_auth-11.2.0.x64.dll and mssql-jdbc-11.2.0.jre11.jar.

I was able to correct the issue by shutting down ColdFusion services and clearing out the contents of the cfusion>wwwroot>WEB-INF>cfclasses and restarting ColdFusion but this is not a viable solution for a Production system.

Any idea what might be going on? I am on the latest update of CF2021.

    This topic has been closed for replies.
    Correct answer neowire

    @BKBK 

    Yes. The SQL Server package is installed. We can revert to using the standard SQL drivers to see if that works as it should. When under CF11/2016 the CF application developers wanted to use the Microsoft connector due to some stability issues they were encountering at the time. 

     

    As for the dll, if it's not necessary for the install of the driver then I suppose it can go away. The developers of the CF applications I host in Production provided the combination of files years back and we've been carrying it forward since.


    The latest on this, having Sandbox Security enabled disabled my data sources. Disabling sandbox security got the data sources working again. Curious though. In the configuration of Sandbox Security, nothing was denied. It was all open. How to resolve? Any suggestions? 

    1 reply

    RaviShankar Chagnur
    Adobe Employee
    Adobe Employee
    December 6, 2022

    In order to use JDBC you need to download latest JDBC jar file for MSSQL, copy it to cfusion/lib directory,refer to below document for more information

    https://www.hass.de/content/coldfusion-10-how-configure-data-sources-microsoft-jdbc-driver-40-sql-server

     

    Thanks

    Ravi

    neowireAuthor
    Inspiring
    December 6, 2022

    Ravi,

    I've already installed the latest JDBC drivers and have installed them per the guidelines here. Everything works but something is off, and after restart or something else going on on the server, I've had to perform the actions described in the initial post to get everything working again. Any other input? 

     

    BKBK
    Community Expert
    Community Expert
    December 7, 2022

    Hi @neowire ,

    Sorry to say, whichever way you look at it, you will have to restart ColdFusion to fix the error. Something might be dynamically affecting the classpath. The NoClassDefFoundError suggests that the class DriverJDBCVersion was there during compile-time, but ColdFusion was unable to find it during runtime. 

     

    I have some questions:

    • Is ColdFusion's SQL Server package installed? 
    • What's the purpose of the DLL? Is it necessary?