5 Replies Latest reply on Nov 6, 2014 5:12 AM by Harald61

    Can't create object for multi instance when using GetObject("myconfig1")

    Harald61 Level 1

      Hello,

       

      I have the Indesign Server CS6 Multi Instance. I create an instance using the InDesign Server Windows Service:
      Port: 12000
      Args: -configuration myconfig1

       

      Now I tried in Visual Basic: GetObject("myconfig1")
      Then I get a can't create ActiveX component exception.

       

      Notes:
      The service "InDesignServerService x64" is running.
      The InDesign Server instance was started.
      I can access the instance via SOAP: http://localhost:12000/

       

      Why can I not create the object in Visual Basic?

       

      Thank you for help!

       

      Harald

        • 1. Re: Can't create object for multi instance when using GetObject("myconfig1")
          Harald61 Level 1

          Hello,

           

          I cannot create the instance using the "InDesignServerService x64".

           

          I can create the instance manually on command line:

          InDesignServer -configuration myconfig1 -port 12000

           

          Then I can create the application object with GetObject("myconfig1").

           

          Why is this not working with the InDesignServerService?

           

          Harald

          • 2. Re: Can't create object for multi instance when using GetObject("myconfig1")
            LeeCommerce

            I found that you need to create the object if it does not already exist, to I implemented that with a try catch, try to get it and if you can't then create it. when you start it I also found it was slow so I have to put a pause in to wait for it. The below code should hopefully be enough to help.

             

              Private Sub AttachToInstance(ObjectName As String, InDesignAppPath As String, ByRef Restarted As Boolean)
                    Try
                        oInDesign = GetObject(ObjectName)
                    Catch ex As Exception ' instance not running, start it
                        Restarted = True
                        StartInDesignInstance(ObjectName, InDesignAppPath)
                        Threading.Thread.Sleep(5000)
                        oInDesign = GetObject(ObjectName)
                    End Try
                End Sub

             

                Private Sub StartInDesignInstance(ObjectName As String, InDesignAppPath As String)
                    Dim ProcessProperties As New ProcessStartInfo
                    ProcessProperties.FileName = "InDesignServer"
                    ProcessProperties.Arguments = "-configuration " & ObjectName
                    ProcessProperties.CreateNoWindow = True
                    ProcessProperties.WorkingDirectory = InDesignAppPath
                    Dim myProcess As Process = Process.Start(ProcessProperties)
                End Sub

            • 3. Re: Can't create object for multi instance when using GetObject("myconfig1")
              Harald61 Level 1

              Thank you for this answer!

              This is the manually starting of the instance. This works also for me.

               

              But my problem is that I cannot start the instance with the InDesignServer Service.

              How can I fix it, so the Service starts InDesignServer.exe and registers the configuration name?

               

              Thank you in advance!

               

              Harald

              • 4. Re: Can't create object for multi instance when using GetObject("myconfig1")
                LeeCommerce Level 1

                Sorry for my misunderstanding. I can't remember the exact details but I do recall I have issues with the service when I finally got it working, that it doesn't really do what you expect it to, do I effectively use this code to manage it myself. I think the issue I had related to permissions, and regardless of what account the service was started in didn't fix the issue.

                Even if the service was started with the same user account as the code was running in for the GetObject, it did not have permission to access it.

                • 5. Re: Can't create object for multi instance when using GetObject("myconfig1")
                  Harald61 Level 1

                  Thank you for your fast response!

                   

                  I have also done some tests with Admin rights, but I cannot access the instance, when it was created by the InDesignServer service.

                  So I think, I have to create the instances manually, like you have done.

                   

                  I wanted to use the InDesignServer service, because the service restarts the instances of the InDesignServer, if they are terminated.

                  So I have to handle this manually.

                   

                  Harald