You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2015/03/03 10:49:57 UTC

[Issue 126148] New: Multiple open office services are associated to same PID(OS)

https://bz.apache.org/ooo/show_bug.cgi?id=126148

          Issue ID: 126148
        Issue Type: DEFECT
           Summary: Multiple open office services are associated to same
                    PID(OS)
           Product: App Dev
           Version: 4.1.1
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: critical
          Priority: P5
         Component: sdk
          Assignee: issues@openoffice.apache.org
          Reporter: jvchbabu@gmail.com

We recently upgraded to open office 4.1.1
version(Apache_OpenOffice_incubating_4.1.1_Win_x86_install_en-US.exe).We
installed it and and connect to open office 4.1.1 with UNO Java API.
We used to start the open office from commnad prompt by issue the below
command. We kill and start the open office service by process id if our
application found issues with open office processing(hung, failed to connect).

Command :C:\Program Files (x86)\OpenOffice 4\program\soffice -invisible
-"accept=socket,host=0,port=8100;urp"&

We tried to start the multiple open office services by providing multiple port
numbers such as below
C:\Program Files (x86)\OpenOffice 4\program\soffice -invisible
-"accept=socket,host=0,port=8100;urp" &
C:\Program Files (x86)\OpenOffice 4\program\soffice -invisible
-"accept=socket,host=0,port=8600;urp" &

Both the ports are listening on their respective ports but surprisingly the
process associated to them is one.When there is failure with respective any one
of the service, killing and starting the open services stops all ports.But we
wanted at least one service should available to serve the requests, any
solution/suggestions/alternatives to have such kind of multiple services.

Is there a specific restriction to have singleton for the remote context of
XComponentContext type?

We use the below code snippet to create and get the service manager instance.

         XComponentContext xRemoteContext =null;
      if (xRemoteContext ==null  ) {


         XComponentContext xLocalContext = com.sun.star.comp.helper.Bootstrap
               .createInitialComponentContext(null);
         XMultiComponentFactory xLocalServiceManager = xLocalContext
               .getServiceManager();
         Object urlResolver = xLocalServiceManager
               .createInstanceWithContext(
                     "com.sun.star.bridge.UnoUrlResolver", xLocalContext);

         XUnoUrlResolver xUnoUrlResolver = (XUnoUrlResolver) UnoRuntime
               .queryInterface(XUnoUrlResolver.class, urlResolver);


         Object initialObject = xUnoUrlResolver.resolve(unoUrl);
         XPropertySet xPropertySet = (XPropertySet) UnoRuntime
               .queryInterface(XPropertySet.class, initialObject);
         Object context = xPropertySet.getPropertyValue("DefaultContext");

            xRemoteContext=(XComponentContext) UnoRuntime.queryInterface(
               XComponentContext.class, context));


      }

      return xRemoteContext.get("8100").getServiceManager();
}

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126148] Multiple open office services are associated to same PID(OS)

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=126148

Ariel Constenla-Haile <ar...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |CLOSED

--- Comment #3 from Ariel Constenla-Haile <ar...@apache.org> ---
Closing

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126148] Multiple open office services are associated to same PID(OS)

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=126148

--- Comment #4 from jvchbabu <jv...@gmail.com> ---
(In reply to Ariel Constenla-Haile from comment #2)
> (In reply to jvchbabu from comment #0)
> > We tried to start the multiple open office services by providing multiple
> > port numbers such as below
> > C:\Program Files (x86)\OpenOffice 4\program\soffice -invisible
> > -"accept=socket,host=0,port=8100;urp" &
> > C:\Program Files (x86)\OpenOffice 4\program\soffice -invisible
> > -"accept=socket,host=0,port=8600;urp" &
> > 
> > Both the ports are listening on their respective ports but surprisingly the
> > process associated to them is one.
> 
> That's because OpenOffice is using the same user profile in both cases.
> You must specify a different user directory. For example:
> 
> ~]$ openoffice4 -env:UserInstallation=file:///tmp/test_aoo1 > /dev/null 2>&1
> &
> [1] 9743
> ~]$ openoffice4 -env:UserInstallation=file:///tmp/test_aoo2 > /dev/null 2>&1
> &
> [2] 9820
> 
> Just use -env:UserInstallation=file://<path to separate user dir>
> 
> 
> 
> 
> 
> 
> 
> 
> 
> When there is failure with respective any
> > one of the service, killing and starting the open services stops all
> > ports.But we wanted at least one service should available to serve the
> > requests, any solution/suggestions/alternatives to have such kind of
> > multiple services.
> > 
> > Is there a specific restriction to have singleton for the remote context of
> > XComponentContext type?
> > 
> > We use the below code snippet to create and get the service manager instance.
> > 
> >          XComponentContext xRemoteContext =null;
> >       if (xRemoteContext ==null  ) {
> >             
> >          
> >          XComponentContext xLocalContext = com.sun.star.comp.helper.Bootstrap
> >                .createInitialComponentContext(null);
> >          XMultiComponentFactory xLocalServiceManager = xLocalContext
> >                .getServiceManager();
> >          Object urlResolver = xLocalServiceManager
> >                .createInstanceWithContext(
> >                      "com.sun.star.bridge.UnoUrlResolver", xLocalContext);
> >          
> >          XUnoUrlResolver xUnoUrlResolver = (XUnoUrlResolver) UnoRuntime
> >                .queryInterface(XUnoUrlResolver.class, urlResolver);
> >          
> >          
> >          Object initialObject = xUnoUrlResolver.resolve(unoUrl);
> >          XPropertySet xPropertySet = (XPropertySet) UnoRuntime
> >                .queryInterface(XPropertySet.class, initialObject);
> >          Object context = xPropertySet.getPropertyValue("DefaultContext");
> >          
> >             xRemoteContext=(XComponentContext) UnoRuntime.queryInterface(
> >                XComponentContext.class, context));
> >          
> >          
> >       }
> > 
> >       return xRemoteContext.get("8100").getServiceManager();
> > }

 Starting the open office services with different user profiles will land us in
problems while restating the open office services through java
process(programatic restart of OO with Java), as open office services and java
process should be owned by the same user.

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126148] Multiple open office services are associated to same PID(OS)

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=126148

Regina Henschel <rb...@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |NOT_AN_ISSUE
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |rb.henschel@t-online.de

--- Comment #1 from Regina Henschel <rb...@t-online.de> ---
This is a support request and not a bug report.

Because your scenario is very special, you should try to contact developers.
You can write a mail to dev@openoffice.apache.org or api@openoffice.apache.org,
which is more specific but with less subscribers. You can ask on
irc://chat.freenode.net/libreoffice-dev. It is a LibreOffice channel, but that
channel is active and most developers of LibreOffice have a good knowledge
about OpenOffice.

In addition you can try 'Macros and UNO API' on
https://forum.openoffice.org/en/forum/

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126148] Multiple open office services are associated to same PID(OS)

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=126148

jvchbabu <jv...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P5                          |P2

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126148] Multiple open office services are associated to same PID(OS)

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=126148

--- Comment #2 from Ariel Constenla-Haile <ar...@apache.org> ---
(In reply to jvchbabu from comment #0)
> We tried to start the multiple open office services by providing multiple
> port numbers such as below
> C:\Program Files (x86)\OpenOffice 4\program\soffice -invisible
> -"accept=socket,host=0,port=8100;urp" &
> C:\Program Files (x86)\OpenOffice 4\program\soffice -invisible
> -"accept=socket,host=0,port=8600;urp" &
> 
> Both the ports are listening on their respective ports but surprisingly the
> process associated to them is one.

That's because OpenOffice is using the same user profile in both cases.
You must specify a different user directory. For example:

~]$ openoffice4 -env:UserInstallation=file:///tmp/test_aoo1 > /dev/null 2>&1 &
[1] 9743
~]$ openoffice4 -env:UserInstallation=file:///tmp/test_aoo2 > /dev/null 2>&1 &
[2] 9820

Just use -env:UserInstallation=file://<path to separate user dir>









When there is failure with respective any
> one of the service, killing and starting the open services stops all
> ports.But we wanted at least one service should available to serve the
> requests, any solution/suggestions/alternatives to have such kind of
> multiple services.
> 
> Is there a specific restriction to have singleton for the remote context of
> XComponentContext type?
> 
> We use the below code snippet to create and get the service manager instance.
> 
>          XComponentContext xRemoteContext =null;
>       if (xRemoteContext ==null  ) {
>             
>          
>          XComponentContext xLocalContext = com.sun.star.comp.helper.Bootstrap
>                .createInitialComponentContext(null);
>          XMultiComponentFactory xLocalServiceManager = xLocalContext
>                .getServiceManager();
>          Object urlResolver = xLocalServiceManager
>                .createInstanceWithContext(
>                      "com.sun.star.bridge.UnoUrlResolver", xLocalContext);
>          
>          XUnoUrlResolver xUnoUrlResolver = (XUnoUrlResolver) UnoRuntime
>                .queryInterface(XUnoUrlResolver.class, urlResolver);
>          
>          
>          Object initialObject = xUnoUrlResolver.resolve(unoUrl);
>          XPropertySet xPropertySet = (XPropertySet) UnoRuntime
>                .queryInterface(XPropertySet.class, initialObject);
>          Object context = xPropertySet.getPropertyValue("DefaultContext");
>          
>             xRemoteContext=(XComponentContext) UnoRuntime.queryInterface(
>                XComponentContext.class, context));
>          
>          
>       }
> 
>       return xRemoteContext.get("8100").getServiceManager();
> }

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126148] Multiple open office services are associated to same PID(OS)

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=126148

--- Comment #5 from Ariel Constenla-Haile <ar...@apache.org> ---
(In reply to jvchbabu from comment #4)
> > > Both the ports are listening on their respective ports but surprisingly the
> > > process associated to them is one.
> > 
> > That's because OpenOffice is using the same user profile in both cases.
> > You must specify a different user directory. For example:
> > 
> > ~]$ openoffice4 -env:UserInstallation=file:///tmp/test_aoo1 > /dev/null 2>&1
> > &
> > [1] 9743
> > ~]$ openoffice4 -env:UserInstallation=file:///tmp/test_aoo2 > /dev/null 2>&1
> > &
> > [2] 9820
> > 
> > Just use -env:UserInstallation=file://<path to separate user dir>
>
>  Starting the open office services with different user profiles will land us
> in problems while restating the open office services through java
> process(programatic restart of OO with Java), as open office services and
> java process should be owned by the same user.

No, as long as you run the commands that start OpenOffice as the same user, the
processes are owned by the same user; it's not about different Windows user
profiles, it's just about different OpenOffice's user profiles owned by the
same Windows user.

Try the suggestion in Comment 3. Just open cmd.exe and type both commands.
Example:

C:\Users\ariel>"C:\Program Files (x86)\OpenOffice 4\program\soffice.exe"
"-env:UserInstallation=file:///C:/Users/ariel/aoo_1"
"-accept=socket,host=localhost,port=8001;urp"

C:\Users\ariel>"C:\Program Files (x86)\OpenOffice 4\program\soffice.exe"
"-env:UserInstallation=file:///C:/Users/ariel/aoo_2"
"-accept=socket,host=localhost,port=8009;urp"


C:\Users\ariel>tasklist /FI "IMAGENAME eq soffice.bin" /FI "USERNAME eq ariel"

Image Name                     PID Session Name        Session#    Mem Usage
========================= ======== ================ =========== ============
soffice.bin                   2532 Console                    1     37,992 K
soffice.bin                   4384 Console                    1     53,404 K


C:\Users\ariel>netstat -nao -p TCP

Active Connections

  Proto  Local Address          Foreign Address        State           PID
  TCP    127.0.0.1:8001         0.0.0.0:0              LISTENING       2532
  TCP    127.0.0.1:8009         0.0.0.0:0              LISTENING       4384

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126148] Multiple open office services are associated to same PID(OS)

Posted by bu...@apache.org.
https://bz.apache.org/ooo/show_bug.cgi?id=126148

brinzing <ol...@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |oliver.brinzing@gmx.de

--- Comment #6 from brinzing <ol...@gmx.de> ---
.

-- 
You are receiving this mail because:
You are the assignee for the issue.