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 157060 - Swing Editor (Matisse) always freeze
Summary: Swing Editor (Matisse) always freeze
Status: RESOLVED FIXED
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: PC All
: P1 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords: PERFORMANCE
Depends on:
Blocks:
 
Reported: 2009-01-19 14:01 UTC by laurentapo
Modified: 2009-02-19 20:49 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Netbeans log files (19.17 KB, application/x-compressed)
2009-01-19 14:02 UTC, laurentapo
Details
awt-thread-blocked-stacktrace-ActionManager.txt (8.97 KB, text/plain)
2009-01-19 14:59 UTC, Jiri Vagner
Details
awt-thread-blocked-stacktrace-RADComponent-rename.txt (6.09 KB, text/plain)
2009-01-19 14:59 UTC, Jiri Vagner
Details
log netbeans after freeze (34.81 KB, application/x-compressed)
2009-01-19 15:17 UTC, laurentapo
Details
ThreadDump at different time when netbeans (Matisse) freeze (147.50 KB, text/plain)
2009-01-19 15:18 UTC, laurentapo
Details
Thread Dump of netbeasn during freezze (81.89 KB, application/x-compressed)
2009-01-21 17:13 UTC, laurentapo
Details
patched swingapp jar for NB 6.5 (633.78 KB, application/x-compressed)
2009-02-11 12:18 UTC, Tomas Pavek
Details
swingapp module for NB 6.5 with latest patches (634.68 KB, application/x-compressed)
2009-02-11 16:40 UTC, Tomas Pavek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description laurentapo 2009-01-19 14:01:43 UTC
Hello,

I try to use new NetBeans 6.5 before I used 5.5.1. We use it on Windows XP SP2 and Vista and have same problems.
Our source files are saved on SVN server. Our client is TortoiseSVN. We use JDK sun 1.6.0_u05. 

I work on layered project (Persistence, Business Objects, Business Layer, Web services server, Web services client, Rcp
Swing-Jws)
Each layer is separate in modules (common, planning, billing, ...)
So I have many projects (25) and lot of classes (2850).
Projects are linked with jar, they do not reference to an other project.

We use libraries JideSoft, SwingX and MigCalendar and we also create our own library.

When I work with Swing Editor (Matisse), IDE always freeze when I open Class (JPanel or JDialog or ...) or modify
properties of components or add component or save Class.

I can't switch to NetBeans 5.5.1 because it upgrade Swing class to new version.
We are 5 developers and we lose a lot of time.

I post messages, more details and log files at 
http://forums.netbeans.org/viewtopic.php?p=22022#22022

Thanks for your help

Laurent
Comment 1 laurentapo 2009-01-19 14:02:41 UTC
Created attachment 75983 [details]
Netbeans log files
Comment 2 Jiri Vagner 2009-01-19 14:58:10 UTC
Thank you for your report. From your stacktraces I assume that designer freezes while renaming component and while
closing a form. Am I right?

Your log file is almost empty. Please start netbeans, open project and problematic form, force designer to freeze. Than
generate thread dump http://wiki.netbeans.org/GenerateThreadDump and also add ide log file after these steps.

Are you facing the same issue while you are using small standalone project or freshly generated JDA or simple java
project with simple forms?
Comment 3 Jiri Vagner 2009-01-19 14:59:00 UTC
Created attachment 75991 [details]
awt-thread-blocked-stacktrace-ActionManager.txt
Comment 4 Jiri Vagner 2009-01-19 14:59:39 UTC
Created attachment 75992 [details]
awt-thread-blocked-stacktrace-RADComponent-rename.txt
Comment 5 laurentapo 2009-01-19 15:17:02 UTC
Created attachment 75994 [details]
log netbeans after freeze
Comment 6 laurentapo 2009-01-19 15:18:54 UTC
Created attachment 75995 [details]
ThreadDump at different time when netbeans (Matisse) freeze
Comment 7 laurentapo 2009-01-19 15:22:11 UTC
From your stacktraces I assume that designer freezes while renaming component and while
closing a form. Am I right?
Yes it freeze when I click on component, or change property of component, close form (Jpanel or Jdialog)

I post thread dump

Are you facing the same issue while you are using small standalone project or freshly generated JDA or simple java
project with simple forms?
No with small project, it don't freeze.
Comment 8 laurentapo 2009-01-19 15:27:23 UTC
I feel that is worse and worse as if it stacking cache
Comment 9 Jiri Vagner 2009-01-19 15:30:48 UTC
Thank you for your fast response. There is a living issue on refactoring of component variable name
http://www.netbeans.org/issues/show_bug.cgi?id=154512 , it looks like you are facing the same problem. But freeze while
closing a form ... we are going to investigate a little bit.
Comment 10 laurentapo 2009-01-19 15:40:55 UTC
I verify the other issue and all Swing components are private and not protected in my classes.
Comment 11 Jiri Vagner 2009-01-21 09:06:32 UTC
Please, can you start for example rename component variable process and wait till the end? How long does it take?
Comment 12 laurentapo 2009-01-21 09:20:14 UTC
Hello,

It's not only when I rename a component variable.

For example, I open JPanel and I have Properties Window" open on "Events" tab and I change tab to properties and it take
2min and 40s not at each time.
Often I open JPanel, click on component to select it and it freeze between 2 mins.

If I put netbeans window in taskbar and re-open it, it don't display window but only the window's headerbar
Comment 13 laurentapo 2009-01-21 09:31:43 UTC
If you take control of my pc, can it help you?
Comment 14 Tomas Pavek 2009-01-21 16:48:06 UTC
Looking at the code corresponding to the thread stack trace, it looks like your project has the Swing Application
Framework as one of its libraries - it is found on the classpath so it runs a scan to find the Application subclass in
the sources. It is not clear to me why this happens repeatedly - this scan should happen only once for an opened GUI form.

Could you take some thread dump during some of the subsequent freezes?

Could you check if there is the Swing App Framework library somewhere on classpath of your project (or
appframework-1.0.3.jar)?

BTW how many sources does your project have (the one where you have the GUI form)? Thanks
Comment 15 laurentapo 2009-01-21 17:13:56 UTC
Created attachment 76106 [details]
Thread Dump of netbeasn during freezze
Comment 16 laurentapo 2009-01-21 17:23:18 UTC
I put file with lot of thread dump during it freeze.

I use AppFramework-1.01.jar

We have 4 projects (1 container and 3 modules) with swing classes
Container : 75 Java classes and 9 Swing classes included
first module : 548 Java classes and 305 Swing classes included
second module: 55 Java classes and 28 Swing classes included
module: 15 Java classes and 10 Swing classes included
Comment 17 Tomas Pavek 2009-01-21 18:31:41 UTC
Thanks. All thread dumps show the same - scanning sources trying to find the Application class as it thinks it is an 
Swing App Framework based application. Still not clear why it does it repeatedly.

How do you use the AppFramework-1.01.jar? Is your app a full app framework app? I.e. do you have your Application 
subclass, launching the app using it, etc?

Could you search through your project.xml files (in all projects) if they contain "swingapp" element?
Comment 18 laurentapo 2009-01-22 15:51:41 UTC
I used Swing Application Framework in my container project with :
- start class which extends SingleFrameApplication to launch (startup), show and get instance of application
- ApplicationContext to store and restore SessionStorage which contain window graphic option, position

We use
- Application Life Cycle = Yes
- Resource Management = No
- Actions = No
- Tasks = No
- Session State = Yes
- Local Storage = Yes

Here my project.xml of my container:
<swingapp xmlns="http://www.netbeans.org/ns/form-swingapp/1">
            <application-class name="com.mycompany.rcp.swing.container.StartApp"/>
        </swingapp>

Other Swing projects (modules) don't have swingapp element, but they have container's JAR and swing application' JAR in
ClassPath.

Comment 19 pbw 2009-01-29 09:56:28 UTC
I'm having similar issues with Swing GUI Builder. See issue 157580.
Comment 20 Tomas Pavek 2009-01-29 18:18:53 UTC
Is 'com.mycompany.rcp.swing.container.StartApp' still a valid class in your container project?

> Other Swing projects (modules) don't have swingapp element, but they have
> container's JAR and swing application' JAR in ClassPath.

Is it true that the long scan (freeze) happens only when you open a GUI form in those other projects (modules), but all
is ok in the main (container) project?

Can you try to copy the swingapp element to the project.xml of the other projects where you edit the forms - if that helps?
Comment 21 laurentapo 2009-01-30 15:14:02 UTC
Class 'com.mycompany.rcp.swing.container.StartApp' and StartApp.properties are in container'JAR which is in classpath of
all modules.

GUI in container don't freeze.

When I add swingapp element in project.xml of modules, GUI continue to freeze. 
If I open "Project properties" of modules and click on "Application" => "Desktop App" Netbeans freeze (very long more
than 2 minutes) after field "Vendor ID", "Application ID" and "Look & feel" are disabled and project.xml is modified:
swingapp element is deleted.

Comment 22 Tomas Pavek 2009-02-11 12:14:40 UTC
I've made a fix that should reduce the scanning for application class and actions in Swing App Framework based projects.
I think I understood what the problem was in the described projects setup. Still I was not able to reproduce it
completely and some of described behavior (repeated scanning) I can't explain.

So - before I integrate the fix (for NB 7.0), could you test it to verify it really helps with the problem? I'm
attaching a modified jar file for NB 6.5 - you need to replace with it the original file in the IDE
installation/java2/modules folder. (Back up the original file.) Then delete *.dat files in the user dir under var/cache
(according to the message log this should be C:\Documents and Settings\laurent.yhuel\.netbeans\6.5\var\cache on your
machine). Then start NetBeans again and try to reproduce the original problem.
Comment 23 Tomas Pavek 2009-02-11 12:18:09 UTC
Created attachment 76844 [details]
patched swingapp jar for NB 6.5
Comment 24 Tomas Pavek 2009-02-11 12:25:58 UTC
BTW I still wonder about the described project setup - I'd expect the application ("container") project to be the main
one having the "modules" on classpath - not vice versa. If the dependency is from the modules to the application
project, how the StartApp class when started can call any code from the modules?
Comment 25 laurentapo 2009-02-11 13:12:30 UTC
Hello,

I try your patch but when I run netbeans, i've this message:

Warning - could not install some modules: GUI Builder - The module Swing Application Framework Support was requested in
version >= 1.3.2 but only 1.3.1 was found.


Now, Netbeans stop to freeze.
We've installed last patches.
Comment 26 laurentapo 2009-02-11 13:18:33 UTC
For your question about dependency.

Project Container have main class.

Project Container have modules's jar in classpath.
Modules projects have container's jar in classpath.

So when we launch :
-from container: container + alls modules are used
-from 1 module: container + the module are used.

(I hope I was clear enough )
thanks
laurent
Comment 27 Tomas Pavek 2009-02-11 15:17:47 UTC
I see, I need to prepare the JAR against the latest patches (I've made it for the original 6.5 release). In fact if you
don't want to wait, you can simply unpack manifest.mf file from the attached swingapp.jar (the file is in META-INF
directory) and change the spec version from 1.3.1 to 1.3.2. It should work.
Comment 28 Tomas Pavek 2009-02-11 16:40:49 UTC
Created attachment 76872 [details]
swingapp module for NB 6.5 with latest patches
Comment 29 Tomas Pavek 2009-02-13 17:26:25 UTC
Integrated to main:
http://hg.netbeans.org/main/rev/3f69504e9e01
Comment 30 laurentapo 2009-02-16 07:58:14 UTC
Your patch works perfectly.

Thank you very much, 	
great job.

Laurent
Comment 31 Quality Engineering 2009-02-18 10:33:12 UTC
Integrated into 'main-golden', will be available in build *200902180201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/3f69504e9e01
User: Tomas Pavek <tpavek@netbeans.org>
Log: #157060: eliminating scanning for application class, reducing rescans of changed files for actions, removing global list of actions
Comment 32 Tomas Pavek 2009-02-18 12:15:28 UTC
Good to know it works. Thanks for providing all the info needed to reslove this.

Will be also in the upcomming M2 release.