Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

The system cannot find the file specified. Please check the path provided as parameter. If this exception is being thrown from the WinReg package, please check if the library is registered properly or do so using regsvr32. [0x00000002]

涛哥abc
2013-09-04
2013-09-09
  • 涛哥abc
    涛哥abc
    2013-09-04

    hi,

    i use j-Interop.jar--> run -->

    INFO:
    Recieved RESPONSE
    JIException
    org.jinterop.dcom.common.JIException: The system cannot find the file specified. Please check the path provided as parameter. If this exception is being thrown from the WinReg package, please check if the library is registered properly or do so using regsvr32. [0x00000002]
    at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenKey(JIWinRegStub.java:195)
    at org.jinterop.dcom.core.JIProgId.getIdFromWinReg(JIProgId.java:129)
    at org.jinterop.dcom.core.JIProgId.getCorrespondingCLSID(JIProgId.java:160)
    at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:428)
    at com.aosa.WMI.test.COMReader.main(COMReader.java:33)
    Caused by: org.jinterop.dcom.common.JIRuntimeException: The system cannot find the file specified. Please check the path provided as parameter. If this exception is being thrown from the WinReg package, please check if the library is registered properly or do so using regsvr32. [0x00000002]
    at org.jinterop.winreg.IJIWinReg$openKey.read(IJIWinReg.java:938)
    at ndr.NdrObject.decode(NdrObject.java:36)
    at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:137)
    at rpc.Stub.call(Stub.java:113)
    at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenKey(JIWinRegStub.java:189)
    ... 4 more
    九月 04, 2013 11:37:53 上午 org.jinterop.dcom.core.JISession postDestroy
    INFO: About to destroy links for Session: -635425159 , size of which is 0
    九月 04, 2013 11:37:53 上午 org.jinterop.dcom.core.JIComOxidRuntime destroySessionOIDs
    INFO: destroySessionOIDs for session: -635425159

    my source

    package com.aosa.WMI.test;
    import java.net.UnknownHostException;

    import org.jinterop.dcom.common.JIException;
    import org.jinterop.dcom.common.JISystem;
    import org.jinterop.dcom.core.IJIComObject;
    import org.jinterop.dcom.core.JIClsid;
    import org.jinterop.dcom.core.JIComServer;
    import org.jinterop.dcom.core.JIProgId;
    import org.jinterop.dcom.core.JISession;
    import org.jinterop.dcom.impls.JIObjectFactory;
    import org.jinterop.dcom.impls.automation.IJIDispatch;

    public class COMReader {
    /*
    * @param args

    /
    public static void main(String[] args)
    {
    try
    {
    //First establish a session. All calls happen within the purview of the Session.
    //for localhost , you can use "localhost" and "administrator" (since they have universal access)
    //JISession session = JISession.createSession("localhost","administrator","PASSWORD");
    //76A6415B-CB41-11d1-8B02-00600806D9B6
    //
    JISession session = JISession.createSession("localhost", "kzh", "0608");
    JISystem.setAutoRegisteration(true);
    //JISystem.getLogger().setLevel(Level.FINEST);

            //Now create the COM server to the target machine, this could either be an IP address or a hostname.
            JIComServer comServer = new JIComServer(JIProgId.valueOf("76a64158-cb41-11d1-8b02-00600806d9b6"), "localhost", session);
            //Instantiate the COM Server
            IJIComObject comObject = comServer.createInstance();
            //Get a handle to it's IDispatch
            IJIDispatch dispatch = (IJIDispatch)JIObjectFactory.narrowObject((IJIComObject)comObject.queryInterface(IJIDispatch.IID));
            Object results [] = dispatch.callMethodA("GetComplexType", new Object[]{1});
    
            System.out.println(results[0]);
    
            //...
            //when your work is done
            JISession.destroySession(session);
            //optional step, the session will be destroyed anyways when the application exits
            //but good to do when you are working with many COM servers and are done with a few.
    
        }
        catch( JIException e ) 
        {
            System.out.println("JIException");
            e.printStackTrace();
        }
        catch( UnknownHostException e )
        {
            System.out.println("UnknownHostException");
            e.printStackTrace();
        }
    }
    

    }

    how to solve this question.

    Thanks!!!

     
    • Hi,

      This library is not registered and somehow j-interop could not register it
      either. Could you please run regsvr32 and register it manually.

      best regards,
      Vikram

      On Wed, Sep 4, 2013 at 9:12 AM, "涛哥abc" yangtaochina@users.sf.net wrote:

      hi,

      i use j-Interop.jar--> run -->

      INFO:
      Recieved RESPONSE
      JIException
      org.jinterop.dcom.common.JIException: The system cannot find the file
      specified. Please check the path provided as parameter. If this exception
      is being thrown from the WinReg package, please check if the library is
      registered properly or do so using regsvr32. [0x00000002]
      at
      org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenKey(JIWinRegStub.java:195)
      at org.jinterop.dcom.core.JIProgId.getIdFromWinReg(JIProgId.java:129)
      at org.jinterop.dcom.core.JIProgId.getCorrespondingCLSID(JIProgId.java:160)
      at org.jinterop.dcom.core.JIComServer.(JIComServer.java:428)
      at com.aosa.WMI.test.COMReader.main(COMReader.java:33)
      Caused by: org.jinterop.dcom.common.JIRuntimeException: The system cannot
      find the file specified. Please check the path provided as parameter. If
      this exception is being thrown from the WinReg package, please check if the
      library is registered properly or do so using regsvr32. [0x00000002]
      at org.jinterop.winreg.IJIWinReg$openKey.read(IJIWinReg.java:938)
      at ndr.NdrObject.decode(NdrObject.java:36)
      at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:137)
      at rpc.Stub.call(Stub.java:113)
      at
      org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenKey(JIWinRegStub.java:189)
      ... 4 more
      九月 04, 2013 11:37:53 上午 org.jinterop.dcom.core.JISession postDestroy
      INFO: About to destroy links for Session: -635425159 , size of which is 0
      九月 04, 2013 11:37:53 上午 org.jinterop.dcom.core.JIComOxidRuntime
      destroySessionOIDs
      INFO: destroySessionOIDs for session: -635425159

      my source

      package com.aosa.WMI.test;
      import java.net.UnknownHostException;

      import org.jinterop.dcom.common.JIException;
      import org.jinterop.dcom.common.JISystem;
      import org.jinterop.dcom.core.IJIComObject;
      import org.jinterop.dcom.core.JIClsid;
      import org.jinterop.dcom.core.JIComServer;
      import org.jinterop.dcom.core.JIProgId;
      import org.jinterop.dcom.core.JISession;
      import org.jinterop.dcom.impls.JIObjectFactory;
      import org.jinterop.dcom.impls.automation.IJIDispatch;

      public class COMReader {
      /*
      @param args

      */
      public static void main(String[] args)
      {
      try
      {
      //First establish a session. All calls happen within the purview of the
      Session.
      //for localhost , you can use "localhost" and "administrator" (since they
      have universal access)
      //JISession session =
      JISession.createSession("localhost","administrator","PASSWORD");
      //76A6415B-CB41-11d1-8B02-00600806D9B6
      //
      JISession session = JISession.createSession("localhost", "kzh", "0608");
      JISystem.setAutoRegisteration(true);
      //JISystem.getLogger().setLevel(Level.FINEST);

          //Now create the COM server to the target machine, this could either be an IP address or a hostname.
          JIComServer comServer = new JIComServer(JIProgId.valueOf("76a64158-cb41-11d1-8b02-00600806d9b6"), "localhost", session);
          //Instantiate the COM Server
          IJIComObject comObject = comServer.createInstance();
          //Get a handle to it's IDispatch
          IJIDispatch dispatch = (IJIDispatch)JIObjectFactory.narrowObject((IJIComObject)comObject.queryInterface(IJIDispatch.IID));
          Object results [] = dispatch.callMethodA("GetComplexType", new Object[]{1});
      
          System.out.println(results[0]);
      
          //...
          //when your work is done
          JISession.destroySession(session);
          //optional step, the session will be destroyed anyways when the application exits
          //but good to do when you are working with many COM servers and are done with a few.
      
      }
      catch( JIException e )
      {
          System.out.println("JIException");
          e.printStackTrace();
      }
      catch( UnknownHostException e )
      {
          System.out.println("UnknownHostException");
          e.printStackTrace();
      }}
      

      }

      how to solve this question.

      Thanks!!!

      The system cannot find the file specified. Please check the path provided
      as parameter. If this exception is being thrown from the WinReg package,
      please check if the library is registered properly or do so using regsvr32.
      [0x00000002]https://sourceforge.net/p/j-interop/discussion/840678/thread/dd65fa02/?limit=25#290f


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

      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)

       
      • 涛哥abc
        涛哥abc
        2013-09-04

        sorry!

        i read readme.htm again.but i don't know register any.

        register .jar file?

         
  • 涛哥abc
    涛哥abc
    2013-09-05

    hi,

    Use the OLE/COM Object viewer (Oleview.exe) that is shipped with Microsoft Visual C++ and locate the ProgID in the form of OLEComponent.Object under All Objects.
    Select the COM object, and then from the Object menu, select CoCreateInstance Flags. Make sure that only CLSCTX_LOCAL_SERVER is selected.
    Next, under the Implementation and Inproc Server tabs select Use Surrogate Process and leave the "Path to Custom Surrogate" blank, which allows the Dllhost.exe file to be loaded and the COM DLL brought within it's process space.

    the second step. oleview.exe cann't find COM object.have Other COM*** object.

    i register wbemdisp.dll but have the same problem.

     
  • 涛哥abc
    涛哥abc
    2013-09-09

    someone know how to solution this problem.

    i don't know register any?