Problem with Multicontext and .dll libraries

Use this forum to post Vensim related questions.
Post Reply
amotol
Junior Member
Posts: 2
Joined: Mon Sep 14, 2009 5:06 pm

Problem with Multicontext and .dll libraries

Post by amotol »

We are working on WebApp improvement, which it can let us manage several threads simultaniusly when we run a Vensim Model.

The original aplication Works perfectly with the “Free” Version, but we only worked with a single context. So that´s the reason why we adquired the “Multicontext licence”.

The problem that we found is that when we try to access from our java classes to any method with Multicontext, an exception appears:

java.lang.UnsatisfiedLinkError: ContextAdd
at Vensim2009.ContextAdd(Native Method)
at VensimThreadSim.iniciaHilo(VensimThreadSim.java:65)

We think that the problem is that it doesn’t really load correctly the vendlstc.dll that should substitute the original venjava.dll, which is installed automatically by Vensim. We don’t know if we mustt install them using an special way, or move them to a specific path

We have also run the VensimMCTester which is included with the Multicontext, for know if it has been installed correctly, and the result was:

D:\Proyecto Fin Carrera\Dll multicontext>java -cp vensim.jar; VensimMCTester
Vensim DLL Version
try a context 0 simulation
Failed to simulate on conext 0
Test simulation on a non exististent context - should fail
Failed to simulate on conext 3
Context add failed
Context add failed
Context add failed
Context add failed
Context add failed
Launching thread 0
Launching thread 1
Launching thread 2
Launching thread 3
Launching thread 4
Failed to simulate on conext 0
Finishing with cid 0
Failed to simulate on conext 0
Finishing with cid 0
Failed to simulate on conext 0
Finishing with cid 0
Failed to simulate on conext 0
Finishing with cid 0
Failed to simulate on conext 0
Finishing with cid 0


Anybody can help us, please?

:(
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

It looks like you are connecting to the regular DLL and perhaps a very old version. First remove any copies of venjava.dll you can find - this is obsolete and will confuse the situation. Then be sure that the the first line of VensimMCTester refers to "vendlstc" and not "vendll32" or "venjava"

Then you will probably need to put vendlstc.dll and the .vrf file in the windows\system32 directory. You can also specify java search paths for libraries, but that takes some experimentation.

After that the MCTester should work - and you can then test your own application.
Post Reply