I use jinterop with an applet for control the user edition of msWord documents and store them in a database.
It works perfectly with windows XP, window 2003 server, windows 7(64), windows 8.1 (with office 2000, 2003, 2007, 2010 and 2013) with java32.
But it doesn´t work with Windows Server 2008 R2 Datacenter SP1. (with terminal server services installed)
I have tested with office 2003, 2007, 2010 and 2013. Neither of them works.
I have registered and unregister office multiple times. I have rebooted win 2008 multiple times...
I have configured w2008 the same way I do for w7 and w8.1
I even try with and without a domain (for others versions it doesn´t matter, neither does for w2008 , it never works).
It has always worked with jInterop 2.08, but I have tried too with 3.0, errors and traces are the same.
I attach a sample program, and traces with jInterop 3.0.
If in the dcom config console (mmc.exe comexp.msc /32) the "word document" object has the run as property as Initial User,
(it shows the word app in the current user, ok. That way it works in win 2003 server (with terminal server))
when it is going to open the document, it doesn't open and it throws an exception: ** ERROR opening doc java.lang.IllegalStateException: org.jinterop.dcom.core.VariantBody$EMPTY cannot be cast to org.jinterop.dcom.core.IJIComObject
java.lang.IllegalStateException: org.jinterop.dcom.core.VariantBody$EMPTY cannot be cast to org.jinterop.dcom.core.IJIComObject
at org.jinterop.dcom.core.VariantBody.getObjectAsComObject(JIVariant.java:1946)
at org.jinterop.dcom.core.JIVariant.getObjectAsComObject(JIVariant.java:1371)
at word.Word.getIJIDispatch(Word.java:107)
at word.Word$Document.<init>(Word.java:253)
at word.Word$Documents.open(Word.java:242)
at word.Word.openDoc(Word.java:90)
at word.Word.test(Word.java:37)
at word.Word.main(Word.java:31)
If the dcom config console (mmc.exe comexp.msc /32) the "word document" object has the run as property as Interactive User,
then word app shows the document but it throws an exception:
(it shows the word app in another user session)
(the error happends when the app is shown in the user session too) ** ERROR opening doc org.jinterop.dcom.impls.automation.JIAutomationException: Exception occurred. [0x80020009]
org.jinterop.dcom.impls.automation.JIAutomationException: Exception occurred. [0x80020009]
at org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:331)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:518)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:524)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:475)
at word.Word$Documents.open(Word.java:237)
at word.Word.openDoc(Word.java:90)
at word.Word.test(Word.java:37)
at word.Word.main(Word.java:31)
Caused by: org.jinterop.dcom.common.JIRuntimeException: Exception occurred. [0x80020009]
at org.jinterop.dcom.core.JICallBuilder.readResult(JICallBuilder.java:1095)
at org.jinterop.dcom.core.JICallBuilder.read(JICallBuilder.java:969)
at ndr.NdrObject.decode(NdrObject.java:36)
at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:137)
at rpc.Stub.call(Stub.java:113)
at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:990)
at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:945)
at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:271)
at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:156)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:313)
... 7 more
(anyway I need to use Initial User for a Terminal Server environment)
When it crashes winword.exe process takes 100% cpu and needs to be killed with task manager.
Am I doing something wrong?
I need to configure something more in Windows Server 2008 r2 sp1 with terminal server services?
now If in the dcom config console (mmc.exe comexp.msc /32) the "word document" object has the run as property as Initial User (OK),
(it shows the word app in the current user (OK))
then word app shows the document but it throws an exception:
** ERROR opening doc org.jinterop.dcom.impls.automation.JIAutomationException: Exception occurred. [0x80020009]
org.jinterop.dcom.impls.automation.JIAutomationException: Exception occurred. [0x80020009]
at org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:331)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:518)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:524)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:475)
at word.Word$Documents.open(Word.java:237)
at word.Word.openDoc(Word.java:90)
at word.Word.test(Word.java:37)
at word.Word.main(Word.java:31)
Caused by: org.jinterop.dcom.common.JIRuntimeException: Exception occurred. [0x80020009]
at org.jinterop.dcom.core.JICallBuilder.readResult(JICallBuilder.java:1095)
at org.jinterop.dcom.core.JICallBuilder.read(JICallBuilder.java:969)
at ndr.NdrObject.decode(NdrObject.java:36)
at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:137)
at rpc.Stub.call(Stub.java:113)
at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:990)
at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:945)
at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:271)
at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:156)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:313)
... 7 more
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
now If in the dcom config console (mmc.exe comexp.msc /32) the "word
document" object has the run as property as Initial User (OK),
(it shows the word app in the current user (OK))
then word app shows the document but it throws an exception:
**** ERROR opening doc
org.jinterop.dcom.impls.automation.JIAutomationException: Exception
occurred. [0x80020009]
org.jinterop.dcom.impls.automation.JIAutomationException: Exception
occurred. [0x80020009]
at
org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:331)
at
org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:518)
at
org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:524)
at
org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:475)
at word.Word$Documents.open(Word.java:237)
at word.Word.openDoc(Word.java:90)
at word.Word.test(Word.java:37)
at word.Word.main(Word.java:31)
Caused by: org.jinterop.dcom.common.JIRuntimeException: Exception
occurred. [0x80020009]
at org.jinterop.dcom.core.JICallBuilder.readResult(JICallBuilder.java:1095)
at org.jinterop.dcom.core.JICallBuilder.read(JICallBuilder.java:969)
at ndr.NdrObject.decode(NdrObject.java:36)
at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:137)
at rpc.Stub.call(Stub.java:113)
at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:990)
at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:945)
at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:271)
at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:156)
at
org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:313)
... 7 more
------------------------------
--
The Mind is a place of its own. It can make a heaven out of hell or a hell
out of heaven. Attitude is everything. No matter how adverse conditions
maybe, one has the capacity to turn things around by one's Determination,
Perseverance and Hardwork.
JIExcepInfo {
code:-2146822307,
desc:No se puede abrir el almacenamiento de macros. [ ,
source:Microsoft Word ,
helpFilePath:C:\Program Files (x86)\Microsoft Office\Office12\3082\WDMAIN11.CHM ] }
I will investigate from this point, but if you know something about it, you are very wellcome if you want to share it with me...
Thank you very much.
Javi.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Finally I solved this (on windows 2008 server r2 sp1, with remote desktop, running word 2007 as initial user)
java.lang.IllegalStateException: org.jinterop.dcom.core.VariantBody$EMPTY cannot be cast to org.jinterop.dcom.core.IJIComObject
[\3082\WDMAIN11.CHM]
0x80020009 -2146822307 Could Not Open Macro Storage
No se puede abrir el almacenamiento de macros
0x80020009 -2146823191 Word has encountered a problem
Word ha detectado un problema
Solutions:
This folders must exist, and users need to have rigths over them:
C:\Windows\System32\config\systemprofile
C:\Windows\System32\config\systemprofile\Desktop
C:\Windows\SysWOW64\config\systemprofile
C:\Windows\SysWOW64\config\systemprofile\Desktop
Delete all Normal.dot and Normal.dotm
Users need to have rights over:
C:\Windows\Temp
Thanks
Javi.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello Vikram,
I use jinterop with an applet for control the user edition of msWord documents and store them in a database.
It works perfectly with windows XP, window 2003 server, windows 7(64), windows 8.1 (with office 2000, 2003, 2007, 2010 and 2013) with java32.
But it doesn´t work with Windows Server 2008 R2 Datacenter SP1. (with terminal server services installed)
I have tested with office 2003, 2007, 2010 and 2013. Neither of them works.
I have registered and unregister office multiple times. I have rebooted win 2008 multiple times...
I have configured w2008 the same way I do for w7 and w8.1
I even try with and without a domain (for others versions it doesn´t matter, neither does for w2008 , it never works).
It has always worked with jInterop 2.08, but I have tried too with 3.0, errors and traces are the same.
I attach a sample program, and traces with jInterop 3.0.
If in the dcom config console (mmc.exe comexp.msc /32) the "word document" object has the run as property as Initial User,
(it shows the word app in the current user, ok. That way it works in win 2003 server (with terminal server))
when it is going to open the document, it doesn't open and it throws an exception:
** ERROR opening doc java.lang.IllegalStateException: org.jinterop.dcom.core.VariantBody$EMPTY cannot be cast to org.jinterop.dcom.core.IJIComObject
java.lang.IllegalStateException: org.jinterop.dcom.core.VariantBody$EMPTY cannot be cast to org.jinterop.dcom.core.IJIComObject
at org.jinterop.dcom.core.VariantBody.getObjectAsComObject(JIVariant.java:1946)
at org.jinterop.dcom.core.JIVariant.getObjectAsComObject(JIVariant.java:1371)
at word.Word.getIJIDispatch(Word.java:107)
at word.Word$Document.<init>(Word.java:253)
at word.Word$Documents.open(Word.java:242)
at word.Word.openDoc(Word.java:90)
at word.Word.test(Word.java:37)
at word.Word.main(Word.java:31)
If the dcom config console (mmc.exe comexp.msc /32) the "word document" object has the run as property as Interactive User,
then word app shows the document but it throws an exception:
(it shows the word app in another user session)
(the error happends when the app is shown in the user session too)
** ERROR opening doc org.jinterop.dcom.impls.automation.JIAutomationException: Exception occurred. [0x80020009]
org.jinterop.dcom.impls.automation.JIAutomationException: Exception occurred. [0x80020009]
at org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:331)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:518)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:524)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:475)
at word.Word$Documents.open(Word.java:237)
at word.Word.openDoc(Word.java:90)
at word.Word.test(Word.java:37)
at word.Word.main(Word.java:31)
Caused by: org.jinterop.dcom.common.JIRuntimeException: Exception occurred. [0x80020009]
at org.jinterop.dcom.core.JICallBuilder.readResult(JICallBuilder.java:1095)
at org.jinterop.dcom.core.JICallBuilder.read(JICallBuilder.java:969)
at ndr.NdrObject.decode(NdrObject.java:36)
at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:137)
at rpc.Stub.call(Stub.java:113)
at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:990)
at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:945)
at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:271)
at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:156)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:313)
... 7 more
(anyway I need to use Initial User for a Terminal Server environment)
When it crashes winword.exe process takes 100% cpu and needs to be killed with task manager.
Am I doing something wrong?
I need to configure something more in Windows Server 2008 r2 sp1 with terminal server services?
Thank you
Javi.
**** SAMPLE JAVA CLASS:
package word;
import java.security.Security;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.jinterop.dcom.common.JIException;
import org.jinterop.dcom.core.IJIComObject;
import org.jinterop.dcom.core.JIClsid;
import org.jinterop.dcom.core.JIComServer;
import org.jinterop.dcom.core.JISession;
import org.jinterop.dcom.core.JIString;
import org.jinterop.dcom.core.JIVariant;
import org.jinterop.dcom.impls.JIObjectFactory;
import org.jinterop.dcom.impls.automation.IJIDispatch;
public class Word {
}
**** END OF SAMPLE JAVA CLASS.
Hi,
I have just done the thing they say in http://stackoverflow.com/questions/1006923/automating-office-via-windows-service-on-server-2008:
I have created:
C:\Windows\System32\config\systemprofile\Desktop
C:\Windows\SysWOW64\config\systemprofile\Desktop
now If in the dcom config console (mmc.exe comexp.msc /32) the "word document" object has the run as property as Initial User (OK),
(it shows the word app in the current user (OK))
then word app shows the document but it throws an exception:
** ERROR opening doc org.jinterop.dcom.impls.automation.JIAutomationException: Exception occurred. [0x80020009]
org.jinterop.dcom.impls.automation.JIAutomationException: Exception occurred. [0x80020009]
at org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:331)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:518)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:524)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.callMethodA(JIDispatchImpl.java:475)
at word.Word$Documents.open(Word.java:237)
at word.Word.openDoc(Word.java:90)
at word.Word.test(Word.java:37)
at word.Word.main(Word.java:31)
Caused by: org.jinterop.dcom.common.JIRuntimeException: Exception occurred. [0x80020009]
at org.jinterop.dcom.core.JICallBuilder.readResult(JICallBuilder.java:1095)
at org.jinterop.dcom.core.JICallBuilder.read(JICallBuilder.java:969)
at ndr.NdrObject.decode(NdrObject.java:36)
at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:137)
at rpc.Stub.call(Stub.java:113)
at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:990)
at org.jinterop.dcom.core.JIComServer.call(JIComServer.java:945)
at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:271)
at org.jinterop.dcom.core.JIComObjectImpl.call(JIComObjectImpl.java:156)
at org.jinterop.dcom.impls.automation.JIDispatchImpl.invoke(JIDispatchImpl.java:313)
... 7 more
Hi,
There is a getExcepInfo() within the AutomationException , can you please
check that structure for all cases and see what each one reports ?
best regards,
Vikram
On Fri, Oct 31, 2014 at 6:00 PM, javcrespo javcrespo@users.sf.net wrote:
--
The Mind is a place of its own. It can make a heaven out of hell or a hell
out of heaven. Attitude is everything. No matter how adverse conditions
maybe, one has the capacity to turn things around by one's Determination,
Perseverance and Hardwork.
John Milton
(Paradise Lost)
Thanks for the quick answer.
I did what you ask.
JIExcepInfo {
code:-2146822307,
desc:No se puede abrir el almacenamiento de macros. [ ,
source:Microsoft Word ,
helpFilePath:C:\Program Files (x86)\Microsoft Office\Office12\3082\WDMAIN11.CHM ] }
I will investigate from this point, but if you know something about it, you are very wellcome if you want to share it with me...
Thank you very much.
Javi.
Hi Vikram,
Finally I solved this (on windows 2008 server r2 sp1, with remote desktop, running word 2007 as initial user)
java.lang.IllegalStateException: org.jinterop.dcom.core.VariantBody$EMPTY cannot be cast to org.jinterop.dcom.core.IJIComObject
[\3082\WDMAIN11.CHM]
0x80020009 -2146822307 Could Not Open Macro Storage
No se puede abrir el almacenamiento de macros
0x80020009 -2146823191 Word has encountered a problem
Word ha detectado un problema
Solutions:
This folders must exist, and users need to have rigths over them:
C:\Windows\System32\config\systemprofile
C:\Windows\System32\config\systemprofile\Desktop
C:\Windows\SysWOW64\config\systemprofile
C:\Windows\SysWOW64\config\systemprofile\Desktop
Delete all Normal.dot and Normal.dotm
Users need to have rights over:
C:\Windows\Temp
Thanks
Javi.