ColdFusion Startup Issue with Hostname

So - this is kind of crazy. Yesterday I fired up ColdFusion 11 to test something and discovered that every request for a CFM returned an error. The error was a Null Pointer Exception so not terribly helpful. (Or so I thought.) I checked the logs and saw this:

<pre> Could not determine local hostname. java.lang.NullPointerException at coldfusion.runtime.RuntimeServiceImpl.getQueueLimit(RuntimeServiceImpl.java:2145) at coldfusion.runtime.RuntimeServiceImpl.load(RuntimeServiceImpl.java:487) </pre>

So I googled some more and came across this post on the forums: ColdFusion 10 install on RHEL 6.1. I looked closely at the exception reported by the user there and noticed it matched what I was seeing on my server, specifically this part: org.apache.catalina.authenticator.AuthenticatorBase.invoke.

If you read that post, you will see that Rupesh (part of the ColdFusion team) says this:

The license service makes use of InetAddress.getLocalHost() API and therefore your /etc/hosts file should have an entry for both localhost as well as for your host name.

Well, my hosts file definitely had an entry for localhost, but on a whim, I added my hostname. In terminal I typed hostname (total guess, I had no idea that was a valid function) and it reported Raymonds-MBP-8. I added that to my hosts file, restarted ColdFusion, and everything was gravy.

I have absolutely no idea why this happened yesterday, but hopefully it will help others if they run into the same problem. I am having issues with my router where DNS lookups and other things will fail from time to time. So maybe something on my machine got hosed network-wise enough to confuse ColdFusion. Of course, I don't even have a license for my local ColdFusion 11 server so why in the heck did it need to check a license server?

Archived Comments

Comment 1 by Ron Stewart posted on 11/21/2014 at 3:44 PM

I've bumped into this (or something very much related) in the past on at least one of my Mac boxes at some point, but I think it was with CF10 (as I don't have CF11 in play anywhere) and it reared its head depending on what network I was connected to (work, work VPN, home) vs the network I was on when I installed CF and depending on how names were being resolved.. I will see if I can find my email communication with the Adobe CF team...

Comment 2 by Anit Kumar Panda posted on 11/21/2014 at 3:48 PM

It will check the hostname entry in the hosts file. Java NPE is expected here, if the hostname is missing. Rupesh's response is the absolute trick here.

Comment 3 (In reply to #2) by Raymond Camden posted on 11/21/2014 at 4:05 PM

Anit - can you explain though why it was never a problem before? Why now?

Comment 4 (In reply to #3) by Anit Kumar Panda posted on 11/21/2014 at 4:54 PM

Ray, its not something new with CF11. I don't know the exact logical explanation, why it happens. But, I can confirm that I have seen this with RHEL 6.x series, with CF9, CF10 and CF11. So my assumption is, something changed in RHEL (may be).

Comment 5 (In reply to #4) by Raymond Camden posted on 11/21/2014 at 4:55 PM

I'm on OSX. :)

Comment 6 (In reply to #5) by Adrian Moreno posted on 11/21/2014 at 9:39 PM

I ran into the same thing on OSX w/ CF11 and this was the only article I could find that spoke about the fix: http://blog.immanuelnoel.co... Maybe it has something to do with the version of Java being used? It happened to me on a fresh (first) install of CF 11 w/ Java 8.

Comment 7 by Ron Stewart posted on 11/22/2014 at 2:42 PM

@Ray: per my comment yesterday, I ran into something like this on CF10u8. See the comments in the ACF blog @ http://blogs.coldfusion.com...

Comment 8 by DigitheadRex posted on 12/1/2014 at 3:40 PM

I have tried everything I have read so far to no avail. my hosts file looks like:
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost ArthurDent
127.0.0.1 localhost

...

ArthurDent is the output from the hostname command.

Am I missing something?

Comment 9 by chmbrln posted on 1/15/2015 at 9:19 PM

worked perfectly for me - thanks!