PDA

View Full Version : java.io.FilePermission BeanFactory.cfc read



davidd
September 20th, 2010, 10:49 AM
The following is an error we have encountered on some versions of the ColdBox Framework:



Security: The requested template has been denied access to BeanFactory.cfc.
The following is the internal exception message: access denied (java.io.FilePermission BeanFactory.cfc read)

The error occurred in \coldbox\system\web\services\PluginService.cfc: line 343
...


The following is the code where the error occurs:



342: // Check Extensions locations First
343: if( fileExists(pluginFilePath) ){
344: return getExtensionsPath() & "." & arguments.plugin;


The cause of this error is due to the ColdBox Framework changing a relative component path into a file path in order to check if the component exists. However, since it is using a relative file path, the security sandbox causes this error. The solution for this is to first convert the relative path to a full path using the 'expandPath()' function.

The following is the code after updating it with the expandPath function:



342: // Check Extensions locations First
343: if( fileExists(expandPath(pluginFilePath)) ){
344: return getExtensionsPath() & "." & arguments.plugin;



David D.