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

CF 10 failed to get a connection from the poll - MSSQL

New Here ,
Mar 11, 2013 Mar 11, 2013

Copy link to clipboard

Copied

Hi,

I'm migrating an application from CF CF 8 to 10, but I have a problem that is stopping me

The following code is correct and works in CF 8

<cdscript>

.

.

.

DataSourceFactory = CreateObject("java","coldfusion.sql.DataSourceFactory");

DataSourceFactory.getInstance().getDataSource(Attributes.datasource).getConnection();

.

.

</cfscrip>

But in CF 10 marks the next error.

struct

Detail           Either there are no methods with the specified method name and argument types or the getDataSource method is overloaded with argument types that ColdFusion cannot decipher reliably. ColdFusion found 0 methods that match the provided arguments. If this is a Java object and you verified that the method exists, use the javacast function to reduce ambiguity.

Message           The getDataSource method was not found.

MethodName           getDataSource

StackTrace           coldfusion.runtime.java.MethodSelectionException: The getDataSource method was not found. at coldfusion.runtime.java.ObjectHandler.findMethodUsingCFMLRules(ObjectHandler.java:383) at coldfusion.runtime.StructBean.invoke(StructBean.java:524) at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:2465) at cfjdbcquery_open2ecfm1678258463.runPage(C:\ColdFusion10\cfusion\wwwroot\sif\TagsSIF\jdbcquery_open.cfm:64) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:244) at coldfusion.filter.CFVariablesScopeFilter.invoke(CFVariablesScopeFilter.java:56) at coldfusion.tagext.lang.ModuleTag.doAfterBody(ModuleTag.java:377) at

Any Idea?

Views

621

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
Guide ,
Mar 12, 2013 Mar 12, 2013

Copy link to clipboard

Copied

LATEST

I think the DataSourceFactory is an undocumented internal ColdFusion library, which Adobe discourages using (because it is undocumented and subject to change between versions).  It apparently was removed or changed substantialy between CF8 and CF10 (might even have happened with CF9).  You would be better off using the CF Administrator API.  There is a portion of the API that deals with datasources.  Here are the Adobe docs for the API:  http://help.adobe.com/en_US/ColdFusion/10.0/Admin/WSc3ff6d0ea77859461172e0811cbf364104-7fcf.html.

-Carl V.

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