Hello Christopher Lioi
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.
Please login with a confirmed email address before reporting spam
Posted:
9 years ago
23 mag 2016, 03:49 GMT-4
I have exactly the same problem.... but in my case the java.io.filepermission displays the error when I try to export the results from the model into a .txt file (running from batch mode a .class file)
My .java file reads:
[...]
model.batch.run();
model.result().numerical("av1").setResult();
model.result().export("plot1").set("filename", "/PATH/ExportFileName.txt");
model.result().export("plot1").run();
return model;
}
The file is compiled with no problem but, when I try to run the model from shell (using comsol batch -inputfile M.class -outputfile Mo.mph -batchlog L.log) the .log file contains this error:
/******************/
/*****Error********/
/******************/
access denied ("java.io.FilePermission" "/PATH/ExportFileName.txt" "write")
Saving model: Mo.mph
If somebody knows how to deal with that please share.
I have exactly the same problem.... but in my case the java.io.filepermission displays the error when I try to export the results from the model into a .txt file (running from batch mode a .class file)
My .java file reads:
[...]
model.batch.run();
model.result().numerical("av1").setResult();
model.result().export("plot1").set("filename", "/PATH/ExportFileName.txt");
model.result().export("plot1").run();
return model;
}
The file is compiled with no problem but, when I try to run the model from shell (using comsol batch -inputfile M.class -outputfile Mo.mph -batchlog L.log) the .log file contains this error:
/******************/
/*****Error********/
/******************/
access denied ("java.io.FilePermission" "/PATH/ExportFileName.txt" "write")
Saving model: Mo.mph
If somebody knows how to deal with that please share.
Lars Gregersen
COMSOL Employee
Please login with a confirmed email address before reporting spam
Posted:
9 years ago
26 mag 2016, 03:34 GMT-4
Hi
I'm not sure if this suggestion fixes your problem, but you shouldn't use single back-slashes in Java code. Use double back-slashes instead.
--
Lars Gregersen
Comsol Denmark
Hi
I'm not sure if this suggestion fixes your problem, but you shouldn't use single back-slashes in Java code. Use double back-slashes instead.
--
Lars Gregersen
Comsol Denmark
Please login with a confirmed email address before reporting spam
Posted:
8 years ago
3 ago 2016, 08:36 GMT-4
It looks like the necessary permissions have not been granted to the comsolbatch executable. In the GUI of my comsol installation (on Linux) the relevant settings are found in "Options -> Preferences -> Security". Here "File system access" must be set to "All files".
I am not sure how to change these settings for the comsolbatch executable. Maybe come comsol people can enlighten us? :)
It looks like the necessary permissions have not been granted to the comsolbatch executable. In the GUI of my comsol installation (on Linux) the relevant settings are found in "Options -> Preferences -> Security". Here "File system access" must be set to "All files".
I am not sure how to change these settings for the comsolbatch executable. Maybe come comsol people can enlighten us? :)