Bastian - 2013-02-26

Hi everyone,

I'm trying to connect an OPC server and i'm getting an error:

Recieved RESPONSE
org.jinterop.dcom.common.JIException: Unspecified Error. [0x80004005]
    at org.jinterop.dcom.core.JIComServer.init(JIComServer.java:580)
    at org.jinterop.dcom.core.JIComServer.initialise(JIComServer.java:481)
    at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:414)
    at fr.ncs.vms.interfacemodule.opc.ClientTest.main(ClientTest.java:87)
Caused by: org.jinterop.dcom.common.JIRuntimeException: Unspecified Error. [0x80004005]
    at org.jinterop.dcom.core.JIRemActivation.read(JIRemActivation.java:192)
    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.init(JIComServer.java:568)
    ... 3 more
26 févr. 2013 11:42:04 org.jinterop.dcom.core.JISession postDestroy
INFO: About to destroy links for Session: -1675097069 , size of which is 0
26 févr. 2013 11:42:04 org.jinterop.dcom.core.JIComOxidRuntime destroySessionOIDs
INFO: destroySessionOIDs for session: -1675097069
~~~~~

If I use a GUI client I can connect to this server.
With the same code I can connect to other OPC servers.

Here is my code, rather simple:

public static void main ( final String[] args ) throws Throwable{
OPCServer server = null;
try{
//JISystem.setAutoRegisteration ( true );
JISession session = JISession.createSession ( "NCS", "user", "pass");
JIComServer comServer = new JIComServer ( JIProgId.valueOf ( "DEF.OPCServer" ), "127.0.0.1", session );
IJIComObject serverObject = comServer.createInstance ();

    IJIDispatch dispatch = (IJIDispatch)JIObjectFactory.narrowObject((IJIComObject)serverObject.queryInterface(IJIDispatch.IID));

    server = new OPCServer ( serverObject );

   // browseTree(server.getBrowser(), 0);

}
catch (Exception e){
    e.printStackTrace();
}

}
~~~~~~

Any ideas of what is happening? Thanks for your help