Page 1 of 2

Java Exception

Posted: Fri Jul 15, 2016 11:29 am
by jonmortensen
Hi everybody. I am new to using OpenSim, and I am trying to work through the "dynamic walking challenge" example. I have successfully configured MATLAB for scripting, but I am having problems with the initSystem() command. When I run the Main_WalkerForwardSim.m script included in the example I get the following error:

Error using Main_WalkerForwardSim (line 36)
Java exception occurred:
java.lang.RuntimeException: SimTK Exception thrown at VisualizerProtocol.cpp:157:
Error detected by Simbody method VisualizerProtocol::ctor(): Unable to spawn executable
'simbody-visualizer' from directories:
c:\Program Files\MATLAB\R2015a\bin\win64\
D:/Dev/OpenSim33/installx64/Simbody/bin/
C:\Program Files\Simbody\bin\
C:\Program Files\SimTK\bin\
Final system error was errno=2 (No such file or directory).
(Required condition 'status == 0' was not met.)


at org.opensim.modeling.opensimModelJNI.Model_initSystem(Native Method)

at org.opensim.modeling.Model.initSystem(Model.java:179)


If you have any ideas, please help me out.

Thanks

Re: Java Exception

Posted: Fri Jul 15, 2016 1:23 pm
by aymanh
Hi Jonathan,

The exception you report happens when trying to launch the visualizer. The visualizer is a separate executable usually located under install_dir/bin/simbody-visualizer.exe There's a fixed set of locations that we search for it.

The error indicates that the code couldn't locate the executable. Possible reasons:
- Stale settings of env. variable OPENSIM_HOME or SIMBODY_HOME likely because the installation location was changed (post installation) or multiple or old versions of either package are located on the machine.

I suggest you check for the current settings of these environment variables and the presence of the executable above and let us know what you find out. What version of OpenSim are you using, and what's your development environment?

Best regards,
-Ayman

Re: Java Exception

Posted: Fri Aug 19, 2016 12:08 pm
by miked42
I'd like to hop in as I have the same problem. I see the OP didn't reply, but I have the exact same error message. I've checked, and the simbody-visualizer executable is in the opensim3.3\bin folder (my install directory, which I didn't change after install, is C:\OpenSim3.3). I also verified that OpenSim3.3 is in the OPENSIM_HOME environmental variable. The more odd thing I find is that I do not get this error when I am logged in with my admin account (Win7x64), but I get this error when I am logged into my standard user account. I am an admin setting this up for one of my customers, so they will not have an admin account to run this in. I was wondering if you could assist, or if I should submit a new forum post.

Thanks.

Re: Java Exception

Posted: Fri Aug 19, 2016 12:26 pm
by aymanh
Hi Michael,

If everything works in admin mode but not user mode, I'd check that the environment variables are set system-wide, (system variables top-section) and not per user (user variables).

Please let us know what you find out.

Thanks,
-Ayman

Re: Java Exception

Posted: Fri Aug 19, 2016 12:57 pm
by miked42
Ayman, you're the best! I can't believe I missed that. It was only set as a user variable not a system variable. Oh well, better pay closer attention next time.

Re: Java Exception

Posted: Tue May 16, 2017 7:37 am
by student
hello
i have just been given the credential of administration from my work place. i cannot see the opensim in my user variables and not in my system variables.
can anybody suggest something?
regards

Re: Java Exception

Posted: Tue May 16, 2017 12:17 pm
by tkuchida
If you would like to use OpenSim, you need to install it locally. Installers can be found on the Downloads page here: https://simtk.org/frs/?group_id=91. By default, the installer will add <OpenSim installation directory>\bin to your system PATH environment variable. If OpenSim has already been installed, you could uninstall it and re-install it with admin privileges, or you could add <OpenSim installation directory>\bin to your system PATH environment variable manually. There may be additional helpful information on the "Installation Guide" pages in the Confluence documentation (http://simtk-confluence.stanford.edu:80 ... tion+Guide).

Re: Java Exception

Posted: Wed May 17, 2017 12:12 am
by student
hi
thank you for your response.
the program was installed under admin credential.
should i use "<OpenSim installation directory>\bin" as variable value or variable name?
and what should i use for the other one?
thank you very much
regards
Shayan

Re: Java Exception

Posted: Wed May 17, 2017 2:35 am
by tkuchida
should i use "<OpenSim installation directory>\bin" as variable value or variable name? and what should i use for the other one?
I'm assuming you're running Windows and you know how to edit the environment variables. There should be a system variable named "Path". Edit the value of this variable by adding "<OpenSim installation directory>\bin" to the semicolon-separated list, where "<OpenSim installation directory>" is the directory in which you installed OpenSim.

Re: Java Exception

Posted: Wed May 17, 2017 4:01 am
by student
hi
i checked everything was fine, but still i get:
Error using TugOfWar_CompleteRunVisualize (line 38)
Java exception occurred:
java.lang.RuntimeException: SimTK Exception thrown at VisualizerProtocol.cpp:157:
Error detected by Simbody method VisualizerProtocol::ctor(): Unable to spawn executable 'simbody-visualizer' from directories:
c:\Program Files\MATLAB\R2015b\bin\win64\
D:/Dev/OpenSim33/installx64/Simbody/bin/
C:\Program Files\Simbody\bin\
C:\Program Files\SimTK\bin\
Final system error was errno=2 (No such file or directory).
(Required condition 'status == 0' was not met.)


at org.opensim.modeling.opensimModelJNI.Model_initSystem(Native Method)

at org.opensim.modeling.Model.initSystem(Model.java:179)
regards