Search code examples
javacomjacobptv-vissim

Jacob Error: Can't get object clsid from progid


I'm trying to run Vissim 8 (student version) using java and to do that I'm using jacob. Now I'm not sure what I'm doing wrong because I'm new to jacob. This is the code I'm trying to run:

import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Variant;

public class test {
 public static void main(String[] args) {
    // TODO Auto-generated method stub
    ActiveXComponent vis = new ActiveXComponent("Vissim.Vissim"); 
    vis.setProperty("Visible", new Variant(true));
 }

}

This is the error I get:

Exception in thread "main" com.jacob.com.ComFailException: 
Can't get object clsid from progid
at com.jacob.com.Dispatch.createInstanceNative(Native Method)
at com.jacob.com.Dispatch.<init>(Dispatch.java:99)
at com.jacob.activeX.ActiveXComponent.<init>(ActiveXComponent.java:58)
at test.main(test.java:8)

It looks like it can't find the installed program on registry (like it's not installed or registered). I tried reinstalling and this did not fix the issue and I'm not sure what to do next and how can I force register VISSIM to my reg.

I'm in dire need of help. :/


Solution

  • For anyone who might find himself in the same pickle, here's the answer to my question.

    After days of investigating I found out that the student and demo versions of VISSIM do not have COM interface support. Thus, nothing can be done with those versions.

    If you need COM interface you can ask for it directly from PTV or use the commercial liscenced version. I tried with commercial liscence on my faculty PC and the thing works.

    So there it is. :) Hope it helps someone.