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 214132 - GUI Editor is unusable and gives errors loading forms that worked under JDK6 and Run using JDK7 saying no such property for properties that clearly exists in the JDK 7 Source
Summary: GUI Editor is unusable and gives errors loading forms that worked under JDK6 ...
Status: RESOLVED INCOMPLETE
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.1.2
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-13 13:28 UTC by netbeansuzr
Modified: 2012-06-14 18:54 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
test file showing how to reproduce this issue (2.64 KB, application/octet-stream)
2012-06-14 11:08 UTC, netbeansuzr
Details
test file showing how to reproduce this issue (3.66 KB, application/octet-stream)
2012-06-14 11:08 UTC, netbeansuzr
Details
test file showing how to reproduce this issue (80 bytes, application/octet-stream)
2012-06-14 11:09 UTC, netbeansuzr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description netbeansuzr 2012-06-13 13:28:19 UTC
I have a class that extends JTextArea and whenever I open a form which uses this class the form editor gives a lot of errors. "... -> editable no such property exists in the component".  My code has not changed, this code worked fine under JDK 1.6, all I did was update netbeans from 7.0 (might have been 7.1) to 7.1.2, changed my jdk to 1.7.0_04, updated my projects to use JDK7 and I now can't open any GUI forms.  If I run the application through the IDE (netbeans 7.1.2) then it runs perfectly under the new JDK 1.7.0_04.  If I change my projects back to JDK6 (while still referencing JDK7 in my libraries settings) then Netbeans can again open the form.

This really smells like some netbeans files were not updated properly for JDK 7 listing what properties are supported but that's just a theory.

I get all sorts of similar errors for a lot of other classes and properties as well.

I tried updating my IDE and it didn't fix the issue.

This is a SERIOUS issue as I can't open any of my many GUI forms anymore in the new IDE under Java 1.7.  I was developing my projects in NetBeans IDE for a long time always under windows just to give more information.

Please fix this issue A.S.A.P. The IDE is significantly hindered by this bug and I essentially can't develop GUI applications through it until this is fixed.

Thanks.
Comment 1 Jan Stola 2012-06-13 15:23:39 UTC
I am sorry, but this bug report gives no clue on what can be worng. Could you, please, provide more detail? It would be ideal to provide exact steps to reproduce this issue. For example, you may attach a project with the problematic component. It would be also good to attach message.log (NetBeans IDE log file) showing the thrown exceptions.
Comment 2 netbeansuzr 2012-06-13 16:05:36 UTC
I will try to get you the log, but It's hard for me to provide the code.  I also don't have time right now to create another test case to try and reproduce it.

Can you try creating a class that extends JTextArea and add some methods to it then add that to a JFrame GUI in an older version of netbeans under JDK6 then open that project and set the JDK to 7 and try to open the Frame.

I would also suggest checking for any incompatibility of the .form files between IDE versions that may have been introduced and look at the code in the form editor which gets the list of properties.  Somehow the code that find the properties can't find the "editable" property of JTextCOmponent but it clearly exists in the JDK7 code.

I'm also not sure if this error requires a class extending JTextArea.
Comment 3 netbeansuzr 2012-06-13 18:45:27 UTC
I tried making a new JFrame and adding my text area to it and got the following exception:

Cannot load component class MyClass from project <project containing JFrame>.  The class must be compiled and must be on the classpath of
the project to which this form belongs.

I have project A containing MyClass and project B containing my JFrame which depends on project A via add project in the libraries.

I have tried recompiling my class, and cleaning and building the projects but i get the same error.  Again, if i change the JDK to 6 of project A only and clean and build only this project then i can add MyClass to project B.

Did the project dependency code get changed when you switch to JDK 7 form JDK 6?
Comment 4 netbeansuzr 2012-06-14 11:00:18 UTC
here is the excerpt from the log file you asked for

INFO [org.netbeans.modules.parsing.impl.indexing.RepositoryUpdater]: Complete indexing of 131 source roots took: 13786 ms (New or modified files: 0, Deleted files: 0) [Adding listeners took: 984 ms]
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper ignored cancel for 141 ms.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper ignored cancel for 1,077 ms.
INFO [org.netbeans.modules.parsing.impl.TaskProcessor]: Task: class org.netbeans.modules.java.source.JavaSourceAccessor$CancelableTaskWrapper ignored cancel for 109 ms.
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.openide.text.CloneableEditorSupport$3
java.util.ConcurrentModificationException
	at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
	at java.util.AbstractList$Itr.next(AbstractList.java:343)
	at org.netbeans.modules.xml.sync.DataObjectSyncSupport.addRepresentation(DataObjectSyncSupport.java:140)
	at org.netbeans.modules.xml.text.TextEditorSupport$3.stateChanged(TextEditorSupport.java:247)
	at org.openide.text.CloneableEditorSupport.fireStateChangeEvent(CloneableEditorSupport.java:2347)
	at org.openide.text.CloneableEditorSupport.fireDocumentChange(CloneableEditorSupport.java:2330)
	at org.openide.text.CloneableEditorSupport.access$900(CloneableEditorSupport.java:129)
	at org.openide.text.CloneableEditorSupport$3.doRun(CloneableEditorSupport.java:701)
	at org.openide.text.CloneableEditorSupport$3.run(CloneableEditorSupport.java:689)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1411)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1991)
USER: msg
INFO: msg
org.openide.ErrorManager$AnnException: msg
	at org.openide.ErrorManager$AnnException.findOrCreate(ErrorManager.java:870)
	at org.openide.ErrorManager$DelegatingErrorManager.annotate(ErrorManager.java:653)
	at org.openide.ErrorManager.annotate(ErrorManager.java:455)
	at org.netbeans.modules.form.MetaComponentCreator.showClassLoadingErrorMessage(MetaComponentCreator.java:1376)
	at org.netbeans.modules.form.MetaComponentCreator.prepareClass(MetaComponentCreator.java:1348)
	at org.netbeans.modules.form.HandleLayer$NewComponentDropListener.dragEnter(HandleLayer.java:3363)
	at java.awt.dnd.DropTarget.dragEnter(DropTarget.java:341)
	at sun.awt.dnd.SunDropTargetContextPeer.processEnterMessage(SunDropTargetContextPeer.java:312)
	at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEnterEvent(SunDropTargetContextPeer.java:779)
	at sun.awt.dnd.SunDropTargetContextPeer$EventDispatcher.dispatchEvent(SunDropTargetContextPeer.java:747)
	at sun.awt.dnd.SunDropTargetEvent.dispatch(SunDropTargetEvent.java:30)
	at java.awt.Component.dispatchEventImpl(Component.java:4508)
	at java.awt.Container.dispatchEventImpl(Container.java:2099)
	at java.awt.Component.dispatchEvent(Component.java:4481)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
	at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:4366)
	at java.awt.LightweightDispatcher.processDropTargetEvent(Container.java:4304)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4163)
	at java.awt.Container.dispatchEventImpl(Container.java:2085)
	at java.awt.Window.dispatchEventImpl(Window.java:2478)
	at java.awt.Component.dispatchEvent(Component.java:4481)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
	at java.awt.EventQueue.access$000(EventQueue.java:84)
	at java.awt.EventQueue$1.run(EventQueue.java:602)
	at java.awt.EventQueue$1.run(EventQueue.java:600)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
	at java.awt.EventQueue$2.run(EventQueue.java:616)
	at java.awt.EventQueue$2.run(EventQueue.java:614)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:162)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.lang.ClassNotFoundException: MyApps.EmailIp.AdvancedTextArea
	at org.netbeans.modules.form.project.ProjectClassLoader.findClass(ProjectClassLoader.java:183)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.netbeans.modules.form.project.FormClassLoader.findClass(FormClassLoader.java:83)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:247)
	at org.netbeans.modules.form.project.ClassPathUtils.loadClass(ClassPathUtils.java:101)
	at org.netbeans.modules.form.MetaComponentCreator$5.run(MetaComponentCreator.java:1329)
	at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:286)
	at org.openide.util.Mutex.doEventAccess(Mutex.java:1361)
	at org.openide.util.Mutex.readAccess(Mutex.java:320)
	at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:269)
	at org.netbeans.modules.form.MetaComponentCreator.prepareClass(MetaComponentCreator.java:1325)
	... 35 more
msg
Cannot load component class MyApps.EmailIp.AdvancedTextArea from project: <...>\_Projects\NetBeans\_MainClasspath.
The class must be compiled and must be on the classpath of the project to which this form belongs.
WARNING [org.openide.filesystems.Ordering]: Not all children in Loaders/text/x-ant+xml/Factories/ marked with the position attribute: [org-apache-tools-ant-module-loader-AntProjectDataLoader.instance], but some are: [org.apache.tools.ant.module.resources.xml-ergonomics.instance]
Comment 5 netbeansuzr 2012-06-14 11:08:32 UTC
Created attachment 120834 [details]
test file showing how to reproduce this issue
Comment 6 netbeansuzr 2012-06-14 11:08:51 UTC
Created attachment 120835 [details]
test file showing how to reproduce this issue
Comment 7 netbeansuzr 2012-06-14 11:09:05 UTC
Created attachment 120836 [details]
test file showing how to reproduce this issue
Comment 8 netbeansuzr 2012-06-14 11:12:57 UTC
I have uploaded the log file, as well as test files created as I explained earlier which reproduce this error.  

Steps:
create a new java application project
set library JDK to 1.7.0_04
set project jdk setting to "JDK 7"
mount all source files in same package

Open up Test.java and attempt to add TestTextArea to Test using the GUI editor (eg. drag and drop or copy and paste)

You will get the error



If you want to see it work, change the JDK to 6 (not the library JDK), clean and build the project and attempt to add the component again.  It will work.

Please get back to me A.S.A.P. with a resolution to this issue.
Comment 9 Jan Stola 2012-06-14 15:31:45 UTC
I am sorry, I am still not able to reproduce this problem. I tried the following steps and they worked without a problem:

1. Start NetBeans 7.1.2 on JDK 7.
2. Create a new Java Application project.
3. Copy the attached files into the default package of the project.
4. Clean and Build the project.
5. Open Test.java.
6. Drag and drop TestTextArea from Projects window into the designer.
7. Copy and paste TestTextArea from Projects window into the designed.

Both steps 6 and 7 worked fine on my machine. Do these steps produce any problem for you? Is there anything that you do in a different way?

I am lowering the priority of this issue. I understand that this issue is a serious problem for you, but so far you are the only one who is facing it. Hence, it cannot be P1.
Comment 10 netbeansuzr 2012-06-14 18:03:13 UTC
I'm not sure what to say.  I literally created a new project in NetBeans 7.1.2 and copied over the files and changed the JDK and I get this.  I'm not sure how you aren't able to get it.

I'm running on Windows 7 64 bit with the portable version of NetBeans 7.1.2.  Does that reveal anything? Is it different then the binary installed version?

My etc/netbeans.conf points to JDK 1.6.0_25.  Do i need to point it to the 1.7 jdk?  Isn't that jdk only for running the IDE itself?

here are the relevant properties:
netbeans_default_userdir="..\..\Settings\.netbeans\7.1.2"
netbeans_jdkhome="..\..\Java\Windows\jdk1.6.0_25_64bit"

As for your questions if this creates a problem for me, yes. when i try to add the text area to the GUI of Test it gives me the errors i already listed and give me red components in the GUI editor and says that the form could not be loaded and I should not modify it as I will lose changes.  As such I can't edit any of my GUI forms.

Thanks for looking into this.  Is there any way you could investigate this further or provide some suggestions to fix this? Is the issue maybe caused from setting the project to JDK6 and clean and build and then switching to JDK 7 or something wrong with the caching in netbeans? using old copy of the compiled code against a new JDK?
Comment 11 netbeansuzr 2012-06-14 18:25:04 UTC
I tried deleting the .netbeans\7.1.2\var\cache directory and starting the ide but i get the same error.

Any help would be much appreciated.
Comment 12 netbeansuzr 2012-06-14 18:54:03 UTC
I changed the version of the JDK that neatbeans IDE is using to 1.7 and that seems to have fixed the problem.  Can you explain how this error happened?  Why did everything work correctly when the IDE itself was pointed to JDK 6 in it's config file and the project was also set to JDK 6, but as soon as the project was set to JDK 7, NetBeans also had to be changed to use JDK 7.