UtGard connection problem

618 views
Skip to first unread message

Jiří Haňka

unread,
Apr 7, 2017, 3:04:57 AM4/7/17
to openSCADA
Dear all,

I am new in UtGard library using and I would like to connect to my OPC server via tutorial samples. 
I have an issue in server access denied during my connection attempts.
I set all DCOM and OPC permissions to allow. So if I use another library like is jEasyOPC, I am able to connect to my OPC server. Also if I use another OPC client completed App I am able to connect.

My first question: Is problem I use netbeans IDE instead of Eclipse IDE?
Next question: Where can be problem when I use MXOPC server from Mitsubishi?

I attach my source code with error log:

SOURCE:
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package opcutgard.test;

import java.util.concurrent.Executors;
import org.jinterop.dcom.common.JIException;
import org.openscada.opc.lib.common.ConnectionInformation;
import org.openscada.opc.lib.da.AccessBase;
import org.openscada.opc.lib.da.DataCallback;
import org.openscada.opc.lib.da.Item;
import org.openscada.opc.lib.da.ItemState;
import org.openscada.opc.lib.da.Server;
import org.openscada.opc.lib.da.SyncAccess;

/**
 *
 * @author auo
 */
public class OPCUtGardTest {
public static void main(String[] args) throws Exception {
        // create connection information
        final ConnectionInformation ci = new ConnectionInformation();
        ci.setHost("localhost");
        ci.setDomain("");
        ci.setUser("my NT account");
        ci.setPassword("my NT password");
        ci.setProgId("Mitsubishi.MXOPC.6");
        ci.setClsid("925587F4-4886-4E00-9883-43B7EF39E4B1"); // if ProgId is not working, try it using the Clsid instead
       // final String itemId = "Dev08.Tag001";
        // create a new server
        final Server server = new Server(ci, Executors.newSingleThreadScheduledExecutor());
         
        try {
            // connect to server
           server.connect();
            // add sync access, poll every 500 ms
            final AccessBase access = new SyncAccess(server, 1000);
            /*access.addItem(itemId, new DataCallback() {
                @Override
                public void changed(Item item, ItemState state) {
                    System.out.println(state);
                }
            });*/
            // start reading
            access.bind();
            // wait a little bit
            Thread.sleep(10 * 1000);
            // stop reading
            access.unbind();
        } catch (final JIException e) {
            System.out.println(String.format("%08X: %s", e.getErrorCode(), server.getErrorMessage(e.getErrorCode())));
        }
    }
}


ERRLOG:
run:
09:03:27.630 [main] INFO  org.openscada.opc.lib.da.Server - Socket timeout: 0 
Apr 07, 2017 9:03:27 AM org.jinterop.dcom.common.JISystem logSystemPropertiesAndVersion
INFO: j-Interop Version = null

Apr 07, 2017 9:03:27 AM org.jinterop.dcom.common.JISystem logSystemPropertiesAndVersion
INFO: java.runtime.name = Java(TM) SE Runtime Environment
sun.boot.library.path = C:\Program Files (x86)\Java\jdk1.8.0_121\jre\bin
java.vm.version = 25.121-b13
java.vm.vendor = Oracle Corporation
java.vendor.url = http://java.oracle.com/
path.separator = ;
java.vm.name = Java HotSpot(TM) Client VM
file.encoding.pkg = sun.io
user.country = US
user.script = 
sun.java.launcher = SUN_STANDARD
sun.os.patch.level = Service Pack 1
java.vm.specification.name = Java Virtual Machine Specification
user.dir = C:\Users\auo\Documents\NetBeansProjects\OPCUtGard-test
java.runtime.version = 1.8.0_121-b13
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs = C:\Program Files (x86)\Java\jdk1.8.0_121\jre\lib\endorsed
os.arch = x86
java.io.tmpdir = C:\Users\auo\AppData\Local\Temp\
line.separator = 

java.vm.specification.vendor = Oracle Corporation
user.variant = 
os.name = Windows 7
sun.jnu.encoding = Cp1252
java.library.path = C:\Program Files (x86)\Java\jdk1.8.0_121\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Common Files\Siemens\Automation\Simatic OAM\bin;c:\Program Files (x86)\AMD APP\bin\x86_64;c:\Program Files (x86)\AMD APP\bin\x86;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Users\auo\Documents\apache-maven-3.3.9\bin;.
java.specification.name = Java Platform API Specification
java.class.version = 52.0
sun.management.compiler = HotSpot Client Compiler
os.version = 6.1
user.home = C:\Users\xxx
user.timezone = Europe/Prague
java.awt.printerjob = sun.awt.windows.WPrinterJob
file.encoding = UTF-8
java.specification.version = 1.8
09:03:27.706 [main] INFO  org.jinterop.dcom.core.JISession - Created Session: -1541953423
java.class.path = C:\Users\auo\Documents\NetBeansProjects\OPCUtGard-test\libs\org.openscada.external.sdk-R.1.0.0\slf4j.api_1.6.4.jar;C:\Users\auo\Documents\NetBeansProjects\OPCUtGard-test\libs\org.openscada.external.sdk-R.1.0.0\ch.qos.logback.classic_1.0.0.jar;C:\Users\auo\Documents\NetBeansProjects\OPCUtGard-test\libs\org.openscada.external.sdk-R.1.0.0\ch.qos.logback.core_1.0.0.jar;C:\Users\auo\Documents\NetBeansProjects\OPCUtGard-test\libs\org.openscada.external.sdk-R.1.0.0\org.openscada.external.jcifs_1.2.25.201303051448.jar;C:\Users\auo\Documents\NetBeansProjects\OPCUtGard-test\libs\org.openscada.jinterop.sdk-R.1.0.0\org.openscada.jinterop.core_2.0.8.201303051454.jar;C:\Users\auo\Documents\NetBeansProjects\OPCUtGard-test\libs\org.openscada.jinterop.sdk-R.1.0.0\org.openscada.jinterop.deps_1.0.0.201303051454.jar;C:\Users\auo\Documents\NetBeansProjects\OPCUtGard-test\libs\org.openscada.utgard.sdk-R.1.0.0\org.openscada.opc.dcom_1.0.0.201303051455.jar;C:\Users\auo\Documents\NetBeansProjects\OPCUtGard-test\libs\org.openscada.utgard.sdk-R.1.0.0\org.openscada.opc.lib_1.0.0.201303051455.jar;C:\Users\auo\Documents\NetBeansProjects\OPCUtGard-test\build\classes
user.name = xxx
java.vm.specification.version = 1.8
sun.java.command = opcutgard.test.OPCUtGardTest
java.home = C:\Program Files (x86)\Java\jdk1.8.0_121\jre
09:03:27.708 [Timer-1] INFO  o.j.dcom.core.JIComOxidRuntime - Running ClientPingTimerTask !
sun.arch.data.model = 32
09:03:27.708 [Timer-0] INFO  org.jinterop.dcom.core.JISession - Release_References_TimerTask:[RUN] Session:  -1541953423 , listOfDeferencedIpids.size(): 0
user.language = en
java.specification.vendor = Oracle Corporation
awt.toolkit = sun.awt.windows.WToolkit
09:03:27.708 [Timer-2] INFO  o.j.dcom.core.JIComOxidRuntime - Running ServerPingTimerTask !
java.vm.info = mixed mode
java.version = 1.8.0_121
java.ext.dirs = C:\Program Files (x86)\Java\jdk1.8.0_121\jre\lib\ext;C:\Windows\Sun\Java\lib\ext
sun.boot.class.path = C:\Program Files (x86)\Java\jdk1.8.0_121\jre\lib\resources.jar;C:\Program Files (x86)\Java\jdk1.8.0_121\jre\lib\rt.jar;C:\Program Files (x86)\Java\jdk1.8.0_121\jre\lib\sunrsasign.jar;C:\Program Files (x86)\Java\jdk1.8.0_121\jre\lib\jsse.jar;C:\Program Files (x86)\Java\jdk1.8.0_121\jre\lib\jce.jar;C:\Program Files (x86)\Java\jdk1.8.0_121\jre\lib\charsets.jar;C:\Program Files (x86)\Java\jdk1.8.0_121\jre\lib\jfr.jar;C:\Program Files (x86)\Java\jdk1.8.0_121\jre\classes
java.vendor = Oracle Corporation
09:03:27.719 [main] DEBUG o.j.dcom.transport.JIComTransport - Opening socket on /127.0.0.1:135
file.separator = \
sun.io.unicode.encoding = UnicodeLittle
sun.cpu.endian = little
sun.desktop = windows
sun.cpu.isalist = pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86

Apr 07, 2017 9:03:27 AM org.jinterop.dcom.common.JISystem internal_dumpMap
INFO: mapOfHostnamesVsIPs: {}
Apr 07, 2017 9:03:27 AM rpc.DefaultConnection processOutgoing
INFO: 
 Sending BIND
Apr 07, 2017 9:03:27 AM rpc.DefaultConnection processIncoming
INFO: 
 Recieved BIND_ACK
Apr 07, 2017 9:03:27 AM rpc.DefaultConnection processOutgoing
INFO: 
 Sending AUTH3
Apr 07, 2017 9:03:28 AM rpc.DefaultConnection processOutgoing
INFO: 
 Sending ALTER_CTX
Apr 07, 2017 9:03:28 AM rpc.DefaultConnection processIncoming
INFO: 
 Recieved ALTER_CTX_RESP
Apr 07, 2017 9:03:28 AM rpc.DefaultConnection processOutgoing
INFO: 
 Sending REQUEST
Apr 07, 2017 9:03:28 AM rpc.DefaultConnection processIncoming
INFO: 
 Recieved RESPONSE
09:03:28.195 [main] DEBUG o.j.dcom.transport.JIComTransport - Socket closed... Socket[unconnected] host 127.0.0.1, port 135
09:03:28.199 [main] INFO  org.openscada.opc.lib.da.Server - Failed to connect to server
org.jinterop.dcom.common.JIException: Access is denied.  [0x80070005]
at org.jinterop.dcom.core.JIComServer.init(Unknown Source) ~[org.openscada.jinterop.core_2.0.8.201303051454.jar:na]
at org.jinterop.dcom.core.JIComServer.initialise(Unknown Source) ~[org.openscada.jinterop.core_2.0.8.201303051454.jar:na]
at org.jinterop.dcom.core.JIComServer.<init>(Unknown Source) ~[org.openscada.jinterop.core_2.0.8.201303051454.jar:na]
at org.openscada.opc.lib.da.Server.connect(Server.java:117) ~[org.openscada.opc.lib_1.0.0.201303051455.jar:na]
at opcutgard.test.OPCUtGardTest.main(OPCUtGardTest.java:38) [classes/:na]
Caused by: org.jinterop.dcom.common.JIRuntimeException: Access is denied.  [0x80070005]
at org.jinterop.dcom.core.JIRemActivation.read(Unknown Source) ~[org.openscada.jinterop.core_2.0.8.201303051454.jar:na]
at ndr.NdrObject.decode(Unknown Source) ~[org.openscada.jinterop.deps_1.0.0.201303051454.jar:na]
at rpc.ConnectionOrientedEndpoint.call(Unknown Source) ~[org.openscada.jinterop.deps_1.0.0.201303051454.jar:na]
at rpc.Stub.call(Unknown Source) ~[org.openscada.jinterop.deps_1.0.0.201303051454.jar:na]
... 5 common frames omitted
09:03:28.199 [main] INFO  org.openscada.opc.lib.da.Server - Destroying DCOM session...
09:03:28.200 [main] INFO  org.openscada.opc.lib.da.Server - Destroying DCOM session... forked
09:03:28.200 [OPCSessionDestructor] DEBUG org.openscada.opc.lib.da.Server - Starting destruction of DCOM session
80070005: Unknown error (80070005)
09:03:28.200 [OPCSessionDestructor] INFO  org.jinterop.dcom.core.JISession - About to destroy 0 sessesion which are linked to this session: -1541953423
09:03:28.200 [OPCSessionDestructor] INFO  o.j.dcom.core.JIComOxidRuntime - destroySessionOIDs for session: -1541953423
09:03:28.200 [OPCSessionDestructor] INFO  org.openscada.opc.lib.da.Server - Destructed DCOM session
09:03:28.200 [OPCSessionDestructor] INFO  org.openscada.opc.lib.da.Server - Session destruction took 0 ms
BUILD SUCCESSFUL (total time: 0 seconds)


Best Regards,
Jiri

ozdamaraa

unread,
Jul 18, 2017, 8:42:50 AM7/18/17
to openSCADA
Hello Jiří ,

I faced with the same problem too. Did you find a solution?

Regards
Alper

Jiří Haňka

unread,
Jul 18, 2017, 9:45:42 AM7/18/17
to open...@googlegroups.com
Hello Ozdamaraa,

unfortunatedly I did not resolve this problem. So I used jEasyOPC library. If you want I can help you with this library.
If you find any solution, please let me know about it.

Best regards,
Jiří

--
You received this message because you are subscribed to a topic in the Google Groups "openSCADA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openscada/DFQsu9JCDQs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openscada+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ozdamaraa

unread,
Jul 20, 2017, 4:32:41 AM7/20/17
to openSCADA
thanks for your reply Jiří
I started to use jEasyOPC library but I got the error
"Property file javafish.clients.opc.JCustomOpc doesn't exist. System terminated."  Have you faced with it?

Jiří Haňka

unread,
Jul 24, 2017, 2:40:59 AM7/24/17
to open...@googlegroups.com
Dear Ozdamaraa, 

It seems to be missed any of JCustomOPC library, but I cannot solve it if I dont know your source code.


Here you can find any examples I used before.

Best regards,
Jiri


Jiří Haňka

unread,
Jul 26, 2017, 8:44:39 AM7/26/17
to open...@googlegroups.com
Dear Ozdamaraa,

I have already solved OPC UtGard connector. So if you like I can help you now.

Best regards,
Jiri

Panagiotis Kazakos

unread,
Nov 6, 2017, 3:20:49 AM11/6/17
to openSCADA
Dear Jiří,

Can you post the solution of the Utgard connector? 
To unsubscribe from this group and all its topics, send an email to openscada+...@googlegroups.com.

Ohad Ab

unread,
Mar 7, 2018, 8:07:00 AM3/7/18
to openSCADA
HI Jiri.
i will be most thankful if you could send me your solution to the win7 0x80070005 error in UtGard.
i've been having the same issue and i cant seem to solve it.
thank you very much

Jiří Haňka

unread,
Mar 7, 2018, 9:08:04 AM3/7/18
to open...@googlegroups.com
Dear Ohad,

since January I have changed a job so currently I have a little trouble to get my source code.

I would try to get this sources but I dont know when. 
Hope I can help you soon :) 

Best regards,

Jiri

--

Ohad Ab

unread,
Mar 7, 2018, 10:25:47 AM3/7/18
to openSCADA
Thanks! Jiri.
I will be most thankful for any kind of help. 
I'm going crazy with this windows security configurations.

Juan Marcelo Parra

unread,
Jun 26, 2018, 5:16:22 PM6/26/18
to openSCADA
Dear Jiri Hanka could you help me with the solution please. I'm using the example but it does not work. 
To unsubscribe from this group and all its topics, send an email to openscada+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages