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

9.0.1 upgrade breaks getDataSourceService

Community Beginner ,
Aug 13, 2010 Aug 13, 2010

Copy link to clipboard

Copied

This code has worked fine in versions 7.x to 9.x.

<cfset factory      = createobject("java", "coldfusion.server.ServiceFactory")>

<cfset service      = factory.getDataSourceService()>

<cfset datasources  = service.getDataSources()>

Now in 9.0.1 it errors on the last command with a generic "Error processing request" message.  The exception.log shows:

"Error","jrpp-148","08/13/10","08:32:16",,"'' The specific sequence of files included or processed is: E:\Inetpub\wwwroot\....., line: 32 "
coldfusion.security.SecurityManager$UnauthenticatedCredentialsException
    at coldfusion.security.SecurityManager.authenticateAdmin(SecurityManager.java:1958)
    at coldfusion.sql.Executive.getDatasources(Executive.java:96)

It appears to be related to security, most likely checking for Administrator privilege.  Any one have any ideas how to get around this?  Thanks.

Michael

TOPICS
Advanced techniques

Views

1.6K

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
Advocate ,
Aug 13, 2010 Aug 13, 2010

Copy link to clipboard

Copied

Try executing the login() method of cfide.adminapi.administrator first.

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
Community Beginner ,
Aug 13, 2010 Aug 13, 2010

Copy link to clipboard

Copied

Good suggestion but I just tried it and it did not make a difference. The adminapi object is unrelated to the serviceFactory object so it does not see that the session is authenticated.  I tried creating a coldfusion.server.ServiceFactory.getSecurityService() object and dumping it to see the methods. There is a method called authenticateAdmin( ) but that also generates the same exception.

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
Advocate ,
Aug 13, 2010 Aug 13, 2010

Copy link to clipboard

Copied

Then I suggest you rewrite it to use the getDatasources() method of CFIDE.adminapi.datasource.

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
Community Beginner ,
Aug 13, 2010 Aug 13, 2010

Copy link to clipboard

Copied

I was not aware of that API call and I just did a quick test and it looks like it will work.  Thanks!

Michael

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
Advocate ,
Aug 13, 2010 Aug 13, 2010

Copy link to clipboard

Copied

LATEST

And the good thing about that API is that it is supported: if it breaks

from one version to the next you can file a bug. The internal stuff is

all "use at your own risk".

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