Stack overflow when insert custom component

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Stack overflow when insert custom component

Postby macman » Tue Jun 27, 2006 12:09 am

We use SwingDesigner in conjunction with a library of custom components which derivate from Swing component. For example, we've got a BuilderButton which derivate from JButton.

When we insert a BuilderButton into a JInternalFrame or when opened a existing JInternalFrame, SwingDesigner froze for some time. The hard disk write some data and then Eclipse quits.

In the .log file we've got this overflow error:

!ENTRY com.swtdesigner 4 4 2006-06-27 09:28:00.931
!MESSAGE Designer internal error [5.0.0.2006.06.23]: java.lang.StackOverflowError
!STACK 0
java.lang.StackOverflowError
at java.io.FileOutputStream.writeBytes(Native Method)
at java.io.FileOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.write(Unknown Source)
at java.io.PrintStream.write(Unknown Source)
at sun.nio.cs.StreamEncoder$CharsetSE.writeBytes(Unknown Source)
at sun.nio.cs.StreamEncoder$CharsetSE.implFlushBuffer(Unknown Source)
at sun.nio.cs.StreamEncoder.flushBuffer(Unknown Source)
at java.io.OutputStreamWriter.flushBuffer(Unknown Source)
at java.io.PrintStream.write(Unknown Source)
at java.io.PrintStream.print(Unknown Source)
at java.io.PrintStream.println(Unknown Source)
at java.lang.Throwable.printStackTrace(Unknown Source)
at java.lang.Throwable.printStackTrace(Unknown Source)
at com.swtdesigner.DesignerPlugin.log(DesignerPlugin.java:403)
at com.swtdesigner.model.properties.NonVisualBeanComplexProperty.getProperties(NonVisualBeanComplexProperty.java:24)
at com.swtdesigner.properties.editors.complex.DelegatingComplexPropertyEditor.getProperties(DelegatingComplexPropertyEditor.java:10)
at com.swtdesigner.model.properties.PropertyUtilities.isVisible(PropertyUtilities.java:49)
at com.swtdesigner.model.JavaInfo.getProperties(JavaInfo.java:1053)
at com.swtdesigner.model.properties.NonVisualBeanComplexProperty.getProperties(NonVisualBeanComplexProperty.java:22)
at com.swtdesigner.properties.editors.complex.DelegatingComplexPropertyEditor.getProperties(DelegatingComplexPropertyEditor.java:10)
at com.swtdesigner.model.properties.PropertyUtilities.isVisible(PropertyUtilities.java:49)
at com.swtdesigner.model.JavaInfo.getProperties(JavaInfo.java:1053)
at com.swtdesigner.model.properties.NonVisualBeanComplexProperty.getProperties(NonVisualBeanComplexProperty.java:22)
at com.swtdesigner.properties.editors.complex.DelegatingComplexPropertyEditor.getProperties(DelegatingComplexPropertyEditor.java:10)
at com.swtdesigner.model.properties.PropertyUtilities.isVisible(PropertyUtilities.java:49)
at com.swtdesigner.model.JavaInfo.getProperties(JavaInfo.java:1053)
at com.swtdesigner.model.properties.NonVisualBeanComplexProperty.getProperties(NonVisualBeanComplexProperty.java:22)
at com.swtdesigner.properties.editors.complex.DelegatingComplexPropertyEditor.getProperties(Delegating...

It continues for pages and pages...

There seems to be a recursivity error (with serialization).

I cannot find where the problem is. I spend one day and an half on this without finding anything.

Best regards,

Roger
macman
 
Posts: 2
Joined: Mon Jun 26, 2006 11:02 pm

Re: Stack overflow when insert custom component

Postby Eric Clayberg » Tue Jun 27, 2006 3:29 am

Please send a test case as well as your complete Eclipse ".log" file to wb-support@instantiations.com.

We need to be able to reproduce the problem in order to help you.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby macman » Tue Jun 27, 2006 4:09 am

If I extract the component class and the JInternalFrame class and place them into a test case project, the problem disappear. It seems like Swing Designer try to parse/examine every class in the project/package when we click on the "design" tab of the main designer view.

I've just sent you a project that reproduce the problem.

Best Regards,

Roger
macman
 
Posts: 2
Joined: Mon Jun 26, 2006 11:02 pm

Postby Eric Clayberg » Thu Jun 29, 2006 11:38 am

macman wrote:If I extract the component class and the JInternalFrame class and place them into a test case project, the problem disappear.

If you add back other classes, can you identify when the problem reappears?

macman wrote:It seems like Swing Designer try to parse/examine every class in the project/package when we click on the "design" tab of the main designer view.

No. Swing Designer only parses the class you are editing. Referenced classes are not parsed. Custom components are instantiated just like any other component (by calling their default constructors).

macman wrote:I've just sent you a project that reproduce the problem.

We tried your project on several different machines and several different versions of Eclipse and did not encounter any problems.

As an experiment, what happens if you create a new Eclipse install with only Swing Designer present and then load your project and test case?
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest