Menu

errorCode: 0x80070005 , but I can access with another wmi client

Help
fallshuang
2014-10-10
2014-10-13
  • fallshuang

    fallshuang - 2014-10-10

    Hi !

    my test environment : linux ,java 1.6 ; wmi server is windows 2012 R2

    I have two client : jinterop java client and wmic linux client (
    http://www.openvas.org/download/wmi/wmi-1.3.14.tar.bz2 )

    1. If I use wmic linux client , I can execute wmi query successfully

    2. If I use my jinterop client, I get this error

    I get this error when use JInerop to open WMI connection:

    org.jinterop.dcom.common.JIException: Message not found for errorCode:
    0x80070005
    at org.jinterop.dcom.core.JIRemUnknownServer.call(JIRemUnknownServer.java:159)
    at org.jinterop.dcom.core.JIRemUnknownServer.addRef_ReleaseRef(JIRemUnknownServer.java:179)
    at org.jinterop.dcom.core.JISession.addRef_ReleaseRef(JISession.java:781)
    at org.jinterop.dcom.core.JIComObjectImpl.addRef(JIComObjectImpl.java:120)
    at org.jinterop.dcom.core.JIComServer.createInstance(JIComServer.java:875)
    at ServiceManager.createCOMServer(ServiceManager.java:153)
    at ServiceManager.execute(ServiceManager.java:89)
    at ServiceManager.stopService(ServiceManager.java:74)
    at ServiceManager.main(ServiceManager.java:50)
    Caused by: org.jinterop.dcom.common.JIRuntimeException: Message not
    found for errorCode: 0x80070005
    at org.jinterop.dcom.core.JICallBuilder.readResult(JICallBuilder.java:1095)
    at org.jinterop.dcom.core.JICallBuilder.read(JICallBuilder.java:969)
    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.JIRemUnknownServer.call(JIRemUnknownServer.java:150)
    ... 8 more

    This is my java code :

                        JISystem.getLogger().setLevel(Level.WARNING);
                        JISystem.setAutoRegisteration(false);
                        dcomSession  =
    

    JISession.createSession("",userName,password);
    dcomSession.useSessionSecurity(false);
    JIComServer comServer = new
    JIComServer(JIClsid.valueOf("8BC3F05E-D86B-11d0-A075-00C04FB68820"),hostIP,dcomSession);

                        IJIDispatch wbemLocator = (IJIDispatch)
    

    narrowObject(comServer.createInstance().queryInterface(IID));
    //parameters to connect to WbemScripting.SWbemLocator
    Object[] params = new Object[] {
    new JIString(hostIP),//strServer
    new
    JIString(win32_namespace),//strNamespace
    JIVariant.OPTIONAL_PARAM(),//strUser
    JIVariant.OPTIONAL_PARAM(),//strPassword
    JIVariant.OPTIONAL_PARAM(),//strLocale

    JIVariant.OPTIONAL_PARAM(),//strAuthority
    new Integer(0),//iSecurityFlags

    JIVariant.OPTIONAL_PARAM()//objwbemNamedValueSet
    };
    JIVariant results[] =
    wbemLocator.callMethodA("ConnectServer", params);
    IJIDispatch wbemServices = (IJIDispatch)
    narrowObject(results[0].getObjectAsComObject());

    Thanks in advance.

    --
    Regards
    Falls Huang

     
    • Vikram Roopchand

      Hi,

      Is this user which you are connecting with the same as that used by openVAS
      ?

      best regards,
      Vikram

      On Fri, Oct 10, 2014 at 2:35 PM, fallshuang fallshuang@users.sf.net wrote:

      Hi !

      my test environment : linux ,java 1.6 ; wmi server is windows 2012 R2

      I have two client : jinterop java client and wmic linux client (
      http://www.openvas.org/download/wmi/wmi-1.3.14.tar.bz2 )

      1.

      If I use wmic linux client , I can execute wmi query successfully
      2.

      If I use my jinterop client, I get this error

      I get this error when use JInerop to open WMI connection:

      org.jinterop.dcom.common.JIException: Message not found for errorCode:
      0x80070005
      at
      org.jinterop.dcom.core.JIRemUnknownServer.call(JIRemUnknownServer.java:159)
      at
      org.jinterop.dcom.core.JIRemUnknownServer.addRef_ReleaseRef(JIRemUnknownServer.java:179)
      at org.jinterop.dcom.core.JISession.addRef_ReleaseRef(JISession.java:781)
      at org.jinterop.dcom.core.JIComObjectImpl.addRef(JIComObjectImpl.java:120)
      at org.jinterop.dcom.core.JIComServer.createInstance(JIComServer.java:875)
      at ServiceManager.createCOMServer(ServiceManager.java:153)
      at ServiceManager.execute(ServiceManager.java:89)
      at ServiceManager.stopService(ServiceManager.java:74)
      at ServiceManager.main(ServiceManager.java:50)
      Caused by: org.jinterop.dcom.common.JIRuntimeException: Message not
      found for errorCode: 0x80070005
      at org.jinterop.dcom.core.JICallBuilder.readResult(JICallBuilder.java:1095)
      at org.jinterop.dcom.core.JICallBuilder.read(JICallBuilder.java:969)
      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.JIRemUnknownServer.call(JIRemUnknownServer.java:150)
      ... 8 more

      This is my java code :

                      JISystem.getLogger().setLevel(Level.WARNING);
                      JISystem.setAutoRegisteration(false);
                      dcomSession  =
      

      JISession.createSession("",userName,password);
      dcomSession.useSessionSecurity(false);
      JIComServer comServer = new

      JIComServer(JIClsid.valueOf("8BC3F05E-D86B-11d0-A075-00C04FB68820"),hostIP,dcomSession);

                      IJIDispatch wbemLocator = (IJIDispatch)
      

      narrowObject(comServer.createInstance().queryInterface(IID));
      //parameters to connect to WbemScripting.SWbemLocator
      Object[] params = new Object[] {
      new JIString(hostIP),//strServer
      new
      JIString(win32_namespace),//strNamespace
      JIVariant.OPTIONAL_PARAM(),//strUser
      JIVariant.OPTIONAL_PARAM(),//strPassword
      JIVariant.OPTIONAL_PARAM(),//strLocale

      JIVariant.OPTIONAL_PARAM(),//strAuthority
      new Integer(0),//iSecurityFlags

      JIVariant.OPTIONAL_PARAM()//objwbemNamedValueSet
      };
      JIVariant results[] =
      wbemLocator.callMethodA("ConnectServer", params);
      IJIDispatch wbemServices = (IJIDispatch)
      narrowObject(results[0].getObjectAsComObject());

      Thanks in advance.

      --
      Regards
      Falls Huang


      errorCode: 0x80070005 , but I can access with another wmi client
      http://sourceforge.net/p/j-interop/discussion/600730/thread/19bb3e16/?limit=25#060e


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/j-interop/discussion/600730/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --
      The Mind is a place of its own. It can make a heaven out of hell or a hell
      out of heaven. Attitude is everything. No matter how adverse conditions
      maybe, one has the capacity to turn things around by one's Determination,
      Perseverance and Hardwork.

      John Milton
      (Paradise Lost)

       

Log in to post a comment.