OpenOffice process not starting from Java code

619 views
Skip to first unread message

Fran Diaz

unread,
Dec 1, 2010, 5:49:36 AM12/1/10
to JODConverter
Hello,

I'm experiencing problems when trying to init the Office Manager. My
application runs the following code in order to start the office
service:

officeManager = new
DefaultOfficeManagerConfiguration().setOfficeHome(
this.openofficePath).buildOfficeManager();

try {
officeManager.start();
} catch (OfficeException e) {
log.warn("Office Manager already running");
}

This works fine in an Ubuntu 8.04 hardy with X environment. In fact,
after the app server is started, the soffice process is running:

$prompt$ ps aux | grep soffice
fran 9005 0.0 1.8 133900 38284 pts/1 Sl+ 09:01 0:00 /opt/
openoffice.org3/program/soffice.bin -
accept=socket,host=127.0.0.1,port=2002;urp; -
env:UserInstallation=file:///
tmp/.jodconverter_socket_host-127.0.0.1_port-2002 -headless -
nocrashreport -nodefault -nofirststartwizard -nolockcheck -nologo -
norestore

However, when I run the application in a Ubuntu 8.10 Intepid x64
without X environment, I see the following log messages:

2010-12-01 08:25:21,151 46357 ERROR [STDERR] (main:) 01-dic-2010
8:25:21 org.artofsolving.jodconverter.office.ProcessPoolOfficeManager
<init>
INFO: ProcessManager implementation is UnixProcessManager
2010-12-01 08:25:21,310 46516 ERROR [STDERR] (OfficeProcessThread-0:)
01-dic-2010 8:25:21 org.artofsolving.jodconverter.office.OfficeProcess
start
INFO: starting process with acceptString
'socket,host=127.0.0.1,port=2002,tcpNoDelay=1' and profileDir '/
tmp/.jodconverter_socket_host-127.0.0.1_port-2002'
2010-12-01 08:25:21,509 46715 ERROR [STDERR] (OfficeProcessThread-0:)
01-dic-2010 8:25:21 org.artofsolving.jodconverter.office.OfficeProcess
start
INFO: started process; pid = 27202
2010-12-01 08:25:27,160 52366 ERROR [STDERR] (OfficeProcessThread-0:)
01-dic-2010 8:25:27
org.artofsolving.jodconverter.office.OfficeConnection connect
INFO: connected: 'socket,host=127.0.0.1,port=2002,tcpNoDelay=1'

But when I execute the ps aux | grep soffice command, no soffice
process is running.

I'm using jodconverter 3.0 and openoffice 3.2.1.

Am I forgetting something in my init code?

Regards,

Fran

Brian Fenton

unread,
Dec 1, 2010, 6:07:30 AM12/1/10
to jodcon...@googlegroups.com
Hi

isn't 2002 a reserved port i.e. you need to be root to access it?

Try something like 8123 just to be sure it's not that.

regards
Brian Fenton


--
You received this message because you are subscribed to the Google Groups "JODConverter" group.
To post to this group, send email to jodcon...@googlegroups.com.
To unsubscribe from this group, send email to jodconverter...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jodconverter?hl=en.


Fran Diaz

unread,
Dec 1, 2010, 6:12:37 AM12/1/10
to JODConverter
I forgot to say that the application works if I launch soffice from
command line, but I have to use xvfb-run

xvfb-run soffice "-
accept=socket,host=localhost,port=2002;urp;StarOffice.ServiceManager" -
norestore -nofirststartwizard -nologo -headless &

soffice is supposed to run without xvfb since 3.x versions, but if I
try to execute it without xvfb I get the following message:

Could not find a Java Runtime Environment!
/usr/lib/openoffice/program/soffice.bin X11 error: Can't open
display:
Set DISPLAY environment variable, use -display option
or check permissions of your X-Server
(See "man X" resp. "man xhost" for details)

Thanks in advance.

Fran Diaz

unread,
Dec 1, 2010, 6:53:39 AM12/1/10
to JODConverter
Hello Brian, thanks for your answer but It's not a port issue since I
can run soffice from command line. Anyway, I set the port number you
suggested but I still getting the same: the log message means soffice
to be started, but when I execute a ps command no soffice process is
found. I also tried to run the server in root mode, but it made no
difference :(

Regards.

On 1 dic, 12:07, Brian Fenton <brian.fen...@gmail.com> wrote:
> Hi
>
> isn't 2002 a reserved port i.e. you need to be root to access it?
>
> Try something like 8123 just to be sure it's not that.
>
> regards
> Brian Fenton
>
> > jodconverter...@googlegroups.com<jodconverter%2Bunsu...@googlegroups.com>
> > .

Fran Diaz

unread,
Dec 1, 2010, 7:12:40 AM12/1/10
to JODConverter
I found this topic in the OOo forum:

http://www.oooforum.org/forum/viewtopic.phtml?p=82324

It basically tells that -headless mode allows soffice to run without
gui (for better performance) but it still needs an X window server to
be running. So now the question is:

Does exist a way to launch the Jodconverter Officemanager from Java
code using Xvfb?

Regards

Fran Diaz

unread,
Dec 1, 2010, 10:45:17 AM12/1/10
to JODConverter
Well, that really looks funny: I have figured out that I didn't
uninstall Openoffice 2 before installing Openoffice 3 and I was using
the old Openoffice path... Removing Oo2 and setting the correct Oo
path makes it work.

I'm so sorry for bothering you.

Regards.
Reply all
Reply to author
Forward
0 new messages