Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFCs and null pointer error (Help!)

Guest
Dec 17, 2009 Dec 17, 2009

Client is insisting that the site be hosted at Network Solutions (ugh!), and so far their CF support has been abysmal.

Site works 100% fine on my dev server and a production server that I administer.  However, as soon as you try to use any sort of CFC on Network Solution's web server, you get the following error:

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.

This includes even a stripped down, completely simple Application.cfc.  I've had a ticket open with them now for 2 days and no response from their "support" (it took over a week to get the DSN setup).

Is this indicitive of them having cfinvoke, cfobject and CreateObject() disabled in security?  On tried posting this on the HoF list and the replies were typically "I've heard of this but haven't found a solution".  The one suggestion was to uncheck "maintain connections" in the Administer, but we don't have access to that at all.

Any ideas of how to solve this programatically short of rewriting the entire app w/o CFCs??

And no, he won't switch hosts to anyone with any CF experience.  He'd rather pay $3,000 to recode the app in ASP (and pray that NSI's ASP support is any better than their CF support).

2.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 17, 2009 Dec 17, 2009

Hi,

Are you sure that your DSN had been setup properly by your hosting provider?.

As a sidenote, if you are using a database like, MySQL then make sure that your have same driver class in both the DSN's.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 17, 2009 Dec 17, 2009

I've tried it with just a real simple cfinvoke to a test cfc that just returns a string and it throws the error, so it's not dsn related.

Regarding MySQL - I wish!  Network Solutions only supports Access or MS-SQL on their CF hosting servers.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 19, 2009 Dec 19, 2009

Could you show us one line that throws the error? The provider may indeed have disabled some tags.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 21, 2009 Dec 21, 2009

test.cfm:

<cfinvoke component="com.testCFC" method="myFunction" returnvariable="myResult"/>

testCFC

<cfcomponent>
    <cffunction name="myFunction" access="public" returntype="string">
        <cfset myResult="foo">
        <cfreturn myResult>
    </cffunction>
</cfcomponent>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 21, 2009 Dec 21, 2009

Two ideas:

1) A strategy to get Coldfusion to give you more information:

<cftry>

<cfinvoke component="com.testCFC" method="myFunction" returnvariable="myResult"/>

<cfcatch type="any">

<cfdump var="#cfcatch#">

</cfcatch>

</cftry>

2) Have you verified whether you're allowed to create objects?


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 21, 2009 Dec 21, 2009

Great idea - I've been banging my dead against the wall so much I should have done this a while ago.  2 techs have confirmed that cfinvoke, cfobject and createObject() are permitted.  Here's the dump of cfcatch:

struct
Message[empty string]
StackTracejava.lang.NullPointerException      at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:115)      at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:102)      at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:96)      at coldfusion.runtime.TemplateProxyFactory.resolveFile(TemplateProxyFactory.java:74)      at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:632)      at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:341)      at cftest2ecfm706267156.runPage(E:\0\1\10\16\1988505\user\2173540\htdocs\ruhungry\test.cfm:9)      at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)      at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)      at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)      at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:210)      at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51)      at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)      at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69)      at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)      at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)      at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)      at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)      at coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:115)      at coldfusion.CfmServlet.service(CfmServlet.java:107)      at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)      at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)      at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)      at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)      at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)      at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)      at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)      at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)      at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)      at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
TagContext
array
1
struct
COLUMN0
IDCFINVOKE
LINE9
RAW_TRACEat cftest2ecfm706267156.runPage(E:\0\1\10\16\1988505\user\2173540\htdocs\ruhungry\test.cfm:9)
TEMPLATEE:\0\1\10\16\1988505\user\2173540\htdocs\ruhungry\test.cfm
TYPECFML
Typejava.lang.NullPointerException
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Dec 21, 2009 Dec 21, 2009

1. Can you post a small reproducible example?

2. Are you invoking a CFC in a different directory? If so, do you get the same results when invoking a CFC in the same directory as your .cfm script?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2009 Dec 22, 2009

A natural mistake to make: did you save it as testCFC.cfc

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Dec 22, 2009 Dec 22, 2009

Oops. I see you did post an example already. I thought that was BKBK's response.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 22, 2009 Dec 22, 2009

Yes, the file is saved as testCFC.cfc.

It makes no difference whether the cfc is in /com and accessed via com.testCFC or in the same directory as test.cfm.

The same error occurs when using Application.cfc - as soon as it hits <cfcomponent> the error is thrown.  Even just making a cfc with no methods in it - just the <cfcomponent> tags will cause the error.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 22, 2009 Dec 22, 2009

Steve,

Do you have the "extends" attribute set to some other CFC in your Application.cfc file?.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 22, 2009 Dec 22, 2009

Nope.

Application.cfc has been removed and redone as Application.cfm.  Nothing fancy there either:

<cfapplication name="ruh"
        clientmanagement="No"
        sessionmanagement="Yes"
        SessionTimeout="#CreateTimeSpan(0,0,30,0)#"
        ApplicationTimeout="#CreateTimeSpan(0,2,0,0)#"
        SetClientCookies="Yes">

<cflock scope="application" type="exclusive" timeout="10">

     <cfset application.dsn = "ruh"/>

     <cfset application.settings.locCarriageReturn = chr(13) & chr(10)/>
     <cfset application.settings.retirementAge = "90"/>
     <cfset application.maxIterations = 10/>
     <cfset application.howfarback = -180/>  
</cflock>

And a couple other things to initialize a structure for Session.User.

I've even tried completely removing Application.cfm/.cfc and just hitting test.cfm then - same error.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Valorous Hero ,
Dec 22, 2009 Dec 22, 2009

Just to rule out all other possible influences, have you tried your simple test cfc in a directory without any application.cfm/cfc files either in that folder, or in a parent folder? So it is just your test .cfm script and the test.cfc.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 22, 2009 Dec 22, 2009

Yep.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2009 Dec 22, 2009

Two more tests.

1) What happens when you open the CFC's page in the browser? That is, when you open

http://127.0.0.1:8500/path_to_testCFC.cfc

2) What happens when you save the component code as SomethingElse.cfc?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 22, 2009 Dec 22, 2009

1 - same error:

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.

2 - same error:

http://02f1d12.netsolhost.com/ruhungry/test.cfm

http://02f1d12.netsolhost.com/ruhungry/somethingelse.cfc

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Dec 22, 2009 Dec 22, 2009

Hi Steve,

Can you make sure that you have enabled the "Enable Application Variables" in your CFIDE/Administrator panel?.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2009 Dec 22, 2009

Daverms, sorry about the repetition. I responded before I saw your post.

P.S.:Site is hosted, so I am assuming Steve can't get his hands on the CF Admin

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 22, 2009 Dec 22, 2009

It's shared hosting, no access to CFAdmin.  However, I would assume they are enabled since my Application.cfm file has several variables that are stored in the application scope for use in the app:

<cfset application.dsn = "ruh"/>  etc.

On a couple of pages I've removed all CFC usage and the app works fine using Application.cfm and just .cfm files with queries in page.  It's a pain in the butt and I'd love to have them fix it, but their support is - how to say this nicely.......horrible.  In 2+ weeks now we finally got it escalated to a level 2 tech yesterday - whose response was "I don't know anything about CF, but if a .cfm page comes loads ok then it's obviously a problem with your coding and not our server."

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2009 Dec 22, 2009

Steve, I do sympathize. There's something awkward going on.

It looks like there is some process that is bootstrapping Coldfusion. Even before it gets the chance to instantiate components! Do you have any frameworks installed?

Other tests:

1) What do you get when you do the following:

<cfdump var="#application#">

2) What happens when you move the test CFC to the (web) root directory and test them there?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 22, 2009 Dec 22, 2009

Here's application and server dumps.  I'll try the moving test.cfm and test.cfc out of this webroot and will post results in a minute.

application - struct
applicationnameruh
dsnruh
howfarback-180
initializedfalse
maxiterations10
mdbdsnruh
settings
application - struct
LOCCARRIAGERETURN
RETIREMENTAGE90
siteroothttp://02f1d12.netsolhost.com/ruhungry/
smtpserver127.0.0.1
title  An Alumni Site

server - struct
COLDFUSION
server - struct
APPSERVERJRun4
EXPIRATION{ts '2009-12-20 04:00:40'}
INSTALLKITNative Windows
PRODUCTLEVELEnterprise
PRODUCTNAMEColdFusion Server
PRODUCTVERSION7,0,1,116466
ROOTDIRC:\CFusionMX7
SUPPORTEDLOCALESChinese (China),Chinese (Hong Kong),Chinese (Taiwan),Dutch (Belgian),Dutch (Standard),English (Australian),English (Canadian),English (New Zealand),English (UK),English (US),French (Belgian),French (Canadian),French (Standard),French (Swiss),German (Austrian),German (Standard),German (Swiss),Italian (Standard),Italian (Swiss),Japanese,Korean,Norwegian (Bokmal),Norwegian (Nynorsk),Portuguese (Brazilian),Portuguese (Standard),Spanish (Mexican),Spanish (Modern),Spanish (Standard),Swedish,ar,ar_AE,ar_BH,ar_DZ,ar_EG,ar_IQ,ar_JO,ar_KW,ar_LB,ar_LY,ar_MA,ar_OM,ar_QA,ar_SA,ar_SD,ar_SY,ar_TN,ar_YE,be,be_BY,bg,bg_BG,ca,ca_ES,cs,cs_CZ,da,da_DK,de,de_AT,de_CH,de_DE,de_LU,el,el_GR,en,en_AU,en_CA,en_GB,en_IE,en_IN,en_NZ,en_US,en_ZA,es,es_AR,es_BO,es_CL,es_CO,es_CR,es_DO,es_EC,es_ES,es_GT,es_HN,es_MX,es_NI,es_PA,es_PE,es_PR,es_PY,es_SV,es_UY,es_VE,et,et_EE,fi,fi_FI,fr,fr_BE,fr_CA,fr_CH,fr_FR,fr_LU,hi_IN,hr,hr_HR,hu,hu_HU,is,is_IS,it,it_CH,it_IT,iw,iw_IL,ja,ja_JP,ko,ko_KR,lt,lt_LT,lv,lv_LV,mk,mk_MK,nl,nl_BE,nl_NL,no,no_NO,no_NO_NY,pl,pl_PL,pt,pt_BR,pt_PT,ro,ro_RO,ru,ru_RU,sh,sh_YU,sk,sk_SK,sl,sl_SI,sq,sq_AL,sr,sr_YU,sv,sv_SE,th,th_TH,th_TH_TH,tr,tr_TR,uk,uk_UA,zh,zh_CN,zh_HK,zh_TW
OS
server - struct
ADDITIONALINFORMATION[empty string]
ARCHx86
BUILDNUMBER[empty string]
NAMEWindows 2003
VERSION5.2
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 22, 2009 Dec 22, 2009

"2) What happens when you move the test CFC to the (web) root directory and test them there?"

Same thing.

I do see a new folder in the webroot called "nsitest" with a test.cfm and test.cfc in there - same error.  So it looks like at least someone @ NSI copied my test files into their own little directory to see the results.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2009 Dec 22, 2009
EXPIRATION    {ts '2009-12-20 04:00:40'}

PRODUCTVERSION    7,0,1,116466

Has your provider's license expired?

Why hasn't there been an upgrade to MX7.0.2?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 22, 2009 Dec 22, 2009
So it looks like at least someone @ NSI copied my test files into their own little directory to see the results.

Worry less about the cockroach, more about where you live.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources