Hi All,
I'm facing an issue when using Utgard driver for OPC. I have a program which connects to an OPC server and poll data using Async20Access.
There are around 1400 tag points I registered with this access base.
Everything works fine for around 9/10 hours. Then suddenly no data received at my application. There was no error reported from the driver.
When this issue happened I thought I can resolve this by implementing a fix to disconnect and then re-connect the server and access base.
But that didn't work due to exceptions. It is showing different exceptions every time when application try to create a new Server and Async20Access.
One of the exceptions it received today is below.
Failed to change state (true)
org.jinterop.dcom.common.JIException: The RPC server is unavailable. Please check if the COM server is up and running and that route to the COM Server is accessible (A simple "Ping" to the Server machine would do). Also please confirm if the Windows Firewall is not blocking DCOM access. [0x800706BA]I know this exception is not from Utgard, but from j-integop. But the doubt is why it is showing only when re-creating the connection.
First, I doubt that I'm shutting down existing connections properly or not. Following is my code to do that.
// Properly shutdown and disconnect the existing connections.
public void disconnectOPCServer () throws Exception {
this.accessBase.unbind();
this.server.disconnect();
this.server.dispose();
this.accessBase = null
this.server = null;
try {
Thread.sleep ( 120000 ); // Wait for two mins
} catch ( Exception e ) {
}
}
Do you think this is sufficient to shutdown existing DCOM connections?
FYI, I'm already using the following configuration to turn off GC on DCOM objects, as suggested in many other posts.
JISystem.setJavaCoClassAutoCollection(false);
I appreciate any solution/suggestion/pointers to resolve this re-connect issue.
Thank you very much.
Manoj