1

I try to convert odt-Files to doc-Files using OpenOffice. Installed Version is 3.1.1 and can't be changed at the moment. Perl Version is 5.18.

The Perl-module OpenOffice::UNO is used for this conversion. Unfortunately in newer Versions of OpenOffice/LibreOffice do not support Perl anymore.

The Script calls OpenOffice headless using xvfb.

Here is the code used:

 `# Launch OpenOffice.org as a server
$ ooffice \
"-accept=socket,host=localhost,port=8100;urp;StarOffice.ServiceManager"

use OpenOffice::UNO;

# connect to the OpenOffice.org server
$uno = OpenOffice::UNO->new;
$cxt = $uno->createInitialComponentContext('file:///.../path/perluno');
$sm  = $cxt->getServiceManager;
$resolver = $sm->createInstanceWithContext
              ("com.sun.star.bridge.UnoUrlResolver", $cxt);
$rsm = $resolver->resolve
  ("uno:socket,host=localhost,port=8100;urp;StarOffice.ServiceManager");

# get an instance of the Desktop service
$rc = $rsm->getPropertyValue("DefaultContext");
$desktop = $rsm->createInstanceWithContext("com.sun.star.frame.Desktop", $rc);
.....`

On the last included line to create $desktop i get following Error message:

terminate called after throwing an instance of 'com::sun::star::container::NoSuchElementException'

Is there any way to fix this problem? Tried to understand the Code of the UNO-interface, especially UNO.xs but there has not been any information about the call "createInstanceWithContext".

Looking through the OpenOffice-documentation does not provide any information about this either.

It would also help just to get the complete java error message, to make sure what element is missing.

The file "perluno" has the content:

[Bootstrap]
UNO_TYPES=/usr/lib64/openoffice.org//program/types.rdb
UNO_SERVICES=/usr/lib64/openoffice.org//program/services.rdb
4

0 に答える 0