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.
Can't run Model File for Java in Eclipse
Posted 4 feb 2017, 20:13 GMT-5 3 Replies
Please login with a confirmed email address before reporting spam
I just started working with COMSOL so I don't know much, but I am trying to automate a process in COMSOL by exporting the COMSOL file into Eclipse as a Model file and running it in Eclipse. The idea is to set up many electrodes and one-by-one test each electrode while disabling all others. All that I'm trying to produce are numerical results exported into a text file, so the GUI is not so important.
The problem is when I run the code I get this error:
java.lang.UnsatisfiedLinkError: com.comsol.nativejni.server.FlRunnable.createRunInfo(Lcom/comsol/nativejni/CPointer;)V
at com.comsol.nativejni.server.FlRunnable.createRunInfo(Native Method)
at com.comsol.nativejni.server.FlRunnable.<init>(Unknown Source)
at com.comsol.nativeutil.runnable.f.<init>(Unknown Source)
at com.comsol.model.method.GeomSequenceMethod$1.<init>(Unknown Source)
at com.comsol.model.method.GeomSequenceMethod.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.comsol.model.internal.impl.PrimitiveModelEntityImpl.a(Unknown Source)
at com.comsol.model.internal.impl.PrimitiveModelEntityImpl.bl(Unknown Source)
at com.comsol.model.internal.impl.GeomSequenceImpl.method(Unknown Source)
at com.comsol.model.internal.impl.GeomSequenceImpl.method(Unknown Source)
at com.comsol.model.internal.impl.ModelEntityImpl.h_(Unknown Source)
at com.comsol.model.internal.impl.ModelEntityImpl.tag(Unknown Source)
at com.comsol.model.internal.impl.GeomListImpl.doCreate(Unknown Source)
at com.comsol.model.internal.impl.GeomListImpl.a(Unknown Source)
at com.comsol.model.internal.impl.GeomListImpl$1.a(Unknown Source)
at com.comsol.model.internal.impl.GeomListImpl$1.execute(Unknown Source)
at com.comsol.model.clientserver.ClientManager$1.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Failed to find methods for: com.comsol.model.internal.impl.GeomSequenceImpl
---------------------------------------
I did some research already and I have already configured the build path in Eclipse to include all of the .jar files in the /plugins directory of COMSOL, so that doesn't seem to be the problem.
The error is actually coming from the beginning of my code in the run() method:
public static Model run() {
Model model = ModelUtil.create("Model");
model.modelPath("C:\\Users\\Marcel\\workspace\\New folder");
model.comments("Untitled\n\n");
model.modelNode().create("comp1");
model.geom().create("geom1", 3); <----the error is here
model.mesh().create("mesh1", "geom1");
I am positive that the error is occurring when creating the geometry because commenting that line gets rid of the error message but causes the program run for an indefinite amount of time.
Can anybody help me solve this problem?
Thanks,
Aaron
Hello Aaron Yu
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.