Apache OpenOffice (AOO) Bugzilla – Issue 77454
loadFromStream does not works
Last modified: 2013-02-24 21:06:55 UTC
When calling OOoBean.loadFromStream the following error occures: com.sun.star.lang.IllegalArgumentException: URL seems to be an unsupported one. 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 $Proxy15.loadComponentFromURL(Unknown Source) at com.sun.star.comp.beans.OOoBean.loadFromURL(OOoBean.java:662) at com.sun.star.comp.beans.OOoBean.loadFromStream(OOoBean.java:767) at Application.main(Application.java:22) I've tested it on Windows & Suse Linux with Sun's jre 5.0.
Created attachment 45185 [details] A complete Eclipse project to test the issue
mmh, it works for me. A java.io.File(Input|Ouput)Stream has to be created with a system dependent filename, means no URL. If i run the sample with system paths everything works as expected for me
why are you using the Bean here. If you simply want to do some conversion, i would prefer the simple bootstrap mechanism, see for example our NetBeans plugin and the UNO client application project type.
Thanks, I'll check for the UNO client application. The API does not say it requires a FileInputStream, it says InputStream only. This API call worked in OO_2.0 with any InputStream. Actually I have to get a BLOB from a database (an InputStream), I have to convert it, and then pass it back to the database. No files here. This worked fine in 2.0. Unfortunatelly 2.0 was hanging during the conversion of some files and a crash popup window blocked every other conversion after. (The restore and crash popup showed up even after I had burned the -nocrashreport and -norestore option into soffice script.) This was eliminated in 2.2. But the change in the API made me use a workaround: I have to make a temporary file now, do the conversion, then delete the file. So long the whole story. I think if the loadFromStream API changed and now it requires a FileInputStream, the function call should reflect it.
mmh, can you verify if it works with your database InputStream and a normal client application. I assume that it is no specific bean problem but when you are right, it is a bug and we have to check it. Internally the loadFromStream method of the OOBean works with an InputStream, so it should work. You can use XComponentLoader.loadComponentFromURL where you give the input stream as property value (property name "InputStream") and as Url use "private:stream"
jsc -> as: it is no bean specific bug, can you comment it.
.
duplicate to issue #75519# *** This issue has been marked as a duplicate of 75519 ***