February 15, 2008

System.NullReferenceException when starting Community Server News Gateway Windows Service

Yesterday a colleague wrote, "It's hard to believe you had 27 blog posts in one month a year ago." I think that his disbelief was triggered by my lack of regular posts recently compared to my abundance of posts then. Last night I took a look back through some of those posts from this time last year to see what the heck I was doing that would give me enough material to post nearly once per day. One of the things I was working on was the WhatIWantMost project, but the other was that I had only months before joined the Telligent team and I was getting my first strong dose of Community Server. I had used CS for blogs long before that time so I was familiar with that side of the product, but I had only implemented CS forums once before that - and even then it was vanilla. Because I was new I had a lot of information that I could relay to other beginners.

Over the course of the past year I have gained more experience working with Community Server and have grown more comfortable with it. When an issue does come up it's usually not "new" to me so I don't feel that it's worth blogging about. Yesterday I ran into something that I would have normally cast aside in the same manner, but I realize now that it is worth sharing.

I installed the Community Server News Gateway add-on to a new server and it seemed to be a successful installation. I updated the configuration files and dropped everything into place (I was copying from a known good installation on an existing server). I ran the console application and everything worked fine. However, when I tried to start the service it would immediately stop and show a generic message. In the Application Event Log I found something similar to this:

System.NullReferenceException: Object reference not set to an instance of an object.
    at CommunityServer.NntpServer.Service.Program.OnStart(String[] args)
    at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)

 

Since the console app worked fine I assumed that there was nothing wrong with my configuration or with the program itself. I thought that there must be something wrong with the setup of the service. After searching through the CommunityServer.org forums I found a similar issue with a different service that had something to do with the registry key being stored in the wrong place.

The News Gateway service was expecting to find its registry entry at:
HKEY_LOCAL_MACHINE\SOFTWARE\Telligent Systems, Inc.\Community Server News Gateway
but mine had been installed at:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Telligent Systems, Inc.\Community Server News Gateway

The new web server that I was installing to was a 64-bit OS and I had chosen the default path that was presented to me when running the service's installer so it was installed to the "Program Files (x86)" folder. I assume that is why it was put in the "Wow6432Node" rather than directly in the "SOFTWARE" node. Seems that the service could not find its registry entry which was why it was throwing the NullReferenceException.

The quick fix for me was to manually create a copy of the node (along with its keys and entries) directly in the "SOFTWARE" node. After that the service fired right up and ran properly.

Hopefully someone will find this information useful when happening upon this post while searching for the described exception. I'll try to remember to keep posting bits like this as I encounter them.

Comments,

  • Trackbacks,
  • and Pingbacks
  1. Which version are you using?  Think the dependence on the registry key was removed from CS 2007.1, for that very reason.  It made xcopy deployment more difficult, and caused issues with 64-bit OSes since we had the registry path hard coded.

  2.  avatar says:

    Ken, thanks for the info. My original install was code from just prior to the 2007.1 release. I used the most recently released installer, but then copied my old dlls and configs from an existing server over top of what the installer put in place (thus reverting to pre-2007.1).

    It's good to know that it is no longer an issue.

    Thanks,

    Dan

Comments are closed.

 

Trackbacks and Pingbacks


  1. blog bits It appears that Microsoft is continuing to advance their social networking product, as it now

  2. blog bits It appears that Microsoft is continuing to advance their social networking product, as it now

  3. Dan Hounshell with one of those thousand-dollar posts if you happen to be experiencing a "System

Shortcuts

Where is Dan?


My Blog
My Blog
Twitter
Twitter
Facebook
Facebook
LinkedIn
LinkedIn
Flickr
Flickr
YouTube
YouTube
Delicious
Delicious
Foursquare
Foursquare
Pinterest
Pinterest
GetGlue
GetGlue
Pintley
Pintley
XBOX Live
XBOX Live
Last.fm
Last.fm
Windows Live
Windows Live
Telligent.com
Telligent
Graffiti CMS on CodePlex
Graffiti CMS
Popular

Recent Posts