Null pointer error instantiating CFC

Null pointer error instantiating CFC

Post by Jaso » Fri, 06 May 2005 06:21:58



Hi folks,

I'm having a problem on a server, in which attempts to instantiate a
CFC result in a null pointer error.  I was promoting an application
from a development server to the production server (which happens to be
TWO servers, behind a load balancer), and the app wouldn't work.  First
time a CFC is instantiated, it dies (this happens in the
Application.cfm, so it's immediate.)  The environment is CFMX6.1 on
Solaris 5.8.  To ease troubleshooting, I've reduced the bug to the most
simple test case I could:

Application.cfm
---------------
This file is empty, just to make sure another - higher -
Application.cfm file isn't getting picked up.

talker.cfc
----------
<cfcomponent>
        <cffunction name="echo">
                <cfargument name="value">
                <cfoutput>#arguments.value#</cfoutput>
        </cffunction>
</cfcomponent>

index.cfm
---------
<!--- <cfobject name="talker" component="talker"> --->
<cfset talker = CreateObject("component", "talker")>
<cfoutput>
        <cfset talker.echo("1")>
        <cfset talker.echo("2")>
        <cfset talker.echo("3")>
        <cfset talker.echo("4")>
</cfoutput>

When I run this on my Dev server, I get the desired output ("1 2 3 4").
On the production server (and both are doing the same thing) I get:
-------------------------------------------------------
The system has attempted to use an undefined value, which usually
indicates a programming error, either in your code or some system code.

Null Pointers are another name for undefined values.

The error occurred in /inside3/htdocs/sapp/isarp/test/test/index.cfm:
line 2

1 : <!--- <cfobject name="talker" component="talker"> --->
2 : <cfset talker = CreateObject("component", "talker")>
3 : <cfoutput>
4 :         <cfset talker.echo("1")>
-------------------------------------------------------

I get the same error, whether I use the <cfobject> tag, or the
CreateObject function.  Different line number, of course.

The same test case has been put on three other servers as well (two in
the same load balanced configuration, the other running 'solo') and it
has worked fine on all of them.  I'm relatively sure it's something to
do with these two servers, but don't have any good ideas.  Further, the
fact that it happens on both production servers (rather than just one)
behind the load balancer is slightly curious.

Does anyone have any ideas what might be wrong here?

Thanks,
Jason