My java/jacob app connects to MS Outlook. It uses the folder picker and does reads, adds, and edits to contacts, appointments, and tasks.
One of my users got the following exception:
com.jacob.com.ComFailException: Can't map name to dispid: Session
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.com.Dispatch.invokev(Dispatch.java:384)
at com.jacob.com.Dispatch.get(Dispatch.java:512)
Is there anything other than not having Outlook installed that could cause this error?
Thanks,
- Nick
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have nearly the same Problem. I start my Lib with COM-traffic to Outlook (via Jacob) on 2 ways. As a normal Java Applicationthere is no error. The same Programm started with WebStart gets several errors (see below). The Problem occurs with 1.7 as well as with 1.9. Generally WebStart cant be the problem, because I used Jacob with nearly the same code in another Project and there it was ok.
com.jacob.com.ComFailException: Can't map name to dispid: Items
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.com.Dispatch.invokev(Dispatch.java:804)
at com.jacob.com.Dispatch.get(Dispatch.java:1153)
at de.heitec.core.office.outlook.accessing.MAPIFolder.getItems(MAPIFolder.java:77)
AND
com.jacob.com.ComFailException: Can't map name to dispid: Items
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.com.Dispatch.invokev(Dispatch.java:804)
at com.jacob.com.Dispatch.get(Dispatch.java:1153)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
com.jacob.com.ComFailException: Can't map name to dispid: Name
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.com.Dispatch.invokev(Dispatch.java:804)
at com.jacob.com.Dispatch.get(Dispatch.java:1153)
at de.heitec.core.office.outlook.accessing.UApplication.getName(UApplication.java:65)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK. We found the Problem. The problem is not JACOB. It is a Problem with JNI (or the JNI context for a DLL). Never use the same DLL in different threads! We use now a Factory Pattern, that raises a new Lib instance for each Thread (simply use Thread.currentThread ().getName() ). Now it works.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My java/jacob app connects to MS Outlook. It uses the folder picker and does reads, adds, and edits to contacts, appointments, and tasks.
One of my users got the following exception:
com.jacob.com.ComFailException: Can't map name to dispid: Session
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.com.Dispatch.invokev(Dispatch.java:384)
at com.jacob.com.Dispatch.get(Dispatch.java:512)
Is there anything other than not having Outlook installed that could cause this error?
Thanks,
- Nick
version and installed patch differences?
Security preferences?
I have nearly the same Problem. I start my Lib with COM-traffic to Outlook (via Jacob) on 2 ways. As a normal Java Applicationthere is no error. The same Programm started with WebStart gets several errors (see below). The Problem occurs with 1.7 as well as with 1.9. Generally WebStart cant be the problem, because I used Jacob with nearly the same code in another Project and there it was ok.
com.jacob.com.ComFailException: Can't map name to dispid: Items
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.com.Dispatch.invokev(Dispatch.java:804)
at com.jacob.com.Dispatch.get(Dispatch.java:1153)
at de.heitec.core.office.outlook.accessing.MAPIFolder.getItems(MAPIFolder.java:77)
AND
com.jacob.com.ComFailException: Can't map name to dispid: Items
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.com.Dispatch.invokev(Dispatch.java:804)
at com.jacob.com.Dispatch.get(Dispatch.java:1153)
Sorry. The first Error was
com.jacob.com.ComFailException: Can't map name to dispid: Name
at com.jacob.com.Dispatch.invokev(Native Method)
at com.jacob.com.Dispatch.invokev(Dispatch.java:804)
at com.jacob.com.Dispatch.get(Dispatch.java:1153)
at de.heitec.core.office.outlook.accessing.UApplication.getName(UApplication.java:65)
OK. We found the Problem. The problem is not JACOB. It is a Problem with JNI (or the JNI context for a DLL). Never use the same DLL in different threads! We use now a Factory Pattern, that raises a new Lib instance for each Thread (simply use Thread.currentThread ().getName() ). Now it works.
There are other folks using Jacob in multi threaded environments without problems. I wonder if it is that or if we have non thread safe C++ code.