Bug 40303 - Unable to load from with private:stream due to inability to typedetect
Summary: Unable to load from with private:stream due to inability to typedetect
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Extensions (show other bugs)
Version:
(earliest affected)
3.3.3 release
Hardware: x86 (IA32) Linux (All)
: medium blocker
Assignee: Caolán McNamara
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-23 02:28 UTC by Marc-André Laverdière
Modified: 2011-08-24 08:58 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Test case (942 bytes, text/x-java)
2011-08-24 01:55 UTC, Marc-André Laverdière
Details
File used in test case (6.60 KB, application/vnd.oasis.opendocument.text)
2011-08-24 01:59 UTC, Marc-André Laverdière
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-André Laverdière 2011-08-23 02:28:24 UTC
Either through OOoBean or XComponentLoader I am unable to load a byte array into a document.

Code sample #1:
OOoBean bean = new OOoBean();
bean.loadFromByteArray(..., new PropertyValue[0]);
OfficeDocument loaded = bean.getDocument();

Exception:
com.sun.star.lang.IllegalArgumentException: URL seems to be an unsupported one.
14:42:46.258 [main] ERROR Unable to open document
        at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:177)
java.io.IOException: null
        at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:143)
        at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:335)
        at com.sun.star.comp.beans.OOoBean.loadFromURL(OOoBean.java:691) ~[officebean.jar:na]
        at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:304)
        at com.sun.star.comp.beans.OOoBean.loadFromByteArray(OOoBean.java:787) ~[officebean.jar:na]
        at ...

Code sample #2
PropertyValue[] args = new PropertyValue[]{
  new PropertyValue("InputStream", 0, new ByteArrayToXInputStreamAdapter(...), PropertyState.DIRECT_VALUE)};
XComponent loaded = m_xCompLoader.loadComponentFromURL("private:stream", "_blank", 0, args);
com.sun.star.lang.IllegalArgumentException: URL seems to be an unsupported one.
        at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:177) ~[jurt.jar:na]
        at ...

Environment: Fedora 15. LibreOffice SDK 3.3.3.1. Oracle Java version "1.6.0_25"
Comment 1 Marc-André Laverdière 2011-08-24 01:55:44 UTC
Created attachment 50528 [details]
Test case
Comment 2 Marc-André Laverdière 2011-08-24 01:59:17 UTC
Created attachment 50529 [details]
File used in test case
Comment 3 Marc-André Laverdière 2011-08-24 02:00:42 UTC
Output of running the test case:

com.sun.star.lang.IllegalArgumentException: URL seems to be an unsupported one.
        at com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:177)
        at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:143)
        at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:335)
        at com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:304)
        at com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:91)
        at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:639)
        at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:151)
        at com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:133)
        at $Proxy15.loadComponentFromURL(Unknown Source)
        at com.sun.star.comp.beans.OOoBean.loadFromURL(OOoBean.java:654)
        at com.sun.star.comp.beans.OOoBean.loadFromByteArray(OOoBean.java:787)
main(APITester.java:32)
Comment 4 Caolán McNamara 2011-08-24 08:00:06 UTC
export CLASSPATH=/usr/lib64/libreoffice/basis3.3/program/classes/officebean.jar:/usr/lib64/libreoffice/basis3.3/program/classes/unoil.jar:/usr/lib64/libreoffice/ure/share/java/ridl.jar:/usr/lib64/libreoffice/ure/share/java/juh.jar:/usr/share/java/apache-commons-io.jar:.
javac APITester.java
export UNO_PATH=/usr/lib64/libreoffice/program
java APITester

fails

export UNO_PATH=/home/caolan/LibreOffice/core/install/program
java APITester

works, i.e. local copy of master

export UNO_PATH=/home/caolan/LibreOffice/libreoffice-3-4/install/program/

works, i.e. local copy of 3-4
Comment 5 Caolán McNamara 2011-08-24 08:17:56 UTC
groan, and the second I copy a debugging libfilterconfig1.so into the old one it "works"
Comment 6 Caolán McNamara 2011-08-24 08:19:47 UTC
what comes to mind is possibly the std::hash_map foo change over, there was a difference in the hash thing
Comment 7 Caolán McNamara 2011-08-24 08:42:43 UTC
grrr, loading component library failed: file:///usr/lib64/libreoffice/program/../basis-link/program/libsvgfilterlx.so

its because private:stream causes deep type detection, and if the services for a typedetection isn't there, because that filter is in a different module, then the throw kills off the detection.

I had just copied all my debugging libs in, including the missing one. right
Comment 8 Caolán McNamara 2011-08-24 08:51:54 UTC
I fixed this a long time ago as http://cgit.freedesktop.org/libreoffice/filters/commit/?id=e425df9c7703f23a8aa367f99d9bed354b67c6c4 so should be good in >= 3.4. Didn't backport it to our own 3.3.X, will be in fedora's >= 3.3.3.1-6 if we do another update >= that