views:

553

answers:

3

I am encountering an exception cause by the CFINVOKEARGUMENT line of the following snippet:

<CFOUTPUT query="cfmx.Messages"><CFSILENT>
<CFINVOKE component="com_VUI_RemoveIllegalChars" method="formatString" returnvariable="cfmx.formattedMessage">
   <CFINVOKEARGUMENT name="inString" value="#TTSText#">
</CFINVOKE>
</CFSILENT>

The exact text of the exception is:

Error casting an object of type coldfusion.runtime.NoOperScope cannot be cast to coldfusion.runtime.ApplicationScope to an incompatible type. This usually indicates a programming error in Java, although it could also mean you have tried to use a foreign object in a different way than it was designed. coldfusion.runtime.NoOperScope cannot be cast to coldfusion.runtime.ApplicationScope

Notes:

  • cfmx.Messages is an object returned in a CFPROCRESULT, and upon examination via CFDUMP it does contain the expected data
  • com_VUI_RemoveIllegalChars has not changed at all
  • TTSText is a valid column in the result set
  • My suspicion is that this may be a ColdFusion configuration issue

Thanks in advance to anyone who can shed any light on what may be causing this problem.

EDIT: Complete dump from the exception log:

"Error","jrpp-11","01/06/09","15:11:37",,"coldfusion.runtime.NoOperScope cannot be cast to coldfusion.runtime.ApplicationScope The specific sequence of files included or processed is: C:\Inetpub\wwwroot\ermsvui\proc_playsitestatus.cfm, line: 30 " java.lang.ClassCastException: coldfusion.runtime.NoOperScope cannot be cast to coldfusion.runtime.ApplicationScope at coldfusion.runtime.RuntimeServiceImpl.getFullTagName(RuntimeServiceImpl.java:625) at coldfusion.runtime.TemplateProxyFactory.getFullName(TemplateProxyFactory.java:1082) at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:184) at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:157) at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:1267) at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:1218) at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:358) at cfproc_playsitestatus2ecfm1824676963.runPage(C:\Inetpub\wwwroot\ermsvui\proc_playsitestatus.cfm:30) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:192) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:366) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:279) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:86) at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27) at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70) at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28) at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38) at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46) at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38) at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22) at coldfusion.CfmServlet.service(CfmServlet.java:175) at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89) at jrun.servlet.FilterChain.doFilter(FilterChain.java:86) at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42) at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46) at jrun.servlet.FilterChain.doFilter(FilterChain.java:94) at jrun.servlet.FilterChain.service(FilterChain.java:101) at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106) at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42) at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284) 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 above code snippet contains lines 28 - 32 of proc_playsitestatus.cfm

EDIT:

The value of TTS text is this case is "The message for test is"

The source of com_VUI_RemoveIllegalChars:

<CFCOMPONENT displayname="Format a string for use in VoiceXML" hint="returns a string formatted for voiceXML" output="yes">
    <CFFUNCTION name="formatString" access="public" returntype="string" displayname="Format String" hint="Formats String for VoiceXML">
     <cfargument name="inString" type="string" required="true" displayname="input string" hint="pass in the string to be formatted">
     <CFSET v.messageWithoutChars = replace(inString, "<", "", "all")>
     <CFSET v.messageWithoutChars = replace(v.messageWithoutChars, ">", "", "all")>
     <CFSET v.messageWithoutChars = replace(v.messageWithoutChars, "&", "and", "all")>
     <CFSET v.messageWithoutChars = REReplace(v.messageWithoutChars, "\.+", ".", "all")>
     <CFSET v.messageWithoutChars = replace(v.messageWithoutChars, "!", ".", "all")>
     <CFSET v.messageWithoutChars = replace(v.messageWithoutChars, "\", " ", "all")>
     <CFSET v.messageWithoutChars = replace(v.messageWithoutChars, "/", " ", "all")>
     <CFSET v.messageWithoutChars = REReplace(v.messageWithoutChars, "[[:punct:]]{2,}", " ", "all")>
     <cfreturn v.messageWithoutChars>
    </CFFUNCTION>
</CFCOMPONENT>
+2  A: 

Are you sure about that line #? I'm thinking the error is in the CFC method itself. Can you check that, and if I'm right, post the line from the CFC method?

CF Jedi Master
I won't rule out it being a problem with the CFC, however the exception log (as posted in my most recent edit) is complaining about code in proc_playsitestatus.cfm of which I've posted lines 28 - 32.
hunterjrj
A: 

Without the contents of the com_VUI_RemoveIllegalChars component and the value of the TTSText variable, you're not giving us a lot to go on, here. Could you post those? (I understand that sometimes you can't for NDA/etc reasons)

Adam Tuttle
+1  A: 

The setting "Enable Application Variables" was not enabled in the ColdFusion configuration.

hunterjrj
Interesting, considering your code never mentions the Application scope. Is that used elsewhere that isn't included in your code samples? If not, I'm really curious why this setting would matter.
Adam Tuttle
I've posted all relevant code here, the rest is just cruft dealing with VXML output. This one had my colleague and I scratching our heads as well. I'm going to investigate this further and I will post my results once I have some.
hunterjrj
Ah yes, that would make sense. The clue is the error message: "coldfusion.runtime.NoOperScope cannot be cast to coldfusion.runtime.ApplicationScope", indicating that you're trying to use the Application scope. Inside a <CFOUTPUT> or <CFLOOP>, the scope resolution rules change, so that may be a clue. Also, what is the "v" scope in your component? It's possible that the reason the error is getting thrown on the <CFINVOKE> is because it's invoking an implicit constructor on the component (whatever initializes the "v" variable) before invoking the desired method.
Daniel Pryden