Issue 57049 - XDocumentInsertable.insertDocumentFromURL() causes OOo to freeze if the provides URL can't be resolved.
Summary: XDocumentInsertable.insertDocumentFromURL() causes OOo to freeze if the provi...
Status: CLOSED DUPLICATE of issue 73992
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All Windows 2000
: P2 Trivial
Target Milestone: ---
Assignee: thomas.lange
QA Contact: issues@api
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2005-10-31 14:48 UTC by clutz
Modified: 2013-02-24 21:06 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description clutz 2005-10-31 14:48:40 UTC
In some cases the XDocumentInsertable.insertDocumentFromURL() causes OOo to
freeze if the provided URL can't be resolved. The problem only occurs when using
insertDocumentFromURL() from Java. Using StarBasic, there is a correct error
message that tells you that the provided URL can't be resolved.

Here is a code-examples:

import com.sun.star.beans.PropertyValue;
import com.sun.star.comp.helper.Bootstrap;
import com.sun.star.document.XDocumentInsertable;
import com.sun.star.frame.FrameSearchFlag;
import com.sun.star.frame.XComponentLoader;
import com.sun.star.lang.IllegalArgumentException;
import com.sun.star.lang.XComponent;
import com.sun.star.lang.XMultiComponentFactory;
import com.sun.star.text.XText;
import com.sun.star.text.XTextCursor;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XComponentContext;

public class InsertDocumentFromURLTest {

   public static void main(String[] args) throws Exception {
       PropertyValue[] insertProps;

       // bootstrap and create Desktop
       XComponentContext xContext = Bootstrap.bootstrap();
       XMultiComponentFactory xMCF = xContext.getServiceManager();
       Object desktop = xMCF.createInstanceWithContext(
           "com.sun.star.frame.Desktop", xContext);

       // create empty document
       XComponentLoader xLoader = (XComponentLoader) UnoRuntime
           .queryInterface(XComponentLoader.class, desktop);
       XComponent doc = xLoader.loadComponentFromURL(
           "private:factory/swriter", "_blank", FrameSearchFlag.CREATE,
           new PropertyValue[0]);

       // create insertion-textcursor
       XTextDocument xTextDoc = (XTextDocument) UnoRuntime.queryInterface(
           XTextDocument.class, doc);
       XText xText = xTextDoc.getText();
       XTextCursor cursor = xText.createTextCursor();
       XDocumentInsertable xInsert = (XDocumentInsertable) UnoRuntime
           .queryInterface(XDocumentInsertable.class, cursor);

       System.out.println("test 1");

       // trying to insert a document with a non-existing file-URL
       // causes OOo to freeze IF the URL start with a drive letter "c:"
       insertProps = new PropertyValue[] {};
       xInsert.insertDocumentFromURL(
           "file:///c:/aFolder/aNonExistingFile", insertProps);

       System.out.println("test 2");

       // trying to insert a document with a non-existing file-URL
       // causes OOo to freeze IF the URL is an unresolved http-url.
       insertProps = new PropertyValue[] {};
       xInsert.insertDocumentFromURL(
           "http://www.michgibtswirklichnichtglaubichauchnicht.de/index.odt",
insertProps);

       System.out.println("finished!");
       System.exit(0);
   }
}
Comment 1 stephan.wunderlich 2005-11-02 13:09:30 UTC
sw->tl: reproducible on Solaris 
Comment 2 thomas.lange 2006-06-20 14:25:05 UTC
.
Comment 3 thomas.lange 2006-07-07 12:11:19 UTC
The problem does not seem to exist anymore in 680 m173.

Please run the following Basic macro to check
==============================
Sub Main

' create insertion-textcursor
xTextDoc = ThisComponent
xInsert = xTextDoc.getText().createTextCursor()

'msgbox "test 1"

' trying to insert a document with a non-existing file-URL
' causes OOo to freeze IF the URL start with a drive letter "c:"
insertProps = DimArray()
xInsert.insertDocumentFromURL("file:///c:/aFolder/aNonExistingFile", insertProps)

'msgbox "test 2"

' trying to insert a document with a non-existing file-URL
' causes OOo to freeze IF the URL is an unresolved http-url.
insertProps = DimArray()
xInsert.insertDocumentFromURL("http://www.michgibtswirklichnichtglaubichauchnicht.de/index.odt",
insertProps)

msgbox "finished!"

End Sub
==============================

There will be proper messages about a non-existing file/directory and the second
one will report a time-out.
Thus everything seems fine here.

TL->CN: Please confirm. Thanks!
Comment 4 clutz 2006-07-10 15:10:28 UTC
please note: one can't reproduce this bug with basic (as already mentioned
above)! the bug only occurs when using java! Please try my java-example code
instead of the basic code!!!
Comment 5 chne 2006-07-13 07:00:31 UTC
cn->tl: This bug is reproducable with Java. I have adopted the UNO-API-Tests. 
To reproduce just do a
checkapi -o sw.SwXTextCursor::com::sun::star::document::XDocumentInsertable

Note: since cws qadev27 is not integrated please run the test inside a qadev27
environment on windows.
Comment 6 thomas.lange 2006-09-13 17:07:10 UTC
Duplicate to internal issue 136993.
Fixed in CWS jl40 and in CWS jl40_OOD680.
Already integrated in SRC680m182 and OOD680m1.
Thus it will be fine in OOo 2.0.4.

TL->CN: please confirm and close. Thanks!
Comment 7 chne 2006-10-23 16:09:03 UTC
cn->tl: in src680_m189 I get no freeze anymore but a message box appears. This
in the view of API development also a freeze.
Comment 8 thomas.lange 2007-02-06 08:20:34 UTC
Note: qadev27 is already integrated in SRC680 m195
Comment 9 thomas.lange 2007-02-06 08:42:50 UTC
In SRC680 m200 I see two message boxes popping up.
And in essence this issue is the same as issue 73992.
Thus closing this one as duplicate.

*** This issue has been marked as a duplicate of 73992 ***
Comment 10 ace_dent 2008-05-17 20:59:36 UTC
The Issue you raised has been marked as 'Resolved' and not updated within the
last 1 year+. I am therefore setting this issue to 'Verified' as the first step
towards Closing it. If you feel this is incorrect, please re-open the issue and
add any comments.

Many thanks,
Andrew
 
Cleaning-up and Closing old Issues
~ The Grand Bug Squash, pre v3 ~
http://marketing.openoffice.org/3.0/announcementbeta.html
Comment 11 ace_dent 2008-05-17 23:01:34 UTC
As per previous posting: Verified -> Closed.
A Closed Issue is a Happy Issue (TM).

Regards,
Andrew