Monthly Archives: December 2017

Coldfusion CreateDynamicProxy Gotchas

I couldn’t easily find any information about issues using a proxied CFC, so here are things I have experienced and what I did to get around the issue.

1. Error with ExpandPath when passing proxied object to Java function as callback

When I create a proxy object and pass it into a Java object as a callback, if I tried using ExpandPath in any of the functions that are called from the Java object it reports an error.  I could not get the actual error information, however if I declare the Path with expand path on initialization of the CFC and use that variable, everything worked correctly.

2. Application scope not available when passing proxied object to Java function as callback

When attempting to set a value to an application variable in a callback function, the variable is not modified in the application scope.  This is solved by declaring a reference to the application scope when the CFC is initialized.

Ex. variables.App = Application;