This is not a Mendix user role issue. It is a Windows file system access issue.
You should not read files directly from deployment\model\resources. That folder is managed by the runtime and may not allow direct access.
Instead, read the file from project_directory/resources using a resource stream (classpath) in Java, or copy the file to a safe folder like deployment\data and then use FileDocumentFromFile.
Do not use the deployment\model\resources path directly.
If this resolves the issue, please close the topic.
Hi,
This issue is not related to user role permissions or running Studio Pro as Administrator.
The error occurs because you are trying to access a file inside:
deployment/model/resources
using a direct filesystem path. In Mendix, files inside the resources folder are packaged into the model and are not meant to be accessed via raw file paths at runtime.
That is why you are getting:
java.io.FileNotFoundException (Access is denied)
The runtime does not allow direct file system access to that directory.
When you use JA_GetResourcePath, it may return a valid path during development, but at runtime:
Mendix does not guarantee file-level access to deployment/model/resources.
You must use getResourceAsStream(), not File paths.
In a Java action:
InputStream is = this.getClass().getClassLoader().getResourceAsStream("Configuration/yourfile.json");
Then use the stream to create a FileDocument.
Example:
IMendixObject fileDoc = Core.instantiate(context, "System.FileDocument"); Core.storeFileDocumentContent(context, fileDoc, "yourfile.json", is);
This is the correct and supported approach.
deployment/model/resources directly.resources are read-only.data/tmp directory instead.Use:
Core.getConfiguration().getTempPath()
This gives a valid writable runtime path.
The error happens because you are attempting direct filesystem access to a packaged model resource.
In Mendix, resources must be accessed via getResourceAsStream() using the classloader.
Switching to stream-based access will resolve the issue completely.