2013-08-06 62 views
5

問題を解決する解決策が見つかりませんでしたので、新しいトピックを開きます。Utgard - アクセスが拒否されました

Utgard(http://openscada.org/projects/utgard)は私にとって非常に便利なツールのようです。この段階では、Eclipse経由でWindows 8 OS上のTOP OPCサーバーにローカルでアクセスできるようにしたいだけです。しかし、彼らのチュートリアルを実行しようとすると、私は "アクセスが拒否されました"に終わります。私はユーザー名、パスワードなどで間違いを犯したとは思わない。

Exele OPC DAテストクライアントはエラーを返しません。私は接続し、取得し、値を書き換えることができます。

OPCとOpenSCADAについては、私は初心者です。どんな助けでも大歓迎です。

package org.openscada.opc.tutorial; 
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; 

public class UtgardTutorial1 { 


public static void main(String[] args) throws Exception { 
    // create connection information 
    final ConnectionInformation ci = new ConnectionInformation(); 
    //final ConnectionInformation connectionInformation = new ConnectionInformation(); 
    ci.setHost("127.0.0.1"); 
    //ci.setDomain(""); 
    ci.setUser("Me"); 
    ci.setPassword("Password"); 
    ci.setProgId("SWToolbox.TOPServer.V5"); 
    //ci.setClsid("680DFBF7-C92D-484D-84BE-06DC3DECCD68"); // if ProgId is not working, try it using the Clsid instead 
    // create an id for the tag you want to retrieve 
    final String itemId = "_System._Time_Second"; 
    // create a new server 
    final Server server = new Server(ci, Executors.newSingleThreadScheduledExecutor()); 
    //final Server serverServer = new Server(connectionInformation, Executor.newSingleThreadSchedulesExecutor); 

    try { 
     // connect to server 
     server.connect(); 
     // add sync access, poll every 500 ms 
     final AccessBase access = new SyncAccess(server, 500); 
     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()))); 
    } 
} 

}

エラースタックトレース:

INFO org.openscada.opc.lib.da.Server - Failed to connect to server 
org.jinterop.dcom.common.JIException: Access is denied, please check whether the [domain-username-password] are correct. Also, if not already done please check the GETTING STARTED and FAQ sections in readme.htm. They provide information on how to correctly configure the Windows machine for DCOM access, so as to avoid such exceptions. [0x00000005] 
    at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenKey(Unknown Source) ~[org.openscada.jinterop.core_2.0.8.201303051454.jar:na] 
    at org.jinterop.dcom.core.JIProgId.getIdFromWinReg(Unknown Source) ~[org.openscada.jinterop.core_2.0.8.201303051454.jar:na] 
    at org.jinterop.dcom.core.JIProgId.getCorrespondingCLSID(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:123) ~[org.openscada.opc.lib_1.0.0.201303051455.jar:na] 
    at org.openscada.opc.tutorial.UtgardTutorial1.main(UtgardTutorial1.java:32) [bin/:na] 
Caused by: org.jinterop.dcom.common.JIRuntimeException: Access is denied, please check whether the [domain-username-password] are correct. Also, if not already done please check the GETTING STARTED and FAQ sections in readme.htm. They provide information on how to correctly configure the Windows machine for DCOM access, so as to avoid such exceptions. [0x00000005] 
    at org.jinterop.winreg.IJIWinReg$openKey.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] 
+0

あなたはOPCサーバーのDCOMの設定を確認していますか? –

+0

こんにちはclaptrap、あなたの返信ありがとう!はい、私は、インターネット上の多くの異なる記事によって1回以上DCOMの設定を確認しました。私は彼らが問題ではないと思う。これらのエラーは私のIDEでのみ発生します。 – user2656046

+0

ああ、幸運が問題を見つける。 –

答えて

4

あなたはローカルのWindowsレジストリへのアクセス権を持っていないので、クライアントは、CLSIDに、サーバーのプログラムIDの変換に失敗しました。十分な権限を持って、つまり管理者ユーザーであることを確認してアプリケーションを実行してください。

また、サーバーのCLSIDを使用して接続を構成するだけで、レジストリは不要です。

実際にOPCクライアントは、ProgIDからCLSIDへの変換を実行するために、サーバーコンピュータで実行されているOpcEnumサービスを実際に使用する必要があります。おそらくサービスが利用できないか、Utgardはレジストリを試みるだけです(私はUtgard自身を知らない)。サーバーをクライアントマシンにインストールしていない場合、レジストリベースのProgIDからCLSIDへの変換は、ローカルWindowsレジストリでは利用できないため、とにかく失敗します。最悪のケースは、UtgardがリモートWindowsレジストリを開こうとすることです。このWindowsレジストリはほとんど成功しません(または、別途有効にする必要があります)。

私はUtgardを知らないので、私はどの戦略を試みているのか推測しています。それにもかかわらず、CLSIDのみを使用すると変換部分全体がバイパスされますが、これは問題です。

E:他のクライアントが問題なく接続できることを考慮して、私はUtgardがOpcEnumをまったく使用しようとしないと考えています。

+0

こんにちはJouni Aro、あなたの明確な説明をありがとう。私はこれが本当に共通の問題であると聞いたので、あなたの答えを受け入れられた答えとして設定し、それは多くの人々を助けるでしょう。 しかし、私はclaptrapが提案したようにDCOMの設定をもう一度変更することでこの問題を解決しました。今回は、「このコンピュータからアプリケーションを実行する」の代わりに「次のコンピュータ「myComputerName」」から「アプリケーションを実行する」に「場所」を設定しました。理由は分かりませんが、今はうまくいきます。 – user2656046

+0

私もあなたが言ったようにCLSIDを使用しています!しかし、それ自体は例外をなくすことはありませんでした。私はDCOMを以前のコメントで説明したように変更しなければなりませんでした。 – user2656046

+1

こんにちは、使用したDCOM構成をサマータイズしてください。 – Kumait

0

私は同じエラーを得て、レジストリに以下のパッチを適用する ことで問題を解決:

  • HKEY_LOCAL_MACHINE \ソフトウェア\マイクロソフト\ Windowsの\ CurrentVersionの\ポリシーは、システム
  • が32を作成または変更\しますビットDWORD:LocalAccountTokenFilterPolicyの
  • がに値を設定する:1
関連する問題