ColdFusion - no function found [functionName]

This code works in my dev environment, but not in a production environment. I load CFCs into the scope of the session, if that matters. You can see from this dump that CFC has a function with a name getQuestions, but the function that calls it does not find it. I get an error

"No matching function [getQuestions] found.

getQuestions is a function added after my last click.

I checked the server configuration for both dev and prod server, and they are the same, so I'm not sure why this is happening. A prod environment is a virtual machine, if that matters. Can anyone shed some light on this one?

enter image description here

+4
source share
1 answer

( CFC), , ( .cfc), , .

, , :

// Write a component
fileWrite("a.cfc", "component { function foo(){return 'bar';} }");

// instantiate that component
a = new a();
writeOutput(a.foo()); // writes "bar" to the page

// now let rewrite the file
fileWrite("a.cfc", "component { function bar(){return 'foo';} }");

writeOutput(a.foo()); // still writes "bar" to the page
writeOutput(a.bar()); // error - no such method

a.cfc a - .

Survey . - ​​ - , . structDelete() (session.survey = new Survey()), , , - .

, , reset, ?sessionreset=true Application.cfc OnRequestStart(), . .

0

Source: https://habr.com/ru/post/1690624/


All Articles