Unable to start ManagedProcessOfficeManager under a virtual hosting environment

45 views
Skip to first unread message

Asiri Rathnayake

unread,
Mar 7, 2009, 11:03:21 PM3/7/09
to JODConverter
Hi All,

I have a remote virtual host into which I deploy my development
artifacts from time to time. While OfficeManager starts perfectly ok
on my local machine, it gives me the following exception when deployed
on the remote virtual host:

<dump>
Caused by: net.sf.jodconverter.office.OfficeException: failed to start
and connect
at net.sf.jodconverter.office.ManagedOfficeProcess.startAndWait
(ManagedOfficeProcess.java:97)
at net.sf.jodconverter.office.ManagedProcessOfficeManager.start
(ManagedProcessOfficeManager.java:133)
at
org.xwiki.officeimporter.internal.openoffice.DefaultOpenOfficeServerManager.startServer
(DefaultOpenOfficeServerManager.java:161)
... 117 more
Caused by: java.util.concurrent.ExecutionException:
net.sf.jodconverter.office.OfficeException: could not establish
connection
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:205)
at java.util.concurrent.FutureTask.get(FutureTask.java:80)
at net.sf.jodconverter.office.ManagedOfficeProcess.startAndWait
(ManagedOfficeProcess.java:95)
... 119 more
Caused by: net.sf.jodconverter.office.OfficeException: could not
establish connection
at
net.sf.jodconverter.office.ManagedOfficeProcess.doStartProcessAndConnect
(ManagedOfficeProcess.java:160)
at net.sf.jodconverter.office.ManagedOfficeProcess.access$000
(ManagedOfficeProcess.java:39)
at net.sf.jodconverter.office.ManagedOfficeProcess$1.run
(ManagedOfficeProcess.java:91)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:
417)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:595)
Caused by: net.sf.jodconverter.util.RetryTimeoutException:
java.net.ConnectException: connection failed:
'socket,host=127.0.0.1,port=8100'; java.net.ConnectException:
Connection refused
at net.sf.jodconverter.util.Retryable.execute(Retryable.java:47)
at net.sf.jodconverter.util.Retryable.execute(Retryable.java:30)
at
net.sf.jodconverter.office.ManagedOfficeProcess.doStartProcessAndConnect
(ManagedOfficeProcess.java:150)
... 8 more
Caused by: java.net.ConnectException: connection failed:
'socket,host=127.0.0.1,port=8100'; java.net.ConnectException:
Connection refused
at net.sf.jodconverter.office.OfficeConnection.connect
(OfficeConnection.java:96)
at net.sf.jodconverter.office.ManagedOfficeProcess$6.attempt
(ManagedOfficeProcess.java:153)
at net.sf.jodconverter.util.Retryable.execute(Retryable.java:40)
... 10 more
</dump>

Now, with jodconverter 2.2.1 version there was no such problem. I used
to manually start the oo server process and connect to it via
jodconverter from my java code. What could be the reason for this
behaviour?

Also, tracking down the above exception revealed me a possible bug in
jodconverter 3.0-beta-1, consider the following code in
ManagedOfficeProcess:

<code>
private void doStartProcessAndConnect() throws OfficeException {
prepareProfileDir();
try {
process.start();
new Retryable() {
protected void attempt() throws TemporaryException,
Exception {
try {
connection.connect();
} catch (ConnectException connectException) {
throw new TemporaryException
(connectException);
}
}
}.execute(RETRY_INTERVAL, RETRY_TIMEOUT);
} catch (Exception exception) {
throw new OfficeException("could not establish
connection", exception);
}
}
</code>

Here, if the connection attempt fails there would be an unused office
process running on the computer. I think this can easily be fixed by
terminating the office process (if it's running) within the outer
catch block.

WDYT?

Thanks.

- Asiri

Mirko Nasato

unread,
Mar 8, 2009, 7:38:41 AM3/8/09
to jodcon...@googlegroups.com
Hi Asiri,

2009/3/8 Asiri Rathnayake <asiri.ra...@gmail.com>:


>
> I have a remote virtual host into which I deploy my development
> artifacts from time to time. While OfficeManager starts perfectly ok
> on my local machine, it gives me the following exception when deployed
> on the remote virtual host:
>
> <dump>

> ...


> Caused by: net.sf.jodconverter.util.RetryTimeoutException:
> java.net.ConnectException: connection failed:
> 'socket,host=127.0.0.1,port=8100'; java.net.ConnectException:
> Connection refused

> ...
> </dump>
>
JODConverter started the OOo process but couldn't connect to it. The
most likely cause is that you're starting OOo for the first time for
that user so OOo is trying to display the registration wizard. If
that's the case, you can either copy your local OOo profile
(~/.openoffice.org/3) to your remote machine, or check out the latest
trunk that starts OOo with -nofirststartwizard by default.

>
> Also, tracking down the above exception revealed me a possible bug in
> jodconverter 3.0-beta-1, consider the following code in
> ManagedOfficeProcess:
>
> <code>
>  private void doStartProcessAndConnect() throws OfficeException {

>  ...


>    }
> </code>
>
> Here, if the connection attempt fails there would be an unused office
> process running on the computer. I think this can easily be fixed by
> terminating the office process (if it's running) within the outer
> catch block.
>

Well my thinking was that if an exception occurs then somebody will
have to go and manually fix things anyway. But you're right, we should
try and kill the OOo process.

Cheers

Mirko

Asiri Rathnayake

unread,
Mar 8, 2009, 8:13:27 AM3/8/09
to jodcon...@googlegroups.com
Hi Mirko,

> ...
> Caused by: net.sf.jodconverter.util.RetryTimeoutException:
> java.net.ConnectException: connection failed:
> 'socket,host=127.0.0.1,port=8100'; java.net.ConnectException:
> Connection refused
> ...
> </dump>
>
JODConverter started the OOo process but couldn't connect to it. The
most likely cause is that you're starting OOo for the first time for
that user so OOo is trying to display the registration wizard. If
that's the case, you can either copy your local OOo profile
(~/.openoffice.org/3) to your remote machine, or check out the latest
trunk that starts OOo with -nofirststartwizard by default.

Yes, it worked!!!

Thanks :)

- Asiri

Reply all
Reply to author
Forward
0 new messages