|
Quick Lists
|
|
Bug ID:
|
4714674
|
|
Votes
|
2
|
|
Synopsis
|
JEditorPane.setPage(url) blocks AWT thread when HTTP protocol is used
|
|
Category
|
java:classes_swing
|
|
Reported Against
|
hopper
|
|
Release Fixed
|
7(b27)
|
|
State
|
10-Fix Delivered,
bug
|
|
Priority:
|
3-Medium
|
|
Related Bugs
|
|
|
Submit Date
|
15-JUL-2002
|
|
Description
|
setPage method calls getStream and this method tries to check whether URL is redirected (among the other thing like setting language and content type). This can be time consuming (in the case of slow connection or it can wait until timeout expires for unreachable URL) and sometimes even may cause deadlocks. For example if connection requires authentication you may want to display prompt for input data but AWT will be blocked. Another example is when the HTTP connection is provided by the same process and attempts to use GUI.
In NetBeans this problem is workarounded by calling setPage from non AWT thread. But to force reload on the same URL we also use recommended way how to force reload by calling doc.putProperty(Document.StreamDescriptionProperty, null); but as JEditorPane.run accesses this property in AWT thread (line 656 in JEditorPane.java JDK6u2) without null check it can result in NPE - it is typical race condition. Is there any workaround you could recommend us?
New race condition issue is http://www.netbeans.org/issues/show_bug.cgi?id=115293 it contains NPE call stack as attachment for JDK 6u2.
Posted Date : 2007-10-02 16:21:01.0
|
|
Work Around
|
N/A
|
|
Evaluation
|
We are going to need new set of APIs for that. Can not do that for mantis.
Commit to tiger
======================================================================
Posted Date : 2006-10-05 11:58:29.0
Currently async loading is used for POST requests only. This needs to be fixed. We should process POST and GET in a uniform way, taking document's asynchronousLoadPriority into account.
PageLoader makes a perfect use case for SwingWorker - can also be refactored.
Posted Date : 2008-04-03 13:15:24.0
|
|
Comments
|
Submitted On 21-JUL-2004
jon_strabala
This is pretty bad, logged in 2002 and you can not have
JEditorPane.setPage(URL) work with a basic protected
web server.
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|
|
|
 |