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

Datasource "Host Port" Fetch Error?

Explorer ,
Aug 13, 2019 Aug 13, 2019

Copy link to clipboard

Copied

Greetings,

We are attempting to deploy some code on CF2018, and are receiving a puzzling error.  When we run the code, and then look in the coldfusion-out log, we see several entries of "Exception while fetching the host port of the DB in Configuration for "db name.of.database".  The exception log contains the above error, with the following entry associated with each entry;

"java.lang.ClassCastException: class coldfusion.sql.CFDataSourceProxy cannot be cast to class coldfusion.sql.CFDataSource (coldfusion.sql.CFDataSourceProxy and coldfusion.sql.CFDataSource are in unnamed module of loader coldfusion.bootstrap.BootstrapClassLoader @59b32539)"

The code is executing a SQL query, which does complete.  The data source is working, because we get data back, as well as it validating connectivity during the data source creation process.  To our knowledge, no proxies are defined for the datas ource connection.

We cannot locate specifics on either of the error messages, so any insights would be greatly appreciated.

Thanks,

Scott

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
Community Expert ,
Aug 15, 2019 Aug 15, 2019

Copy link to clipboard

Copied

I have never seen that error (and I make a living solving CF problems like this), so I am inclined to think that either you have some very curious setup (such that this very odd error is the result of some problem in that setup), or more likely it may be that CF is throwing the unusual error because it (CF) is in an unusual state.

I assume you have restarted CF and the problem remains, right?

If so, then in my experience, the most common cause of CF being in an unusual state (that is not fixed by a restart) is the strong possibility that there was an error that occurred when any CF updates were applied. And for that, I have a blog post outlining how to find if there was such an error (not obvious), including where to look (also not obvious), and finally what to do if there was one (also itself not so obvious). See:

Having problems after applying a CF update? What to check, and how to recover!

Please let us know if that helps or not.

And if it not, please tell us a bit more: what OS CF is running on, what CF 2018 update level it is, and what JVM version? All 3 are shown on the top of the "settings summary" page in the CF Admin. Tell us also the type of database this connection is for, and tell us a bit more about where the DB server is relative to CF. None of these may matter, but without more info we need to start somewhere. I am hopeful it will be as simple as an error in the last CF update, and re-instaliing that or the latest avaialble CF update.


/Charlie (troubleshooter, carehart.org)

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
Explorer ,
Aug 17, 2019 Aug 17, 2019

Copy link to clipboard

Copied

Charlie,

I've never seen it before, either, and there is very little information about from any source.

I stepped through your suggestion regarding a problem update but, naturally, the hotfix file shows all successes, no errors.

The installation is a stock CF 2018 Standard Ed, with Java 11, update 4, running on Windows Server 2019.  It is connected to SQL Server 2008 R2, running on a separate server (which has been our production SQL box for years, connected to a stable CF11 install).  The OS is not showing any signs of errors in the Windows event logs, and this is a clean install on a new server.

An added twist; some times, the task runs with no errors.

Scott

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 Expert ,
Aug 17, 2019 Aug 17, 2019

Copy link to clipboard

Copied

As a last resort, you might consider running a low-level traffic scanner like Wireshark on either server, and see what it picks up. The logs for this will be absolutely huge, so this will be a difficult effort especially if you're not already familiar with using Wireshark, but you can pretty easily filter traffic to just DB requests at least.

Dave Watts, Eidolon LLC

Dave Watts, Eidolon LLC

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 Expert ,
Aug 18, 2019 Aug 18, 2019

Copy link to clipboard

Copied

The message

"Exception while fetching the host port of the DB in Configuration for "db name.of.database".

might mean just that. Could you share the settings of the relevant datasource? (For example, a printscreen of the CF Admin datasource page).

A second way to debug this is to look at the file /lib/neo-datasource.xml. Study, in particular, the settings for the datasource that is producing the error.

You will find below an excerpt from the neo-datasource.xml of my application. This is for a MySQL datasource. You will notice that ColdFusion converted some of the port settings to a decimal number. This causes no problem on my system. However, could it be that it causes a problem on your system?

Excerpt from neo-datasource.xml

<var name='euro_conversion'>

<struct type='coldfusion.server.ConfigMap'>

<var name='alter'>

<boolean value='true'/>

</var>

<var name='create'>

<boolean value='true'/>

</var>

<var name='disable_clob'>

<boolean value='true'/>

</var>

<var name='DRIVER'>

<string>MySQL5</string>

</var>

<var name='CLASS'>

<string>com.mysql.jdbc.Driver</string>

</var>

<var name='url'>

<string>jdbc:mysql://localhost:3306/euro_conversion?tinyInt1isBit=false&</string>

</var>

<var name='drop'>

<boolean value='true'/>

</var>

<var name='clientinfo'>

<struct type='coldfusion.server.ConfigMap'>

<var name='ApplicationName'>

<boolean value='false'/>

</var>

<var name='ApplicationNamePrefix'>

<string/>

</var>

<var name='ClientHostName'>

<boolean value='false'/>

</var>

<var name='ClientUser'>

<boolean value='false'/>

</var>

</struct>

</var>

<var name='delete'>

<boolean value='true'/>

</var>

<var name='disable_autogenkeys'>

<boolean value='false'/>

</var>

<var name='description'>

<string/>

</var>

<var name='pooling'>

<boolean value='true'/>

</var>

<var name='username'>

<string>root</string>

</var>

<var name='update'>

<boolean value='true'/>

</var>

<var name='storedproc'>

<boolean value='true'/>

</var>

<var name='interval'>

<number>420.0</number>

</var>

<var name='disable'>

<boolean value='false'/>

</var>

<var name='disable_blob'>

<boolean value='true'/>

</var>

<var name='revoke'>

<boolean value='true'/>

</var>

<var name='validationQuery'>

<string/>

</var>

<var name='blob_buffer'>

<number>64000.0</number>

</var>

<var name='buffer'>

<number>64000.0</number>

</var>

<var name='select'>

<boolean value='true'/>

</var>

<var name='NAME'>

<string>euro_conversion</string>

</var>

<var name='login_timeout'>

<number>30.0</number>

</var>

<var name='grant'>

<boolean value='true'/>

</var>

<var name='password'>

<string>Uxc9LQhIWjDucoySJABfloHR1v4Lu6+mzgGhPTlT8cQ=</string>

</var>

<var name='ISJ2EE'>

<boolean value='false'/>

</var>

<var name='validateConnection'>

<boolean value='false'/>

</var>

<var name='insert'>

<boolean value='true'/>

</var>

<var name='timeout'>

<number>1200.0</number>

</var>

<var name='urlmap'>

<struct type='coldfusion.server.ConfigMap'>

<var name='_port'>

<number>3306.0</number>

</var>

<var name='informixServer'>

<string/>

</var>

<var name='args'>

<string/>

</var>

<var name='systemDatabaseFile'>

<string/>

</var>

<var name='defaultusername'>

<string/>

</var>

<var name='supportLinks'>

<string>true</string>

</var>

<var name='host'>

<string>localhost</string>

</var>

<var name='selectMethod'>

<string>direct</string>

</var>

<var name='useSpyLog'>

<boolean value='false'/>

</var>

<var name='pageTimeout'>

<string/>

</var>

<var name='CONNECTIONPROPS'>

<struct>

<var name='DATABASE'>

<string>euro_conversion</string>

</var>

<var name='PORT'>

<string>3306</string>

</var>

<var name='HOST'>

<string>localhost</string>

</var>

</struct>

</var>

<var name='datasource'>

<string/>

</var>

<var name='TimeStampAsString'>

<string>no</string>

</var>

<var name='applicationintent'>

<string/>

</var>

<var name='_logintimeout'>

<number>30.0</number>

</var>

<var name='isnewdb'>

<string>false</string>

</var>

<var name='defaultpassword'>

<string/>

</var>

<var name='port'>

<string>3306</string>

</var>

<var name='spyLogFile'>

<string/>

</var>

<var name='MaxPooledStatements'>

<string>100</string>

</var>

<var name='qTimeout'>

<string>0</string>

</var>

<var name='SID'>

<string/>

</var>

<var name='database'>

<string>euro_conversion</string>

</var>

<var name='sendStringParametersAsUnicode'>

<string>false</string>

</var>

<var name='databaseFile'>

<string/>

</var>

<var name='maxBufferSize'>

<string/>

</var>

<var name='UseTrustedConnection'>

<string>false</string>

</var>

</struct>

</var>

</struct>

</var>

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
Explorer ,
Aug 18, 2019 Aug 18, 2019

Copy link to clipboard

Copied

A Wireshark analysis may be in order.  I checked the neo-datasource.xml file and, yes, the port setting is converted to a decimal.  However, It does pass the connectivity verification check.  The settings are straight-forward;

This connector has been working reliably on another machine for years.  It also has functioned on this server, but with this intermittent issue.

Another bit of information.  The exception log contains these entries with each datasource error;

"Error","ajp-nio-8018-exec-5","08/18/19","09:28:12","","Exception while fetching the host port of the DB in Configuration for db RegOneCAlive"

java.lang.ClassCastException: class coldfusion.sql.CFDataSourceProxy cannot be cast to class coldfusion.sql.CFDataSource (coldfusion.sql.CFDataSourceProxy and coldfusion.sql.CFDataSource are in unnamed module of loader coldfusion.bootstrap.BootstrapClassLoader @2e463f4)

Scott

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 Expert ,
Aug 18, 2019 Aug 18, 2019

Copy link to clipboard

Copied

How do those values in the neo-datasource.xml compare to the same dsn entry in the working file? 

null


/Charlie (troubleshooter, carehart.org)

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
Explorer ,
Aug 18, 2019 Aug 18, 2019

Copy link to clipboard

Copied

Charlie,

It looks like it is configured correctly in the neo-datasource file.  I also looked through the advanced settings, to see if a setting or settings, beyond the defaults, is/are in use (which they are not).  As this is a new system, which will be replacing some of the functionality of an existing production system, I am comparing settings between the two.  Again, I am wondering if the Java error information I posted earlier is really stating the problem; we are trying to cast a class incorrectly.  Not much out there on errors of this type, but there is some.

Thanks,

Scott

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 Expert ,
Aug 18, 2019 Aug 18, 2019

Copy link to clipboard

Copied

But Scott, I am proposing you compare the xml,  not what you see in the admin. I've seen situations where values in the ui were rendered unexpectedly in the xml.

So I was asking specifically that you compare the same fields for that dsn in the old and new server's xml.

As for your previous note, and the fact that "this connector" has worked for years, that doesn't really matter for the new server if there are characteristics of those entries in the new server that are different from the old, right?

As for the error message, I appreciate that's your focus. But the fact that no one else has ever reported it before (per a Google search for "Exception while fetching the host port of the DB in Configuration") tells me that again there is something very unusual going on. So as I said from the first, I suspect a config problem.

As you do assess the xml values, I'm curious also if you find 4 references to the 3306 port like bkbk showed in his example. That was indeed one dsn: most other fields did occur only once in his comment. So what about yours, given the message Referencing the port? Do you have 4, and are all 4 the same? (I'm not at a computer to check my own.)

It is indeed odd that the error is intermittent. Perhaps something about the multiple port indications mean that they are used under different circumstances. That's just a guess. I realize it could seem preposterous to some readers.

Finally, tell us how this dsn in the new server got there? This could be critical. Was it manually entered in the admin? Imported by the migration wizard, which runs on first launch of the admin after install? The car import feature? Or (gasp) did you copy the neo xml file into the new server from the old? (I would warn that's never a good idea, across cf versions.)

Let's see if something above helps.


/Charlie (troubleshooter, carehart.org)

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
Explorer ,
Aug 18, 2019 Aug 18, 2019

Copy link to clipboard

Copied

Charlie,

"But Scott, I am proposing you compare the xml,  not what you see in the admin. I've seen situations where values in the ui were rendered unexpectedly in the xml."

I did review the XML.

So I was asking specifically that you compare the same fields for that dsn in the old and new server's xml.

"As for your previous note, and the fact that "this connector" has worked for years, that doesn't really matter for the new server if there are characteristics of those entries in the new server that are different from the old, right?"

My point there was to indicate that the backend SQL Server wasn't the issue.  I am trying to take potential issues "off the table".

"As for the error message, I appreciate that's your focus. But the fact that no one else has ever reported it before (per a Google search for "Exception while fetching the host port of the DB in Configuration") tells me that again there is something very unusual going on. So as I said from the first, I suspect a config problem."

I agree that it very well could be a configuration issue.  I am just wondering if the underlying Java error message will provide me with some more specific direction.

"As you do assess the xml values, I'm curious also if you find 4 references to the 3306 port like bkbk showed in his example. That was indeed one dsn: most other fields did occur only once in his comment. So what about yours, given the message Referencing the port? Do you have 4, and are all 4 the same? (I'm not at a computer to check my own.) "

No.  We re using port 1433 for the SQL connection, so I have 4 references for 1433.

"It is indeed odd that the error is intermittent. Perhaps something about the multiple port indications mean that they are used under different circumstances. That's just a guess. I realize it could seem preposterous to some readers."

Odd, and frustrating.

"Finally, tell us how this dsn in the new server got there? This could be critical. Was it manually entered in the admin? Imported by the migration wizard, which runs on first launch of the admin after install? The car import feature? Or (gasp) did you copy the neo xml file into the new server from the old? (I would warn that's never a good idea, across cf versions.)"

I manually created it in the Admin.

I am going to have the development team take a look at the code, to exclude changes that may have been inadvertently introduced in the code.  I may also build a new server, and test on it.  I will update my status here, as changes occur.

Thanks,

Scott

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 Expert ,
Aug 19, 2019 Aug 19, 2019

Copy link to clipboard

Copied

Hi Scott,

You have likely discovered a bug. I suspect 2 things.

Either:

1) you inadvertently installed an extra class loader. Note:

java.lang.ClassCastException: class coldfusion.sql.CFDataSourceProxy cannot be cast to class coldfusion.sql.CFDataSource (coldfusion.sql.CFDataSourceProxy and coldfusion.sql.CFDataSource are in unnamed module of loader coldfusion.bootstrap.BootstrapClassLoader @2e463f4)

or 2) ColdFusion has a bug. Report a bug in any case.

My reason is as follows.

Run the code,

<cfscript>

CFDataSource=createobject("java","coldfusion.sql.CFDataSource");

CFDataSourceProxy=createobject("java","coldfusion.sql.CFDataSourceProxy");

writeoutput("Does coldfusion.sql.CFDataSource implement the interface javax.sql.DataSource? " & isInstanceOf(CFDataSource, "javax.sql.DataSource"));

writeoutput("<br>");

writeoutput("Does coldfusion.sql.CFDataSourceProxy implement the interface javax.sql.DataSource? " & isInstanceOf(CFDataSourceProxy, "javax.sql.DataSource"));

</cfscript>

Then you will find that coldfusion.sql.CFDataSource and coldfusion.sql.CFDataSourceProxy implement the interface javax.sql.DataSource. I doubt whether you may, in general, cast between two classes that implement the same interface.

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
Adobe Employee ,
Aug 19, 2019 Aug 19, 2019

Copy link to clipboard

Copied

Hi Scott,


We identified this issue with CF2018 and it is happening because of PMT. I have logged a bug for this some time back and we fixed this issue.

Can you please send an email at cf[dot]install@adobe[dot]com.

Thanks,

Priyank Shrivastava

Thanks,
Priyank Shrivastava

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 Expert ,
Aug 19, 2019 Aug 19, 2019

Copy link to clipboard

Copied

Ah, thanks Priyank Shrivastava for the helpful, and timely, response.

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 Expert ,
Aug 19, 2019 Aug 19, 2019

Copy link to clipboard

Copied

Priyank, are you saying that this is a problem fixed in the update 1 for the PMT? Or is a problem after that update?

If it's about update 1 for the PMT, I will point out for Scott and other interested readers that there was indeed an update to the PMT with CF2018 update 2. But it was not applied automatically BY the CF2018 update 2 (indeed, like I said, it's called update 1 of the PMT). Instead, you had to manually apply it.

I have a blog post explaining this here:

Running the CF 2018 PMT? Have you manually applied the recent update to it?

I will note also that there was also with update 2 a new CF2018 installer (and a new PMT installer), and those came with the updates already installed. But if you are running the PMT from an installer before Feb 2019, what I offer applies (and I explain it more in that post, including how to know which PMT and installer you may have).


/Charlie (troubleshooter, carehart.org)

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
Adobe Employee ,
Aug 19, 2019 Aug 19, 2019

Copy link to clipboard

Copied

LATEST

Hi Charlie,

We found this problem recently after the update release, one of the users reported this issue. I think this issue was there even before the update.

Thanks,

Priyank Shrivastava

Thanks,
Priyank Shrivastava

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