Cannot create working datasource.

179 views
Skip to first unread message

Brian Parks

unread,
Feb 8, 2018, 9:51:32 AM2/8/18
to ColdBox Platform
Super ColdBox (latest version) newbie here. For the life of me, I can't get it to recognize my local SQL Server datasource. Here's what I have so far:

Coldbox.cfc

component {
function configure() {
        ......
viewCaching = false,

datasources = { alias1 = {name="rddata", username="xyz", password="pdq"} }
}

My handler file:
function index(event,rc,prc){
event.setView("main/index");
prc.data = getModel( "rd_mainDAO" ).getAll();

}

My DAO file:

component singleton accessors="true"{
property name="dsn1" inject="coldbox:datasource:alias1";

query function getAll(){
        var q = new Query(datasource="#dsn1.name#",sql="SELECT * FROM rddata");
        return q.execute().getResult();
    }
rd_mainDAO function init(){
return this;
}

}

And my result thus far:

Event: main.index
Routed URL: N/A
Layout: Main.cfm (Module: )
View: main/index
Timestamp: 02/08/2018 09:05:50 AM
Type: ColdBoxDSL.InvalidDSL
Messages: The DSL provided was not valid: {REF={null}, REQUIRED={true}, ARGNAME={}, DSL={coldbox:datasource:alias1}, JAVACAST={null}, NAME={dsn1}, TYPE={any}, VALUE={null}, SCOPE={variables}} alias1       


It's probably something obvious, but nothing is obvious for me yet...


Eric Peterson

unread,
Feb 8, 2018, 9:56:52 AM2/8/18
to col...@googlegroups.com
Is this ColdBox 5? The datasources dsl was removed, I believe. 

Cheers,
Eric
--
--
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
For News, visit http://blog.coldbox.org
For Documentation, visit http://wiki.coldbox.org
For Bug Reports, visit https://ortussolutions.atlassian.net/browse/COLDBOX
---
You received this message because you are subscribed to the Google Groups "ColdBox Platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+u...@googlegroups.com.
To post to this group, send email to col...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coldbox/0126d7cd-33dc-46d6-9c0e-2b0f81dbcdbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Brian Parks

unread,
Feb 8, 2018, 10:03:47 AM2/8/18
to ColdBox Platform
Yes, it's 5.0.0, but all that code was in the example documentation. So, how does one go about creating a datasource then?

Luis Majano

unread,
Feb 8, 2018, 10:16:24 AM2/8/18
to col...@googlegroups.com

Luis Majano
CEO
Ortus Solutions, Corp

From: col...@googlegroups.com <col...@googlegroups.com> on behalf of Brian Parks <skr...@gmail.com>
Sent: Thursday, February 8, 2018 9:03:47 AM
To: ColdBox Platform
Subject: Re: [coldbox:26791] Cannot create working datasource.
 

Brian Parks

unread,
Feb 8, 2018, 12:28:11 PM2/8/18
to ColdBox Platform
I did and that helped, though I shall not reveal the true issue so as not to embarrass myself. Thanks!

Chuck Ehenulo

unread,
Apr 3, 2018, 8:26:57 PM4/3/18
to ColdBox Platform
Hi Luis,

I am also getting the same issue as Brian.

Issue 1:

I have just today upgraded to ColdBox 5 from 4.30 and I am getting the same issue. I have also read the ColdBox 5 upgrade document as well and moved my datasources to settings in Coldbox.cfc.

The DSL provided was not valid: {REF={null}, REQUIRED={true}, ARGNAME={}, DSL={coldbox:settings:cwdatasource}, JAVACAST={null}, NAME={mydsn}, TYPE={any}, VALUE={null}, SCOPE={variables}}

I am injecting as follows: property name="dsn" inject="coldbox:configsettings:cwdatasource";.

Issue 2:

Yesterday I upgraded Lucee to 5.2.60 the latest version and then I started to get injection issues to which I then upgraded to ColdBox 5 to try and resolve the issue e.g.

Component [....] has no accessible Member with name [DSN].

I have cleared caches, restarted, etc. with no luck. I am also not sure if this is a Lucee issue or a ColdBox/WireBox issue or neither.

Any help would be great. 

Kind regards,
Chuck
Reply all
Reply to author
Forward
0 new messages