Coldbox 5 Datasource Settings

343 views
Skip to first unread message

Mike

unread,
May 30, 2018, 12:40:22 PM5/30/18
to ColdBox Platform
Coldbox version is  5.0.0+633

Cannot for the life of me get Coldbox to recognize my datasource settings.  Here's what I have in my config/Coldbox.cfc file:

// custom settings
settings = {
mainDataSource = {
        type = "SQL",
        name = "myDataSourceNameAsDefinedInCFAdmin"
    }
};

And here's how I'm injecting in my DAO:
property name='dsn' inject='coldbox:settings:mainDataSource';

I continually get the below error:
Messages: The DSL provided was not valid: {JAVACAST={null},REF={null},SCOPE={variables},REQUIRED={true},VALUE={null},DSL={coldbox:settings:mainDataSource},TYPE={any},ARGNAME={},NAME={dsn}}

I've seen some other's having issues.  What to do?

Luis Majano

unread,
May 30, 2018, 1:00:41 PM5/30/18
to col...@googlegroups.com
It’s coldbox:setting not settings

Luis Majano
CEO
Ortus Solutions, Corp

From: col...@googlegroups.com <col...@googlegroups.com> on behalf of Mike <letsonm...@gmail.com>
Sent: Wednesday, May 30, 2018 6:40:22 PM
To: ColdBox Platform
Subject: [coldbox:26953] Coldbox 5 Datasource Settings
 
--
--
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/32e97b26-3519-4bb3-9242-3449b79b851b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike

unread,
May 30, 2018, 1:48:48 PM5/30/18
to col...@googlegroups.com
Indeed.  Thank you!

To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+unsubscribe@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/32e97b26-3519-4bb3-9242-3449b79b851b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
--
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 a topic in the Google Groups "ColdBox Platform" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/coldbox/BYmk3rcRr4g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to coldbox+unsubscribe@googlegroups.com.

To post to this group, send email to col...@googlegroups.com.

adk

unread,
May 30, 2018, 3:45:00 PM5/30/18
to ColdBox Platform
Yes, I was stung by this yesterday too... the docs say "settings". I also was stung by having to use the @ModuleName when injecting datasources as well. While I was used to this DSL for a module's models, etc. - datasources hadn't needed this when they had their own setting... now they do.

Anyways - just offering that up for anybody else who may get stuck and not realize it.

Luis Majano

unread,
May 30, 2018, 3:59:28 PM5/30/18
to col...@googlegroups.com
Can you point us to the docs so we can fix it please. Thanks

Luis Majano
CEO
Ortus Solutions, Corp

From: col...@googlegroups.com <col...@googlegroups.com> on behalf of adk <and...@leftbower.com>
Sent: Wednesday, May 30, 2018 9:45:00 PM
To: ColdBox Platform
Subject: Re: [coldbox:26956] Coldbox 5 Datasource Settings
 

Brad Wood

unread,
May 30, 2018, 4:01:26 PM5/30/18
to col...@googlegroups.com
Where is that in the docs so I can fix it?  Here is the doc page for that is it looks correct to me:


Copy pasting from the docs, I see this:

coldbox:setting:{key}

and this:

property name="mysetting" inject="coldbox:setting:mysetting";

Also, adding the @modulename bit to inject settings from a module has always been the case and is documented here:


Note, ColdBox no longer has any concept of a thing called a "datasource".  These are just normal settings just like any other setting.  You name it what you want and you inject it with the generic rules for injecting settings.  

Thanks!

~Brad

Developer Advocate
Ortus Solutions, Corp 

ColdBox Platform: http://www.coldbox.org 


To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+unsubscribe@googlegroups.com.

To post to this group, send email to col...@googlegroups.com.

adk

unread,
May 30, 2018, 5:02:06 PM5/30/18
to ColdBox Platform
It's in the Upgrading to CB 5 section under "Datasources Configuration Dropped" section:



Re: @modulename and datasource key -  yes, I'm aware of using these items. I was just pointing out that injecting datasources that were configured in ModuleConfig CFCs previously didn't require the @modulename as they were added to the global datasources setting. I was updating an app with more than a dozen different datasources setup in so many modules and mistakenly thought I could do a global search and replace to change all of my property injections from "coldbox:datasource:mydsn" to "coldbox:setting:mydsn" (however this did not work because of the aforementioned @modulename requirement.)

The requirement was there before, but wasn't necessary for datasources. I just thought others may run into the same issue of they were migrating from 4.x to 5.x so I pointed it out!

Brad Wood

unread,
May 30, 2018, 5:27:30 PM5/30/18
to col...@googlegroups.com
Thanks, I fixed the typo. If you want to contribute your module-specific datasource settings to the parent ColdBox settings struct, use the parentSettings struct.  Then you should be able to inject it with the non-module syntax.

Thanks!

~Brad

Developer Advocate
Ortus Solutions, Corp 

ColdBox Platform: http://www.coldbox.org 


To unsubscribe from this group and stop receiving emails from it, send an email to coldbox+unsubscribe@googlegroups.com.

To post to this group, send email to col...@googlegroups.com.

adk

unread,
May 30, 2018, 8:17:57 PM5/30/18
to ColdBox Platform
Thanks for the tip! It's all good though, just a slight hiccup in my global search-replace strategy.
Reply all
Reply to author
Forward
0 new messages