Issue 77454 - loadFromStream does not works
Summary: loadFromStream does not works
Status: CLOSED DUPLICATE of issue 75519
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: andreas.schluens
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-17 10:25 UTC by gviczai
Modified: 2013-02-24 21:06 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
A complete Eclipse project to test the issue (7.45 KB, application/x-compressed)
2007-05-17 10:27 UTC, gviczai
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description gviczai 2007-05-17 10:25:32 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.
Comment 1 gviczai 2007-05-17 10:27:33 UTC
Created attachment 45185 [details]
A complete Eclipse project to test the issue
Comment 2 jsc 2007-05-18 13:02:43 UTC
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
Comment 3 jsc 2007-05-18 13:19:15 UTC
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.
Comment 4 gviczai 2007-05-18 21:31:33 UTC
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.
Comment 5 jsc 2007-05-21 07:37:33 UTC
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"
Comment 6 jsc 2007-06-19 08:16:02 UTC
jsc -> as: it is no bean specific bug, can you comment it. 
Comment 7 jsc 2007-06-19 08:16:26 UTC
.
Comment 8 andreas.schluens 2007-06-26 10:39:07 UTC
duplicate to issue #75519#

*** This issue has been marked as a duplicate of 75519 ***
Comment 9 andreas.schluens 2007-06-26 10:39:40 UTC
.