tracker issue : CF-3508592

select a category, or use search below
(searches all categories and all time range)
Title:

CF9.0.1 CHF 3 breaks valid CFC syntax

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): Tom Chiverton / Tom Chiverton (Tom Chiverton)

Created: 02/28/2013

Components: Core Runtime

Versions: 9.0.1

Failure Type: Non Functioning

Found In Build/Fixed In Build: 9.0.1 /

Priority/Frequency: Major / Some users will encounter

Locale/System: English / Win XP All

Vote Count: 1

Problem Description: Valid CFCs throw undefined variable run time errors, fine without CHF3 applied.

Steps to Reproduce:
Put both files in test configuration on a CF 9.0.1 server with CHF3. 1.6 or 1.7 JVM doesn't make much difference, and visit the .cfml page

Actual Result:
 Element NEWCAMPAIGNID is undefined in ARGUMENTS. 

Expected Result:
 No output

Any Workarounds:
 Remove the CHF .jar file or rewrite to user intermediate variables

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3508592

External Customer Info:
External Company:  
External Customer Name: ChivertonT
External Customer Email:  
External Test Config: chf3.cfc:

component{

/* this functionally identical code works

public function moveToNewCampaign (string userId,numeric incomingId, numeric newCampaignId) boolean{

	var old=variables.incomingGateway.where({'id'=arguments.incomingId})[1];

	var a={'campaignId'=arguments.newCampaignId};

	var b={'id'=arguments.incomingId};

	variables.incomingGateway.updateWhere(fields=a,where=b);



	variables.logFileGateway.logForCurrentUser(

						userId=arguments.userId,

						eventType="Moved reply",

						eventDetail="id #arguments.incomingId# from campaign #old.getCampaignId()# to #arguments.newCampaignId#"

						);

}*/



public function moveToNewCampaign (string userId,numeric incomingId, numeric newCampaignId) boolean{

	var old=variables.incomingGateway.where({'id'=arguments.incomingId})[1];



	variables.incomingGateway.updateWhere(fields={'campaignId'=arguments.newCampaignId},where={'id'=arguments.incomingId});



	variables.logFileGateway.logForCurrentUser(

						userId=arguments.userId,

						eventType="Moved reply",

						eventDetail="id #arguments.incomingId# from campaign #old.getCampaignId()# to #arguments.newCampaignId#"

						);

}



}



chf3.cfml:

<cfscript>

	obj=createObject('chf3');

</cfscript>

Attachments:

Comments:

Can you please attach a repro case with this issue. (Comment added from ex-user id:gtiwari)
Comment by Adobe D.
16134 | March 01, 2013 02:02:40 AM GMT
Both files you need are there. On CF9.0.1 chf2 this produces no output, the method is never run, so it's dependencies don't matter. Install chf3 and it breaks, trying to run the method even though I didn't call it. Further discussion @ http://forums.adobe.com/thread/1162002
Comment by External U.
16135 | March 01, 2013 03:17:52 AM GMT
Can't reproduce on a clean CF9.0.2 uppgrade to JVM 1.7 and it's CHF1 and the 9.0.1 installers are now gone.
Comment by External U.
16136 | March 01, 2013 06:13:53 AM GMT
This does reproduce on our staging 32bit Linux CF9.0.1, previously on CHF2 plus all hot fixes prior to CHF3.
Comment by External U.
16137 | March 01, 2013 07:13:32 AM GMT
Rewriting method signature to be public boolean function moveToNewCampaign (string userId,numeric incomingId, numeric newCampaignId) { make no difference
Comment by External U.
16138 | March 01, 2013 07:21:06 AM GMT
Also occurs with CFML methods : <cfcomponent> <cffunction name="getLoggedInUserCompany" access="private"> <cfargument name="dsn"> <cfreturn variables.ClientsGateway.where(ops=[['datasource','=',arguments.dsn]])[1]/> </cffunction> <cfcomponent> again, this is in a CFC that is just being created with createObject, not run. The stack trace is coldfusion.runtime.UndefinedElementException: Element DSN is undefined in ARGUMENTS. at coldfusion.runtime.CfJspPage.resolveCanonicalName(CfJspPage.java:1724) at coldfusion.runtime.CfJspPage._resolve(CfJspPage.java:1620) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1794) at coldfusion.runtime.CfJspPage._resolveAndAutoscalarize(CfJspPage.java:1787) at cfFormBuilder2ecfc274175501.runPage(/wwwroot/development/poc-trunk/com/ev/service/FormBuilder.cfc:6) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.runtime.TemplateProxyFactory.resolveComponentHelper(TemplateProxyFactory.java:524) at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:224) at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:159) at coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:149) at coldfusion.cfc.ComponentProxyFactory.getProxy(ComponentProxyFactory.java:62) at coldfusion.runtime.CFPage.CreateObject(CFPage.java:4815) at cft2ecfml340182039.runPage(/wwwroot/development/poc-trunk/t.cfml:1) at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231) at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416) at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65) at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:360) at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48) at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40) at coldfusion.filter.PathFilter.invoke(PathFilter.java:94) 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.filter.CachingFilter.invoke(CachingFilter.java:62) at coldfusion.CfmServlet.service(CfmServlet.java:201) 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:286) 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) Line 6 of FormBuilder.cfc is the cfreturn from the private method. The calling page is just doing <cfset r=createObject('com.ev.service.FormBuilder')/>
Comment by External U.
16139 | March 01, 2013 07:32:59 AM GMT
Rolling back WEB-INF, lib and CFIDE dirs to their pre-CHF3 state i.e. with CHF2 plus hf8 makes the exact same code no longer thow an RTE as expected.
Comment by External U.
16140 | March 01, 2013 07:49:16 AM GMT
Please contact me directly for link to a video showing this happening only after CHF3 install. It shows some details of our CFIDE so not public.
Comment by External U.
16141 | March 01, 2013 09:44:16 AM GMT
I've seen Tom run the code on his machine, and can verify this happens. I cannot replicate on 9.0.2 CHF1, but will try on CF 9.0.1 CHF3 early next week. Note that the erroring code is NOT being called by the repro case, merely the act of instantiating the CFC causes this runtime error (not a compile time error, which I might have expected). Loading the CFC via getComponentMetadata() did not cause the problem. On Tom's second repro case this line errors: <cfreturn variables.ClientsGateway.where(ops=[['datasource','=',arguments.dsn]])[1]/> If it's split into this: <cfset var cgResult = variables.ClientsGateway.where(ops=[['datasource','=',arguments.dsn]])> <cfset var returnValue = cgResult[1]> <cfreturn returnValue> It does not error. NB: this code is NOT being called, it's merely in the CFC that is being instantiated, within a PRIVATE method. This is the weirdest thing I have seen in CF.
Comment by External U.
16142 | March 01, 2013 11:08:12 AM GMT
You can also trigger the bug with something like variables.incomingGateway.updateWhere(fields={'mailtype'=arguments.newType},where={id=arguments.incomingId}) in a private method. Note, doesn't matter incomingGateway isn't defined, and that you don't call the method, just doing createObject() is enough to cause an RTE when it shouldn't even be attempting to run.
Comment by External U.
16143 | March 01, 2013 11:23:10 AM GMT
On the forums, Piyush Nayak says "We, at Adobe, are able to observe the issue. We are working on fixing this."
Comment by External U.
16144 | March 04, 2013 03:51:04 AM GMT
I've had this same problem in CF 9.0.2/Linux, but have not applied CHF3. In our case we were using the "new" operator to instantiate the CFC, not createObject and I could not figure out why a method within the CFC was being executed (not the init method, but a seemingly random public method in the CFC).
Vote by External U.
16148 | March 04, 2013 12:24:58 PM GMT
This looks like a similar bug, where CF is executing code in an implicit struct that shouldn't be : https://bugbase.adobe.com/index.cfm?event=bug&id=CF-3512878
Comment by External U.
16145 | March 05, 2013 03:21:58 AM GMT
Fixed in CHF4 - http://blogs.coldfusion.com/post.cfm/new-chfs-for-cf-9-and-cf-9-0-1#comment-0D0A0E56-A09F-F880-F86CE3FF48E5D250
Comment by External U.
16146 | March 11, 2013 05:22:37 AM GMT
This fix was not part of CHF3 which is why the issue was occurring. It has now been included in CHF4.
Comment by Nimit S.
16147 | March 11, 2013 07:52:50 AM GMT