Copy link to clipboard
Copied
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).
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Could you show us one line that throws the error? The provider may indeed have disabled some tags.
Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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] | ||||||||||||||||||
StackTrace | java.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 |
| ||||||||||||||||||
Type | java.lang.NullPointerException |
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
A natural mistake to make: did you save it as testCFC.cfc
Copy link to clipboard
Copied
Oops. I see you did post an example already. I thought that was BKBK's response.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Steve,
Do you have the "extends" attribute set to some other CFC in your Application.cfc file?.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Yep.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi Steve,
Can you make sure that you have enabled the "Enable Application Variables" in your CFIDE/Administrator panel?.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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."
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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 | |||||||
---|---|---|---|---|---|---|---|
applicationname | ruh | ||||||
dsn | ruh | ||||||
howfarback | -180 | ||||||
initialized | false | ||||||
maxiterations | 10 | ||||||
mdbdsn | ruh | ||||||
settings |
| ||||||
siteroot | http://02f1d12.netsolhost.com/ruhungry/ | ||||||
smtpserver | 127.0.0.1 | ||||||
title | An Alumni Site |
server - struct | |||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
COLDFUSION |
| ||||||||||||||||||
OS |
|
Copy link to clipboard
Copied
"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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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.