Tag: Mac

  • Fixing the Null Pointer Exception on ColdFusion

    EDIT: This post was originally written with only MacOS in mind, and has been updated to serve as a generic solution

    Null pointer exceptions., the NPE., can be a pain – especially with no debugging environment in place. Here’s a possible solution to one such NPE thrown by ColdFusion.

    Right after installing ColdFusion, if you are confronted with a HTTP 500 Error and a Null Pointer exception on accessing the administrator, this post is for you!

    Here is a more descriptive screenshot of the problem at hand.
    MacHostnameError


    This problem is most likely caused due to a missing hostname mapping in the hosts file. The hosts file needs to contain localhost, or the machine hostname if that is how ColdFusion is accessed through the browser. The solution for both, is below. An alternate way to identify this problem, is to check coldfusion-out.log entries. The licencing service would have failed to start with incorrect hostname mappings.

    Generic solution for all machines
    Edit the hosts file to see if a mapping for localhost and the machine hostname exists.

    Location of the hosts file on Windows: C:\Windows\System32\drivers\etc\hosts
    Location of the hosts file on Linux: \etc\hosts

    If not, add the statement below,

    127.0.0.1     localhost machine-hostname



    An easier solution on Mac
    Verify this is the case by running the below command. The result will likely not include “localhost”.

    sudo scutil --get HostName

    An easy way to fix this problem, is to run the below command, and restart ColdFusion.

    sudo scutil --set HostName localhost


    Voila! ColdFusion administrator must be accessible with the localhost / machine hostname now.

  • The fun in compiling Apache

    Quite contrary to the title, compiling Apache from source can be pretty frustrating at times, with trivial errors, compile options that are hard to remember, etc..

    Wrote a small piece of code to help you with this compilation. The script is tested on RHEL, definitely works on any Linux distro, and most likely just works out of the box on a Mac.

    The only thing that needs to be done manually, is to place the HTTPD, PCRE, APR, APR-UTIL archives in the same directory as the script, and execute! This was tested for Apache 2.4.9, which does not come with bundled APR, APR-UTIL libs. If you need compile an older distribution on Apache which has APR, APR-UTIL bundled, just comment out the “Extract APR” and “Extract APR-UTIL” code blocks.

    Have a look at the script at the BitBucket repository.
    https://bitbucket.org/immanuelnoel/apache-compile-script/