Tuesday, October 9, 2007

ColdFusion 8 flex2gateway Error 500 java.lang.NullPointerException

I recently upgraded to CF8 and experienced a small problem when i went to configure my AMF end points and channels. First I must say that I like the new method of keeping the channel definitions in the services-config while breaking out the destination settings into separate files like remoting-config. Now all that being said I encountered the following error when going to http://localhost/flex2gateway/ after copying over my old settings into these files.
500
java.lang.NullPointerException at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:283) at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543) at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203) at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320) at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428) at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266) at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
The problem occurs because apparently while it was ok to have two channels share the same endpoint uri URL in CF7...

in CF8 it doesn't work. The solution is to simply change the endpoint uri for the new channel. (You should leave the class definition the same for the uri.)
I doubt a lot of people are going to have this problem as it seems that most people are not using custom channels or destinations.
At any rate.... once you make this change, stop and restart the cf server you should be able to hit the uri in a browser window and get .... nothing (a blank page) which is good, it means it is working.