This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 207472 - IllegalStateException: getInputStream invoked in AWT
Summary: IllegalStateException: getInputStream invoked in AWT
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 7.2
Hardware: All All
: P2 normal (vote)
Assignee: issues@javaee
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 206311
  Show dependency tree
 
Reported: 2012-01-18 16:09 UTC by Petr Cyhelsky
Modified: 2012-05-05 10:22 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 184543


Attachments
stacktrace (4.65 KB, text/plain)
2012-01-18 16:09 UTC, Petr Cyhelsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Cyhelsky 2012-01-18 16:09:46 UTC
Build: NetBeans IDE Dev (Build 20120118-ab16ccd545a5)
VM: OpenJDK 64-Bit Server VM, 20.0-b11, OpenJDK Runtime Environment, 1.6.0_22-b22
OS: Linux

User Comments:
cyhelsky: refactoring - encapsulate fields




Stacktrace: 
java.lang.IllegalStateException: getInputStream invoked in AWT
   at org.netbeans.modules.masterfs.filebasedfs.fileobjects.FileObj.getInputStream(FileObj.java:219)
   at org.netbeans.modules.j2ee.dd.impl.common.DDUtils.createWebApp(DDUtils.java:156)
   at org.netbeans.modules.j2ee.dd.api.web.DDProvider.getDDRoot(DDProvider.java:134)
   at org.netbeans.modules.web.refactoring.WebRefactoringFactory.getWebApp(WebRefactoringFactory.java:180)
   at org.netbeans.modules.web.refactoring.WebRefactoringFactory.createInstance(WebRefactoringFactory.java:111)
   at org.netbeans.modules.refactoring.api.AbstractRefactoring.getPlugins(AbstractRefactoring.java:142)
Comment 1 Petr Cyhelsky 2012-01-18 16:09:48 UTC
Created attachment 115041 [details]
stacktrace
Comment 2 Marian Mirilovic 2012-04-16 13:04:13 UTC
Increasing priority to P2 - after discussion with performance team and based on the goal for NB 7.2 (performance improvements) especially for remote filesystems.
Comment 3 Petr Hejl 2012-05-03 13:55:56 UTC
I don't see any simple solution. WebApp is at the core of web.xml related refactorings and to get it you might need to load it from the disk.
Comment 4 Petr Jiricka 2012-05-03 16:57:29 UTC
The only thing I can think of is, could we construct the WebApp instance lazily and just pass the ddFile FileObject in the constructor? It looks like this stack trace is just about constructing the refactoring UI, no? And the refactorings will actually be called sometime later, presumably outside of the AWT thread (at which point we would actually create the WebApp instance), no?

Cc'ing also Honza and Ralph so they can comment.
Comment 5 Jan Becicka 2012-05-04 07:43:00 UTC
Don't know, what are you doing, but I guess, that cyhelsky did those tests on J2SE project and your plugins should not be active at all. Fact, that they are active for J2SE projects is performance issue itself, regardless of touching disk or not.
For web projects you can try to put creation of WebApp instance into preCheck() method, which is called outside of AWT.
Comment 6 Petr Jiricka 2012-05-04 07:54:38 UTC
> I guess, that cyhelsky did those tests on J2SE project

Well I don't think so, because in the case of J2SE project, the call of WebModule.getWebModule(sourceFO) in WebRefactoringFactory:106 would return null, and the getWebApp method would not be called. Petr C, can you please comment on how you did the test? Thanks.
Comment 7 Petr Cyhelsky 2012-05-04 08:20:33 UTC
AFAI remember the tests were run on multiple types of projects - when i look into ui gestures of this exception i see that org.netbeans.modules.web.project.WebProject project was open
Comment 8 Petr Hejl 2012-05-04 09:34:26 UTC
(In reply to comment #4)
> The only thing I can think of is, could we construct the WebApp instance lazily
> and just pass the ddFile FileObject in the constructor?
I was afraid of semantical change - valid descriptor versus existing FO. However it looks like WebApp object is constructed for invalid descriptor as well.

I'll try to postpone WebApp construction to preCheck.
Comment 9 Petr Hejl 2012-05-04 12:28:41 UTC
Fixed in web-main 21dbaa40488f.
Comment 10 Quality Engineering 2012-05-05 10:22:06 UTC
Integrated into 'main-golden', will be available in build *201205050400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/21dbaa40488f
User: Petr Hejl <phejl@netbeans.org>
Log: #207472 IllegalStateException: getInputStream invoked in AWT