11 Replies Latest reply: Nov 10, 2008 1:51 PM by 843804 RSS

    j-Interop: Open Source, Non Native Java DCOM Bridge

    843804
      For anyone interested:

      j-Interop implements DCOM wire protocol (MSRPC) to enable development of Pure Bi-Directional, Non-Native Java applications which can interoperate with any COM component.The implementation itself is purely in Java and does not use JNI to provide native access,thus being truly platform independent. It has full support for COM automation and supports callback from COM Servers (event handling).

      1.04(a) has been tested on Windows XP/2K/2K3 and Fedora 5. Beta is expected out by third week of September.

      This release can be downloaded from http://sourceforge.net/project/showfiles.php?group_id=174727
        • 1. Re: j-Interop: Open Source, Non Native Java DCOM Bridge
          843804
          New Version 1.05(a) released:-

          1) New Feature: Complete support for Manipulating Windows registry in a non native way. All create/read/update/delete operations supported. Please check the WinReg package.

          2) New Feature: For inproc servers like DLLs and OCXs , and auto register feature has been provided, using this flag in JISystem\JIClsid\JIProgID class can result in the library making all the registry related changes required to run any Inproc server. It is done on the fly.

          Beta will be released next week. If anyone has any feature request, they can send the same to me till mid next week.

          Thanks to all developers for trying j-Interop.

          best regards,
          Vikram

          Message was edited by:
          vikram.roopchand
          • 2. Re: j-Interop: Open Source, Non Native Java DCOM Bridge
            843804
            After 10 months of development and 8 Alphas, I proudly present the first beta. The library will remain in Beta stage for next 2 months before it hits stable.

            I thank all developers for using j-Interop and coming out with some very useful comments.

            best regards,
            Vikram
            • 3. Re: j-Interop: Open Source, Non Native Java DCOM Bridge
              843804
              Another Beta Released.

              Thanks,
              best regards,
              Vikram
              • 4. Re: j-Interop: Open Source, Non Native Java DCOM Bridge
                843804
                1.12 (b) Released.

                Thanks,
                Vikram
                • 5. Re: j-Interop: Open Source, Non Native Java DCOM Bridge
                  843804
                  1.20(b) released.

                  thanks,
                  best regards,
                  Vikram
                  • 6. Re: j-Interop: Open Source, Non Native Java DCOM Bridge
                    843804
                    How would i use j-Interop to show the Windows registry values under:
                    HKEY_LOCAL_MACHINE\SOFTWARE

                    Thanks.
                    • 7. Re: j-Interop: Open Source, Non Native Java DCOM Bridge
                      843804
                      Please have look at the TestWinReg example in the distribution.

                      Thanks,
                      best regards,
                      Vikram
                      • 8. Re: j-Interop: Open Source, Non Native Java DCOM Bridge
                        843804
                        1.21 (RC. 1) Released.

                        Thanks,
                        best regards,
                        Vikram
                        • 9. Re: j-Interop: Open Source, Non Native Java DCOM Bridge
                          843804
                          Dear All,
                          1.22 (RC. 2) Released.

                          Thanks,
                          best regards,
                          Vikram
                          • 10. Re: j-Interop: Open Source, Non Native Java DCOM Bridge
                            843804
                            Hi vikram ,

                            i am using j_Interop_1_21 to communicate with com object. i am getting following exception .

                            my code is

                            public TestCOMServer() throws JIException, UnknownHostException
                                 {
                                      JISession session = JISession.createSession("","","");

                                 
                                      
                                      //instead of this the ProgID "TestCOMServer.ITestCOMServer"     can be used as well.
                                      comStub = new JIComServer(JIProgId.valueOf(session,"PlutusExchange.ExchangeObj.1"),"127.0.0.1",session);
                                      //CLSID of ITestCOMServer
                                      //comStub = new JIComServer(JIClsid.valueOf("44A9CD09-0D9B-4FD2-9B8A-0151F2E0CAD1"),"127.0.0.1",session);
                                 }
                                 
                                 public void execute() throws JIException
                                 {
                                      unknown = comStub.createInstance();
                                      //CLSID of IITestCOMServer
                                      IJIComObject comObject = (IJIComObject)unknown.queryInterface("4AE62432-FD04-4BF9-B8AC-56AA12A47FF9");
                                      dispatch = (IJIDispatch)ComFactory.createCOMInstance(ComFactory.IID_IDispatch,comObject);
                                      
                                      //Now call via automation
                                      Object results[] = dispatch.callMethodA("PL_DoTransactionEx",new Object[]{new Integer(0),"111"});
                                      System.out.println(results[1]);
                                      
                                      //now without automation
                                 /*     JICallObject callObject = new JICallObject(comObject.getIpid());
                                      callObject.setOpnum(1);//obtained from the IDL or TypeLib.
                                      callObject.addInParamAsInt(1,JIFlags.FLAG_NULL);
                                      callObject.addInParamAsInt(2,JIFlags.FLAG_NULL);
                                      callObject.addInParamAsPointer(new JIPointer(new Integer(0)),JIFlags.FLAG_NULL);
                                      //Since the retval is a top level pointer , it will get replaced with it's base type.
                                      callObject.addOutParamAsObject(Integer.class,JIFlags.FLAG_NULL);
                                      results = comObject.call(callObject);
                                      System.out.println(results[0]);
                                      JISession.destroySession(dispatch.getAssociatedSession());*/
                                 }
                                 

                            i am getting following exception.


                            org.jinterop.dcom.common.JIException: Message not found for errorCode: 0xC0000022
                                 at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenHKLM(JIWinRegStub.java:87)
                                 at org.jinterop.dcom.core.JIProgId.getIdFromWinReg(JIProgId.java:114)
                                 at org.jinterop.dcom.core.JIProgId.getCorrespondingCLSID(JIProgId.java:147)
                                 at org.jinterop.dcom.core.JIComServer.<init>(JIComServer.java:182)
                                 at Com.ot.combridge.TestCOMServer.<init>(TestCOMServer.java:33)
                                 at Com.ot.combridge.TestCOMServer.main(TestCOMServer.java:72)
                            Caused by: jcifs.smb.SmbAuthException: Access is denied.
                                 at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:499)
                                 at jcifs.smb.SmbTransport.send(SmbTransport.java:610)
                                 at jcifs.smb.SmbSession.send(SmbSession.java:231)
                                 at jcifs.smb.SmbTree.send(SmbTree.java:102)
                                 at jcifs.smb.SmbFile.send(SmbFile.java:687)
                                 at jcifs.smb.SmbFile.open0(SmbFile.java:827)
                                 at jcifs.smb.SmbFile.open(SmbFile.java:845)
                                 at jcifs.smb.TransactNamedPipeOutputStream.write(TransactNamedPipeOutputStream.java:60)
                                 at jcifs.smb.RpcTransport.send(RpcTransport.java:108)
                                 at rpc.DefaultConnection.transmitFragment(DefaultConnection.java:107)
                                 at rpc.DefaultConnection.transmit(DefaultConnection.java:51)
                                 at rpc.ConnectionOrientedEndpoint.send(ConnectionOrientedEndpoint.java:140)
                                 at rpc.ConnectionOrientedEndpoint.connect(ConnectionOrientedEndpoint.java:160)
                                 at rpc.ConnectionOrientedEndpoint.bind(ConnectionOrientedEndpoint.java:134)
                                 at rpc.ConnectionOrientedEndpoint.call(ConnectionOrientedEndpoint.java:67)
                                 at rpc.Stub.call(Stub.java:113)
                                 at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenHKLM(JIWinRegStub.java:85)
                                 ... 5 more
                            -----------------------------------------------------------------------------------------------
                            Using jacob api i am able to call method in com object but i am not getting response back from that method.

                            my code using jacob api is like this.


                            public static void main(String[] args) throws Exception
                            {
                                 // initializing COM thread

                            ComThread.InitSTA();

                                 // Creating the object
                                 Dispatch sc = new Dispatch("PlutusExchange.ExchangeObj.1");

                                 // Feeding in the amount
                                 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
                                 System.out.print("Enter Data:");
                                 String j = br.readLine();

                                 // Make the call to do transactions
                                 Variant var1 = Dispatch.call(sc,"PL_DoTransactionEx",new Integer(0),j);

                                 // Displaying the response
                                 System.out.println(var1.toString());

                                 // Releasing the components
                                 ComThread.Release();
                            }



                            Please help me how to solve this problem. I need biedirection communication with com object..
                            • 11. Re: j-Interop: Open Source, Non Native Java DCOM Bridge
                              843804
                              Dear All,
                              Version 2.02 (RC 7) released. Details can be found here .

                              best regards,
                              Vikram