Skip to main content
altascene
Inspiring
August 13, 2019
Question

Datasource "Host Port" Fetch Error?

  • August 13, 2019
  • 3 replies
  • 1980 views

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

This topic has been closed for replies.

3 replies

Priyank Shrivastava.
Community Manager
Community Manager
August 19, 2019

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
BKBK
Community Expert
August 19, 2019

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

BKBK
Community Expert
August 18, 2019

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>

altascene
altasceneAuthor
Inspiring
August 18, 2019

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

Charlie Arehart
Community Expert
August 18, 2019

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

null

/Charlie (troubleshooter, carehart. org)
Charlie Arehart
Community Expert
August 15, 2019

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)
altascene
altasceneAuthor
Inspiring
August 17, 2019

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

Community Expert
August 17, 2019

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