Java Exception

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Jonathan Mortensen
Posts: 32
Joined: Wed Jul 06, 2016 1:33 pm

Java Exception

Post by Jonathan Mortensen » Fri Jul 15, 2016 11:29 am

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

User avatar
Ayman Habib
Posts: 2236
Joined: Fri Apr 01, 2005 12:24 pm

Re: Java Exception

Post by Ayman Habib » Fri Jul 15, 2016 1:23 pm

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

User avatar
Michael DelSanto
Posts: 2
Joined: Tue Aug 16, 2016 5:58 am

Re: Java Exception

Post by Michael DelSanto » Fri Aug 19, 2016 12:08 pm

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.

User avatar
Ayman Habib
Posts: 2236
Joined: Fri Apr 01, 2005 12:24 pm

Re: Java Exception

Post by Ayman Habib » Fri Aug 19, 2016 12:26 pm

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

User avatar
Michael DelSanto
Posts: 2
Joined: Tue Aug 16, 2016 5:58 am

Re: Java Exception

Post by Michael DelSanto » Fri Aug 19, 2016 12:57 pm

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.

User avatar
shayan moradkhani
Posts: 41
Joined: Fri May 05, 2017 5:12 pm

Re: Java Exception

Post by shayan moradkhani » Tue May 16, 2017 7:37 am

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

User avatar
Thomas Uchida
Posts: 1777
Joined: Wed May 16, 2012 11:40 am

Re: Java Exception

Post by Thomas Uchida » Tue May 16, 2017 12:17 pm

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).

User avatar
shayan moradkhani
Posts: 41
Joined: Fri May 05, 2017 5:12 pm

Re: Java Exception

Post by shayan moradkhani » Wed May 17, 2017 12:12 am

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

User avatar
Thomas Uchida
Posts: 1777
Joined: Wed May 16, 2012 11:40 am

Re: Java Exception

Post by Thomas Uchida » Wed May 17, 2017 2:35 am

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.

User avatar
shayan moradkhani
Posts: 41
Joined: Fri May 05, 2017 5:12 pm

Re: Java Exception

Post by shayan moradkhani » Wed May 17, 2017 4:01 am

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

POST REPLY