org.jinterop.dcom.common.JIException: Unspecified Error. [0x80004005]

310 views
Skip to first unread message

14521...@qq.com

unread,
Dec 30, 2013, 2:16:29 AM12/30/13
to open...@googlegroups.com
hi,
package com.tt.test;

import java.net.UnknownHostException;
import java.util.concurrent.Executors;

import org.jinterop.dcom.common.JIException;
import org.jinterop.dcom.common.JISystem;
import org.jinterop.dcom.core.JIVariant;
import org.openscada.opc.lib.common.ConnectionInformation;
import org.openscada.opc.lib.common.NotConnectedException;
import org.openscada.opc.lib.da.AccessBase;
import org.openscada.opc.lib.da.AddFailedException;
import org.openscada.opc.lib.da.Async20Access;
import org.openscada.opc.lib.da.AutoReconnectController;
import org.openscada.opc.lib.da.DataCallback;
import org.openscada.opc.lib.da.DuplicateGroupException;
import org.openscada.opc.lib.da.Group;
import org.openscada.opc.lib.da.Item;
import org.openscada.opc.lib.da.ItemState;
import org.openscada.opc.lib.da.Server;
public class SCADA {
 public static void main(String[] args){
  AutoReconnectController autos = null;
  try {
   JISystem.setAutoRegisteration(true);
   
   ConnectionInformation ci = new ConnectionInformation();
   ci.setHost("192.168.0.109");//130.0.0.1
   ci.setDomain("");
   //ci.setProgId("Kepware.KEPServerEX.V5");//Hollysys.MacsOPCSvr.1
   ci.setClsid("b3af0bf6-4c0c-4804-a122-6f3b160f4397");
   ci.setUser("Administrator");
   ci.setPassword("123");//esd.@2012
   
   
   
   final Server s = new Server(ci,Executors.newSingleThreadScheduledExecutor());
         autos = new AutoReconnectController(s);
   autos.connect();Thread.sleep(100);
   
   
//   dumpTree(s.getTreeBrowser().browse(),0);
   
   Group group = s.addGroup("group");
            group.setActive(true);
           // final Item item = group.addItem("Bucket Brigade.String");
            final Item item = group.addItem("Channel1.Device1.Tag1");// simatic S7  Group1.PI_3009
           // final Item item = group.addItem("Random.String");
            item.setActive(true);
            Thread.sleep(1000);
            System.out.println(":"+item.read(false).getValue());
            JIVariant value = JIVariant.makeVariant(new Integer(777));
            item.write(value);
   
//  
  final AccessBase access = new Async20Access(s,6000,false);
            access.addItem ( "Channel1.Device1.Tag1",new DataCallback() {
                @Override
                public void changed(Item item, ItemState state) {
                    System.out.println("-----------11-------"+state);
                }
            });
            access.bind ();
            Thread.sleep(10*1000);
            access.unbind();
           
  } catch (IllegalArgumentException e) {
   e.printStackTrace();
  } catch (UnknownHostException e) {   
   e.printStackTrace();
  } catch (JIException e) {  
   e.printStackTrace();
  } catch (NotConnectedException e) {  
   e.printStackTrace();
  } catch (DuplicateGroupException e) {             
   e.printStackTrace();
  } catch (AddFailedException e) {
   e.printStackTrace();
  } catch (InterruptedException e) {
   e.printStackTrace();
  }finally{
   autos.disconnect();
  }  
 }
}


Execution error:
Sometimes normal and sometimes execution error
org.jinterop.dcom.common.JIException: Unspecified Error. [0x80004005]
and org.jinterop.dcom.core.VariantBody$EMPTY@12c8fa8

How to solve?

Jens Reimann

unread,
Dec 30, 2013, 4:04:57 AM12/30/13
to open...@googlegroups.com

Hi,

It would help to have a stack trace of both errors and a description of what happened. It is hard to make any assumptions.

Jens

--
You received this message because you are subscribed to the Google Groups "openSCADA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openscada+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

14521...@qq.com

unread,
Dec 30, 2013, 4:53:15 AM12/30/13
to open...@googlegroups.com
This error is reported instability;
The reason is that
yesterday stopped once electricity

Recaptured found this wrong。

Opc server is not restarted on it?

在 2013年12月30日星期一UTC+8下午5时04分57秒,Jens Reimann写道:

Jens Reimann

unread,
Dec 30, 2013, 7:30:27 AM12/30/13
to open...@googlegroups.com

I am sorry but I don't understand what you try to say.

If you have a stack trace of your exception I might be able to see the problem.

Reply all
Reply to author
Forward
0 new messages