Exception when saving to file in OpenOffice using UNO API (Java bindings)

Bug #160906 reported by Fabio Da Soghe
4
Affects Status Importance Assigned to Milestone
openoffice.org (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: openoffice.org

I have a blocking problem with OpenOffice in Gutsy. I get the error with the official OpenOffice repository version (2.3.0-1ubuntu5) and with the updated version (2.3.0-1ubuntu5.2) available from http://codeprobe.de/tmp/ooo/ (provided by dAniel hAhler).

I'm using OpenOffice in server mode: I run it on Ubuntu Server 7.10, using xvfb (so I have no gnome desktop). I'm developing a java application that makes use of UNO interface to connect to a live OOo server and do some work on text documents. To achieve this I keep a running OOo instance with this command:

xvfb-run --server-args='-screen 0 800x600x16' -a /usr/lib/openoffice/program/soffice -headless -nologo -norestore accept="socket,host=0.0.0.0,port=2002;urp;" &

The problem I get is an exception when I try to save the document to disk:
com.sun.star.task.ErrorCodeIOException:
at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:187)
at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:153)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:349)
at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:318)
at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:106)
at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:657)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:159)
at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:141)
at $Proxy60.storeAsURL(Unknown Source)

The Java code is this:

public void storeDocComponent(String storeUrl) throws java.lang.Exception {
 storeUrl = storeUrl.replace("\\", "/");
 XStorable xStorable = (XStorable) UnoRuntime.queryInterface(XStorable.class, xComponent);
 PropertyValue[] storeProps = new PropertyValue[1];
 if (storeUrl.endsWith(".doc")) {
  storeProps[0] = new PropertyValue();
  storeProps[0].Name = "FilterName";
  storeProps[0].Value = "MS Word 97";
 }
 xStorable.storeAsURL(storeUrl, storeProps);
 xComponent.dispose();
}

Please note that:
- it's not a write permission issue: I tried to chmod 777 the destination directory with no success, and the OOo engine is able to create the file with 0 length;
- this whole system (my own application, the OOo headless server installation and configuration) works fine in Ubuntu 6.10 (the OOo version is 2.0.4).
- I tried in Ubuntu Server 7.04, with OOo 2.2 with no success (there is another type of error: while inserting an image into the document, but the exception is aways about UNO calls)
- the same installation works fine with OOo 2.3 on windows xp, without changing a single line of code, so I'm confident it's not an UNO API issue changing from OOo 2.0 (which works on Ubuntu 6.10 and windows xp) to OOo 2.3 (which works only on windows xp).

It's almost a week of hard work that I'm trying to resolve this problem with no hope, so now I'm forced (due to my deadline) to setup my production environment with an Ubuntu Server 6.10 (the only system I was able to make working).

If there's any other info/dump/stack trace I can supply, I would be glad to.

Best regards,

Fabio Da Soghe

Revision history for this message
Michael B. Trausch (mtrausch) wrote :

Do you still have the issue if you use an upstream build of OOo? (I mean, the binary version that is on their web site for download)? That is what I tried to ask you on the other bug report before you created this one. And yes, thank you for creating the new bug report because this is a different bug.

Revision history for this message
Fabio Da Soghe (fabio-dasoghe) wrote :

Hi Michael.

The binary version of OOo (from their web site) didn't worked for me: I mean, I was not able to install it. I used the debian package downloadable from the main OOo site: it ends up with unresolved dependencies, both to other packages and to single binary files that I'm not able to resolve myself (I'm near a linux newbe, I'm sorry).

Anyway, I have an update. I did some other digging work and discovered an issue (a bug, to be honest) in my code: under some condition I was writing the output file at a different location from the one I opened at the start of the process. Oddly, in Ubuntu 6.10 this leads OOo to create a whole new file, and all goes fine. On Gutsy, I got the error reported.

I corrected the wrong behavior in my application and now it works in Gutsy! So you were right: it's not an OOo Ubuntu package issue (although it keeps strange the "bug" works on Ubuntu 6.10 (OOo 2.0) and windows (OOo 2.3, same version as Gutsy).

So, to me the problem is resolved. Thank you for your interest.

Best regards,

Fabio

Revision history for this message
Michael B. Trausch (mtrausch) wrote :

Marking invalid per reporter’s most recent comments.

Changed in openoffice.org:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.