Datasource doesn't exist

Hello,

My config :
Lucee 5.2.7.63
Windows Server 2016 (10.0) 64bit

In the server admin panel the check of my datasource is valid.

In my cfm file :

<cfquery  datasource="myDsn"  name="data">
SELECT *  FROM myTable
</cfquery>

When page is loaded, message returned is :

Message	datasource [myDsn] doesn't exist
Detail	available datasource names are []

Any idea ?

Thanks

Marc

Sounds odd. You know you can also define the datasource in the Application.cfc so you could check that it’s the right server etc?

A quick way to do this is to select the datasource in the Lucee admin and look for the code at the bottom.

@markdrew
The values (server etc…) in both admin panels are correct, when i check them its ok.

Regards,

Marc

Ok. Are you suing the web or server (copy the path here if you don’t know)

Also is the domain of the site you are running the code the same as the admin you set it up in?

yes domains are the same, its the enreprise intranet.

By the way, i found something, i created an Application.cfc and i added these lines :

component {
	this.datasources["myDSN"] = {
		  class: 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
		, connectionString: 'jdbc:sqlserver://myDBServer;DATABASENAME=theDB;sendStringParametersAsUnicode=true;SelectMethod=direct'
		, username: 'theUser'
		, password: "encrypted:a09693152926d5879f0cb2ed70c06b85d78e93c268b8c09c3b9442917ffdab6f"
	};
} 

This is working, but i don’t understand why the other way won’t work …

No, that’s not what I meant.

If you go to the admin at: http://domain1/lucee/admin/web.cfm it is different to accessing your site at http://domain2/

So if you can post the actual URLs (obfuscating judiciously of course) that would help.

Lucee works differently with regards to Web Admin vs the Server Admin configuration. You can set settings for the whole server in the Server Admin, with the url: http://domain1/lucee/admin/server.cfm

@markdrew

I’m connected to the server with remote desktop.
The url for the server panel is : http://127.0.0.1:8081/lucee/admin/server.cfm
and for the web panel : http://127.0.0.1:8081/lucee/admin/web.cfm

Edit:
When i connected to http://myServer/lucee/admin/web.cfm the password is not valid …

Edit2 :
Password was wrong, i have to type the active directory password, my bad :slight_smile:

what i have done is :

http://domain1/lucee/admin/web.cfm -> adding my datasources
And everything is working correctly.

http://127.0.0.1:8081/lucee/admin/web.cfm -> I have deleted all my datasources

if i’ve understood, there is one context with every site ?

There is one context per domain usually.