Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
API java class error
Posted 30.06.2015, 04:17 GMT-4 Version 5.1, Version 5.2 1 Reply
Please login with a confirmed email address before reporting spam
I am coupling a COMSOL heat transport model with the universal parameter estimation software PEST in Windows. I realize there is an optimization module for COMSOL but it's performance is far superseded by PEST. To achieve the coupling I need the model to read an input file with parameter values (that PEST can modify prior to the model being run) and to write state variables to an output file (for PEST to calculate the objective function and its derivatives). Also, I need to be able to trigger a model run, with the API modifications, from the command line.
To the best of my knowledge, the coupling must be done by the COMSOL API. I have experience with the FEFLOW and Minecraft APIs which are both easy to use, in particular the former. Unexpectedly, I am struggling a lot with the COMSOL API.
Here is what I have done so far:
I have exported the cylinder_conduction example model to a java file and compiled it with Eclipse as a sort of proof of concept (the feeder_clamp model is nowhere to be found). The code runs perfectly in Eclipse and makes a connection to the COMSOL server that I have set up (which can be checked in the server log). I use the server connection to check that the model code is actually being run.
However, loading the class file directly into COMSOL produces an error:
Error running Java Class
-Detail: Error_running_java_class
If I run the class file from the command line I receive an identical error. I have included the installation paths of the jdk and the COMSOL home directory in the Windows path variable.
On a sidenote: If I use the standalone option (ModelUtil.initStandalone(true)) as suggested in the API reference, I get the following error: "Input length must be multiple of 16 when decrypting with padded cipher".
I am at my wits end here. I can run the code in Eclipse which is some sort of workaround because I can trigger it from the command line but it is definitely not an optimal way of implementing the API module. Can anyone help me here?
Best regards,
Søren
Hello Søren Erbs Poulsen
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.