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
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...
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.
Anit - can you explain though why it was never a problem before? Why now?
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).
I'm on OSX. :)
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.
@Ray: per my comment yesterday, I ran into something like this on CF10u8. See the comments in the ACF blog @ http://blogs.coldfusion.com...
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?
worked perfectly for me - thanks!