Java Exception

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
User avatar
Thomas Uchida
Posts: 1787
Joined: Wed May 16, 2012 11:40 am

Re: Java Exception

Post by Thomas Uchida » Wed May 17, 2017 11:34 am

Thank you for providing more information about the issue. Have you confirmed that classpath.txt, librarypath.txt, and MATLAB's path have been properly set? See the "Scripting with Matlab" page in the Confluence documentation (http://simtk-confluence.stanford.edu:80 ... ith+Matlab, "Manual Setup" section).

User avatar
Angelos Plastropoulos
Posts: 1
Joined: Tue Jun 13, 2017 2:09 am

Re: Java Exception

Post by Angelos Plastropoulos » Tue Jun 13, 2017 7:44 am

Dear all,

I have a similar problem (with exception) although not the same error which the others had.
I use Matlab R2017a and openSim 3.3 on windows 10 virtual machine (hosted by virtualbox).

When I try to run the first examples (OpenSimCreateTugOfWarModel.m and TugOfWar_CompleteRunVisualize.m)
when the execution reach the last line of the visualization script (tool.run()), it returns the following exception:

Code: Select all

Loaded model TugOfWar from file tug_of_war_muscles_controller.osim
Running tool tugOfWar.
No external loads will be applied (external loads file not specified).
Error using visualTugOfWar (line 57)
Java exception occurred:
java.lang.RuntimeException: SimTK Exception thrown at VisualizerProtocol.cpp:364:
  Error detected by Simbody method VisualizerProtocol: An attempt to write() 1 bytes to pipe 16 failed
  with errno=22 (Invalid argument).
  (Required condition 'status!=-1' was not met.)


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

	at org.opensim.modeling.ForwardTool.run(ForwardTool.java:117)
when I try as windows Admin and

Code: Select all

Loaded model TugOfWar from file tug_of_war_muscles_controller.osim
Running tool tugOfWar.
No external loads will be applied (external loads file not specified).
MODEL: TugOfWar

ANALYSES (0)

BODIES (2)
body[0] = ground (mass: 0) (inertia: 1 0 0 0 1 0 0 0 1)
body[1] = Block (mass: 20) (inertia: 1 0 0 0 1 0 0 0 1)

ACTUATORS (2)
actuator[0] = muscle1
actuator[1] = muscle2
numStates = 17
numCoordinates = 6
numSpeeds = 6
numActuators = 2
numBodies = 2
numConstraints = 0
numProbes = 0

STATES (16)
y[0] = blockToGround_xRotation
y[1] = blockToGround_yRotation
y[2] = blockToGround_zRotation
y[3] = blockToGround_xTranslation
y[4] = blockToGround_yTranslation
y[5] = blockToGround_zTranslation
y[6] = blockToGround_xRotation_u
y[7] = blockToGround_yRotation_u
y[8] = blockToGround_zRotation_u
y[9] = blockToGround_xTranslation_u
y[10] = blockToGround_yTranslation_u
y[11] = blockToGround_zTranslation_u
y[12] = muscle1.activation
y[13] = muscle1.fiber_length
y[14] = muscle2.activation
y[15] = muscle2.fiber_length


Integrating from 0 to 3
ForwardTool::run() caught exception 
SimTK Exception thrown at VisualizerProtocol.cpp:370:
  Error detected by Simbody method VisualizerProtocol: An attempt to write() 1 bytes to pipe 18 failed with errno=22 (Invalid argument).
  (Required condition 'status!=-1' was not met.)

Printing results of investigation tugOfWar to ./.
when I try as normal windows user.

Do you have any idea of what went wrong in the procedure?
Yes, I have checked the required paths etc

Kind regards,
Angelos

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

Re: Java Exception

Post by shayan moradkhani » Wed Jun 28, 2017 6:38 am

tkuchida wrote:Thank you for providing more information about the issue. Have you confirmed that classpath.txt, librarypath.txt, and MATLAB's path have been properly set? See the "Scripting with Matlab" page in the Confluence documentation (http://simtk-confluence.stanford.edu:80 ... ith+Matlab, "Manual Setup" section).
i have checked everything, however i keep getting this error.
regards
Shayan

User avatar
jimmy d
Posts: 1375
Joined: Thu Oct 04, 2007 11:51 pm

Re: Java Exception

Post by jimmy d » Wed Jun 28, 2017 10:55 am

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.)
I had this same issue; it was fixed through making sure my paths were correct. I followed the below steps -

(i) Use a tool like Rapid Environment Editor to edit your path variables. It should look like this;
path_editor.png
path_editor.png (197.95 KiB) Viewed 284 times
(ii) Use the configureOpenSim script and point it at the top level of your OpenSim installation. You should see this message if done correctly;
configure_message.png
configure_message.png (399.98 KiB) Viewed 284 times
(iii) Restart Matlab.

Once I did this, TugOfWar_CompleteRunVisualize.m ran fine.

POST REPLY