I have tracked this problem down to the server.  I am able to run the
exact same code on a different server w/o any problems.

Now, I need to find out what is different betweent the two.

Maybe it would be prudent to uninstall CF and reinstall it?

M!ke 

-----Original Message-----
From: Dawson, Michael [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 08, 2006 1:08 PM
To: CF-Talk
Subject: RE: Null Pointer Exception Creating a CFC Object

I started to break the problem down to the most-simple pieces.

In the root of the web site, I created test.cfm and test.cfc as shown
here:

test.cfm
--------
<cfoutput><p>#now()#</p></cfoutput>
<cfset result = createObject("component", "test")> 

test.cfc
--------
<cfcomponent displayname="Test" output="no">
        <cffunction name="myFun" output="false" returntype="string">
                <cfreturn now>
        </cffunction>
</cfcomponent>

I received the Null Pointer error when running the test.cfm page.  Note,
that both of these files are in the same directory.  Also, the CFC does
not accept any arguments.  There is no constructor code, either.

I then added a root "/" mapping in CF to point to:
"D:\WebSites\Departments\ots.evansville.edu\WebSite"

This did not work.

I then added a custom tag path to:
D:\WebSites\Departments\ots.evansville.edu\WebSite

This did not work, either.

Should I restart the CF services for some reason?  I have not done that
since I can "force" an expected error by mis-typing the CFC name in my
code.

Thanks for any help.

-----Original Message-----
From: S. Isaac Dealey [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 08, 2006 1:01 PM
To: CF-Talk
Subject: RE: Null Pointer Exception Creating a CFC Object

> OK. Now, I'm really getting pissed at CF!!

> I created a mapping that pointed to the same directory as the CFC.

> I created a custom tag path that pointed to the same directory as the 
> CFC.

> Neither worked.  In fact, after removing those two items, CF is not 
> giving a different error.

> I thought you could call a CFC, from the same directory, as another 
> page without having to specify a path, setup a mapping or setup a 
> custom tag path.

> Did this break in the Updater?

Hi Mike,

Not that I'm aware of...

I'd be willing to bet that the problem you're having with the null
pointer error is a result of this somewhere in your cfc:

<cfargument name="x" required="false">

Null pointer errors happen a lot when a default is not specified for a
cfargument tag. This to me is the most frustrating thing about the lack
of nulls in recent versions of CF -- not that we can't use them in
general (although that's frustrating) but that there is an _EXTREMELY_
common circumstance which causes them OFTEN and is neither intuitive nor
well documented. If the error occurs while creating the object (before
init) I would bet that it calls method in the soft-constructor which
doesn't provide a not-required argument with no default value -- and
then of course attempts to use that undefined argument which results in
the null pointer error.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234698
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to