• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Explorer ,
Dec 06, 2022 Dec 06, 2022

Copy link to clipboard

Copied

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.

Views

561

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Dec 13, 2022 Dec 13, 2022

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? 

Votes

Translate

Translate
Adobe Employee ,
Dec 06, 2022 Dec 06, 2022

Copy link to clipboard

Copied

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-se...

 

Thanks

Ravi

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 06, 2022 Dec 06, 2022

Copy link to clipboard

Copied

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? 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 07, 2022 Dec 07, 2022

Copy link to clipboard

Copied

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?

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 12, 2022 Dec 12, 2022

Copy link to clipboard

Copied

@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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 13, 2022 Dec 13, 2022

Copy link to clipboard

Copied

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? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 27, 2022 Dec 27, 2022

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 27, 2022 Dec 27, 2022

Copy link to clipboard

Copied

@neowire ,

Thanks for sharing that.  It is indeed curious. 

 

Can you reproduce it? That is, does the situation recur when you enable sandbox security once agaiin?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 29, 2022 Dec 29, 2022

Copy link to clipboard

Copied

LATEST

Yes but I am working on a Production only environment so I cannot easily switch things around. I am currently working on standing up a brand new environment in Azure which is currently non Production so I will test there once ready. Could you possibly direct me to good documentation on how to structure the JDBC connection string? I've had issues with Sandbox Security before and it was something in the connection string. Not saying it's this issue, but something to evaluate. Additionally, this same occurrence has happened on all 4 installations of CF2021 that I have in my environment. So, as far as can it be reproduced, definitely... 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation