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

CF 2025 Error message: 'sqlserver package is not installed' (but it is installed)

New Here ,
Jun 27, 2025 Jun 27, 2025

Hello - Developer edition of CF 2025 running locally on a Mac (OS = Sequoia 15.5). DMG installer. A CFQuery to an MS SQL Server datasource produces this error message: 'Error Executing Database Query. The sqlserver package is not installed. You can install the package through the CLI package manager (/Applications/ColdFusion2025/cfusion/bin/cfpm.sh) by running the command : install sqlserver.'

The Packages section of the CF Administrator shows that the sqlserver package already is installed. Same if I attempt an install via the CLI package manager. I've also uninstalled and re-installed the package. Any thoughts?

(The query runs without error on CF 2016 or 2018. The datasource verifies in the Administrator (i.e., the 'OK' message.)


5.4K
Translate
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 ,
Jul 03, 2025 Jul 03, 2025

Thanks for the printscreens. In the "Server" field, enter the IP address of the machine on which Microsoft SQL Server is running.  In the "Port" field, enter the port number for Microsoft SQL Server, usually, 1433.

Translate
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
New Here ,
Jul 03, 2025 Jul 03, 2025

Entering port 1433 produces this error on verification: Connection verification failed for data source: Abstract
java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]Conflicting connection information. When the instance name is specified, it is invalid to specify the port number.

I then left the port box blank and changed the server address to 10.35.0.84\content ('content' is the name of the SQL server instance; we have 5+ MS SQL Servers on that VM). Same sqlserver package is not installed error as before.

Translate
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 ,
Jul 04, 2025 Jul 04, 2025
quote

Entering port 1433 produces this error on verification: Connection verification failed for data source: Abstract
java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]Conflicting connection information. When the instance name is specified, it is invalid to specify the port number.


By @tom_4655


That calls for a new suggestion:

  1.  In the "Server" field, enter the IP address of the machine on which Microsoft SQL Server is running.  
  2.  In the "Port" field, enter the port number for Microsoft SQL Server, usually, 1433.
  3.  Click on "Show Advanced Settings" and add allowPortWithNamedInstance=true to the "Connection String" field.
  4.  Press the "Submit" button.
Translate
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 ,
Jul 03, 2025 Jul 03, 2025

Before you go, Tom, can you please consider and offer responses for what I'd proposed yesterday before bkbk's note you're replying to here? I realize things can get lost in the threading ui here. But I hope what I'd offer might get you close to resolution. It would be simple to assess/offer what I'd requested. 


/Charlie (troubleshooter, carehart. org)
Translate
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
New Here ,
Jul 03, 2025 Jul 03, 2025

Charlie - IMGs attached, one for the index.cfm in the wwwroot dir., and one for the index.cfm in the wwwroot/vhosts/newsletters dir. 

Translate
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 ,
Jul 03, 2025 Jul 03, 2025

Well, first they're clearly not the same file. That wasn't clear from your earlier messages. 

 

And since they're different files (in clearly very different folders), they likely have very different application.cfc/cfm files controlling them. That could certainly be where there's an issue leading to your different behavior.

 

More important, I'd asked you to show the results of getapplicationmetadata, which could really show key differences. 


/Charlie (troubleshooter, carehart. org)
Translate
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
New Here ,
Jul 03, 2025 Jul 03, 2025
No application.cfc or .cfm files are present in any of the directories, so the dump would presumably be an empty structure, no? I was trying to keep things very simple at this point.

I don’t know if this would have any effect here, but I whether running this on an external web server, say Apache, would make any difference here. Not using the Tomcat server and the server.xml file, in other words, to configure the virtual hosts.

I’m sorry but I have to go, I’m already late. Will have to pick this up next week.
Translate
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 ,
Jul 03, 2025 Jul 03, 2025

Tom when you do pick it up, please don't try to ponder whether there's any or a different application file. Please just take a minute to dump the output of that getapplicationmetadata function, in each page. Then focus especially on differences in any data sources that may show being defined there. I get it, there may be none. Let's please prove it. Sometimes the simplest answer to a problem is the right one, and presumption about a seeming bug can lead to mistaken efforts. Or it can better point to a bug, by what the process rules out.

 

Enjoy the break. 


/Charlie (troubleshooter, carehart. org)
Translate
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
New Here ,
Jul 08, 2025 Jul 08, 2025

Apologies for the confusion, Charlie. That's on me. Please find attached the getApplicationMetadata() dumps for each of the index.cfm files, along with GetBaseTemplatePath() and GetCurrentTemplatePath() output. 

 

These are the two virtual host document roots that I have configured:
/wwwroot/vhosts/newsletters/ (http://local.production.content.somevirtualhostdomain.com:8502/index.cfm)
/wwwroot/vhosts/webhost/ (http://local.news.content.somevirtualhostdomain.com:8502/index.cfm)

 

No application.cfm or .cfc files are present anywhere in the path, from wwwroot on down.

 

For the purposes of my SQL Server connection issue, queries from the cfusion/wwwroot/ directory all work as expected, both MS SQL and MySQL. The problem only exists when I'm using virtual host addressing. I'm using the built-in Tomcat server. Alternatively running an external Apache server is an option, should that be the better route here.

Translate
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 ,
Jul 09, 2025 Jul 09, 2025

The fact that the MySQL query works for the virtual host might be a clue. It makes me wonder: what if a virtual host runs in a context that is different from that of wwwroot?

 

Of late, ColdFusion warned you during installation to download and import the MySQL JDBC Jar file into the /lib directory. That implies that the MySQL driver will be globally available. That is, wwwroot, as well as any virtual host, will be able to access it.

 

For Microsoft SQL Server, there is just the built-in driver macromedia.jdbc.MacromediaDriver. What if this driver can be accessed by the wwwroot context, but not by a virtual host? One way to test this would be to download and import a Microsoft SQL Server JDBC Jar file into the /lib directory.

 

The steps follow:

  1.  Download Microsoft JDBC Driver for SQL Server. It is a ZIP file.
  2.  Unpack the ZIP, and locate the 'jars' folder. 
  3.  From the 'jars' folder, copy the file mssql-jdbc-12.10.1.jre11.jar into your ColdFusion installation's /lib directory.
  4.  Restart ColdFusion.
  5.  Go to the Data Services page in the Administrator and create a new MS SQL Server datasource to test with:
        Give it the name testMSSQLDSN and select Other as the driver type;
        Then fill in the details for the datasource, for example
    JDBC URL => jdbc:sqlserver://yourDBServerName\yourInstanceName;DatabaseName=yourDatabaseName
    (Alternatively, JDBC URL => jdbc:sqlserver://yourDBServerName:1433;DatabaseName=yourDatabaseName)
    
    Driver Class => com.microsoft.sqlserver.jdbc.SQLServerDriver
    
    Driver Name (optional, so your choice) =>MSSQLServer
    
    User name => ???	
    
    Password => ???

Translate
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
New Here ,
Jul 09, 2025 Jul 09, 2025

Thanks, BKBK. I successfully added the JDBC SQL Server datasource, appending encrypt=true;trustServerCertificate=true to the jdbc URL to get past our cert requirement. It validated OK in the CF Administrator. So all good there.

 

When I hit one of my virtual host index.cfm pages -- which now includes an MS SQL query using the testMSSQLDSN JDBC datasource -- I now get a Datasource testMSSQLDSN could not be found error. So, seems like it might not be a driver issue, but something related to the fact that it's a virtual host?

One more bit of grist for the mill: a colleague has created an identical setup on his Windows computer -- virtual hosts, datasources, etc. -- and gets the same errors (sqlserver package is not installed, etc.).

Translate
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 ,
Jul 09, 2025 Jul 09, 2025

Based on your last couple of messages (to me and to BKBK), I have a couple more diagnsostics for you to consider.

 

First, OK on your earlier confirmation that the getapplicationmetadata() returns an empty string in both examples. That confirms what you'd been asserting, that there was no application.cfm or cfc involved--still, it was worth confirming as there could have been one in a parent directory (all the way up to the server root, as CF is configured by default).

 

Moving on, let's now have you add a cfdump of the server scope, and run that within in each of the index.cfm templates. 

<cfdump var="#server#">

Let us know if you see any difference in ANY of the properties shown in the two displayes (open each in their own tab and click back and forth to quickly assess things, as at least one approach).

 

Second, especially since you say you are not seeing a DSN that you feel should exist, let's see a dump of this java object:

<cfdump var="#createobject("java", "coldfusion.server.ServiceFactory").getDatasourceService().getnames()#">
It's an undocumented internal CF java object, which you may find doesn't work if your CF instance is set to disable use of those (on the first page of the CF Admin).  And if it works but the names shown are surprising to you, use this variant to see ALL the properties for EACH datasource (note that I've dropped the getnames, which caused the above to show ONLY the DSN names):
<cfdump var="#createobject("java", "coldfusion.server.ServiceFactory").getDatasourceService()#">
It will be very interesting to hear what you discover.
 
BTW, it certainly should be that different virtual hosts on a single CF instance should all have access to the same DSNs and indeed should show the same values for all or most of the server scope above. As it seems you're seeing something different, then if you don't readily find the explanation based on the above, I'd propose the next thing is to show us the lines you changed in your server.xml or context.xml files (in the cfusion/runtime/conf), which is where I assume you're setting up these virtual hosts (without Apache, as you noted).

/Charlie (troubleshooter, carehart. org)
Translate
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
New Here ,
Jul 10, 2025 Jul 10, 2025

Interesting for sure. I've attached screen caps of the dumps for each of the virtual host index.cfm pages. Each is a separate file, so you may side-by-side 'em if convenient. The server scope and server.serviceFactory dumps were identical. One thing I did notice is that the server.serviceFactory dumps did not display any of my datasources (Abstract, infoinc, testMSSQLDSN), only the default ones. I've included a screen cap of our datasources. 

Translate
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
New Here ,
Jul 10, 2025 Jul 10, 2025

Quick note: my three datasources do appear in the server.serviceFactory dumps. My mistake.

Translate
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 ,
Jul 09, 2025 Jul 09, 2025
quote

When I hit one of my virtual host index.cfm pages -- which now includes an MS SQL query using the testMSSQLDSN JDBC datasource -- I now get a Datasource testMSSQLDSN could not be found error. So, seems like it might not be a driver issue, but something related to the fact that it's a virtual host?


By @tom_4655

 

The tests do indeed suggest it might not be a driver issue, but something related to the fact that it's a virtual host. Therefore, extend the test as follows:

 

(1)  Use the DSN explicitly in your query:

<cfquery name="qTest" datasource="testMSSQLDSN">
SELECT * FROM yourTable
</cfquery>

What is the outcome?

 

If necessary, there is a further test available:

 

(2) Add the line <cfset this.datasource = "testMSSQLDSN"> to the Application.cfc and save the file in the same directory as index.cfm

<!--- Application.cfc --->
<cfcomponent>
<cfset this.name = "ApplicationName">
<cfset this.datasource = "testMSSQLDSN">
<cfset this.sessionManagement = true>

<cffunction name="onApplicationStart" returntype="boolean" output="false">
<cfreturn true>
</cffunction>
</cfcomponent>



In all of the above suggestions, I am assuming that you're using only one ColdFusion instance, the default (cfusion) instance.

Translate
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 ,
Jul 09, 2025 Jul 09, 2025

Some general information to avoid confusion: I had not refreshed the page, hence had not seen Charlie's latest post, before submitting my last post.

Translate
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
New Here ,
Jul 10, 2025 Jul 10, 2025

Correct, one CF instance, named ColdFusion2025, port 8502. The computer also has a CF2016 instance, port 8500. That one runs fine, can run queries on both MS SQL and MySQL datasources via virtual hosts.

Translate
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
New Here ,
Jul 10, 2025 Jul 10, 2025

One other note: We had already explicitly specified the DSN in our query. Same Datasource testMSSQLDSN could not be found error. 

Translate
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
New Here ,
Jul 10, 2025 Jul 10, 2025

BKBK - I added the application.cfc to the virtual host document root directories, with the same result, the Datasource testMSSQLDSN could not be found error

Translate
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
New Here ,
Jul 10, 2025 Jul 10, 2025

Dump for the 'newsletters' virtual host index.cfm page attached (includes the application metadata scope). 

Translate
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 ,
Jul 10, 2025 Jul 10, 2025

Thanks for the updates, @tom_4655 . Let us continue investigating.

Translate
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 ,
Jul 10, 2025 Jul 10, 2025

Did you notice that this last dump showed the call to the service factory did NOT show the the

DSN in question?

 

To be clear, your earlier note said (but did not SHOW) that "my three datasources do appear in the server.serviceFactory dumps."

 

So what's the situation? It sure seems clear that the fan is simply NOT there. Yet your screenshot of the admin showed it us. 

 

How about you STOP the instance you think you're working against, and THEN run your tests (and look at the admin). If it's responsive that's clearly NOT the instance running things. 


/Charlie (troubleshooter, carehart. org)
Translate
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
New Here ,
Jul 11, 2025 Jul 11, 2025
LATEST

I did notice that the call to the service factory did NOT show the DSN in question. Apologies for the confusion. I'm getting a bit thread-happy, I think, as I'm sure are you and BKBK. 

That said, I believe I have some progress to report:

I spent some time this morning looking for any evidence of past CF installations other than my 2016 one, which has always worked as expected with Tomcat-based virtual host pages. 

  • I found a CF2021 instance from a few years back that I could never get to successfully run MS SQL queries on and was abandoned. That was buried in my trash folder (recycle bin for Win folk). That directory has been deleted. That instance had not been set to init on system startup and was not running during our CF2025 investigations.
  • My CF 2025 instance, the one we've been investigating, had been set to init on system startup. I stopped that via the cfusion/bin/cf-init-run.sh script (sudo sh cf-init-run.sh uninstall), emptied the trash/recyling, did a system shut-down (not just restart), then rebooted. 

On returning to one of my virtual host index.cfm pages, the JDBC-based MS SQL query (datasource = testMSSQLDSN) now works. So, big success there.

The built-in MS SQL driver datasource still produces the The sqlserver package is not installed error when hitting a virtual host page. That behavior is present on both MacOS and Win platforms when hitting virtual-host-based pages via the built-in Tomcat webserver. On Win instances using IIS as the webserver, the native MS SQL driver works as expected when hitting virtual-host pages. Presumably the same would be true running Apache, etc. I'm guessing that that's because the virtual host config is done within those servers rather than via Tomcat (cfusion/runtime/conf/server.xml)?

One note: Now when I manually fire up the CF2025 instance (cfusion/bin/ -> sh cfstart.sh) I see a number of warning messages, mainly about scanning JAR files for TLDs,

Unable to lock bundle cache: java.nio.channels.OverlappingFileLockException, etc. The CF2025 server successfully starts nonetheless and appears to function as expected, including with virtual hosts. 

Translate
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 ,
Jun 30, 2025 Jun 30, 2025

[removed] 

Translate
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