Skip to content

"Not properly disposed SWT resource" was caused Spring Starter Project #797

Closed

Description

@olkornii

Describe the bug
"Not properly disposed SWT resource" was caused Spring Starter Project.
Stack indicates Spring tooling as origin for SWT error.

OS: fedora 33

Logs:
`null
org.eclipse.ui.ide
Error
Mon Jul 11 11:42:49 CEST 2022
Not properly disposed SWT resource

java.lang.Error: SWT Resource was not properly disposed
at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172)
at org.eclipse.swt.graphics.Resource.(Resource.java:113)
at org.eclipse.swt.graphics.GC.(GC.java:179)
at org.eclipse.swt.graphics.GC.(GC.java:147)
at org.springsource.ide.eclipse.commons.livexp.ui.DescriptionSection.createContents(DescriptionSection.java:99)
at org.springsource.ide.eclipse.commons.livexp.ui.GroupSection.createContents(GroupSection.java:99)
at org.springsource.ide.eclipse.commons.livexp.ui.GroupSection.createContents(GroupSection.java:99)
at org.springframework.ide.eclipse.boot.livexp.ui.DynamicSection.updateContent(DynamicSection.java:88)
at org.springframework.ide.eclipse.boot.livexp.ui.DynamicSection.lambda$0(DynamicSection.java:64)
at org.springsource.ide.eclipse.commons.livexp.core.UIValueListener$1.uiGotValue(UIValueListener.java:75)
at org.springsource.ide.eclipse.commons.livexp.core.UIValueListener$NotifyingJob.runInUIThread(UIValueListener.java:39)
at org.eclipse.ui.progress.UIJob.lambda$0(UIJob.java:95)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:132)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:5000)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4480)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:823)
at org.eclipse.jface.window.Window.open(Window.java:799)
at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:130)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:414)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5794)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1529)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5025)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4477)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:551)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
at org.eclipse.equinox.launcher.Main.main(Main.java:1440)
`

To Reproduce

  1. Install eclipse (Eclipse IDE for Enterprise Java and Web Developers): https://www.eclipse.org/downloads/packages/release/2022-06/r -> install JBossTools (Help -> install new software -> http://download.jboss.org/jbosstools/photon/staging/updates/ -> select all -> next -> next -> Accept terms -> Finish -> Select all -> agree -> restart IDE
  2. Open Red Hat Central (should be already opened) -> "Software/Update" tab -> Find: "Spring" -> select Spring IDE -> install -> restart
  3. open "Java" perspective -> File -> New -> Spring Starter Project -> next -> finish -> SEE ERROR LOG

Sample

No needed.

A link to a GitHub repository with a minimal, reproducible sample.

Reports that include a sample will take priority over reports that do not.
At times, we may require a sample, so it is good to try and include a sample up front.

Activity

  1. added this to the 4.15.2.RELEASE milestone on Jul 26, 2022
  2. kdvolder commented on Jul 28, 2022

    @kdvolder
    Member

    I tried reproducing the issue with our own 'complete' build of STS instead of the setup described above. Unfortunately that didn't reproduce the bug as I was hoping it would. I'll try the more elaborate setup steps with JBoss tools next.

  3. kdvolder commented on Jul 28, 2022

    @kdvolder
    Member

    I was not able to reproduce it, however, the stack trace seems to be pointing pretty clearly at an allocation of a SWT GC object that wasn't being disposed as it should be. So I assume that was actually the problem and fixed it in the above commit.

  4. olkornii commented on Aug 2, 2022

    @olkornii
    Author

    @kdvolder ok, thank you. I'll check it.

  5. olkornii commented on Sep 23, 2022

    @olkornii
    Author

    @kdvolder I tried and this error still appears, but only sometimes for some reasons. Sometimes when creating a new project or importing some project and sometimes when deleting a project.

    So steps are:

    1. Install eclipse (Eclipse IDE for Enterprise Java and Web Developers): https://www.eclipse.org/downloads/packages/release/2022-09/rc1 -> install JBossTools (Help -> install new software -> http://download.jboss.org/jbosstools/photon/staging/updates/ -> select all -> next -> next -> Accept terms -> Finish -> Select all -> agree -> restart IDE
    2. Open Red Hat Central (should be already opened) -> "Software/Update" tab -> Find: "Spring" -> select Spring IDE -> install -> restart
    3. open "Java" perspective -> File -> New -> Spring Starter Project -> next -> (mb try to: select Spring Boot Version 3.0.0) -> finish -> SEE ERROR LOG (if no error in log, then delete project and try again)
      3.1. Instead of Spring Starter Project try to import and delete Spring project: open "Java" perspective -> File -> New -> Import Spring Getting Started Project -> select Authenticating Ldap -> SEE ERROR LOG (if no error in log, then delete projects and try again)
  6. olkornii commented on Dec 14, 2022

    @olkornii
    Author

    @kdvolder still actual for me :(

  7. martinlippert commented on Dec 16, 2022

    @martinlippert
    Member

    Re-opening this one due to the latest comments indicating that this still happens.

  8. BoykoAlex commented on Jan 10, 2023

    @BoykoAlex
    Contributor

    @olkornii do you mind attaching exception stack trace again please? If it is the same exception I expect the line numbers to be different at least... Or it might be the same exception coming from a different UI section...

  9. olkornii commented on Jan 16, 2023

    @olkornii
    Author

    @BoykoAlex There is:
    eclipse.buildId=4.26.0.20221201-1200
    java.version=17.0.5
    java.vendor=Eclipse Adoptium
    BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
    Framework arguments: -product org.eclipse.epp.package.jee.product
    Command-line arguments: -data file:/home/olkornii/eclipse-workspace-jsf/ -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.jee.product

    org.eclipse.ui.ide
    Error
    Mon Jan 16 10:21:47 CET 2023
    Not properly disposed SWT resource

    java.lang.Error: SWT Resource was not properly disposed
    at org.eclipse.swt.graphics.Resource.initNonDisposeTracking(Resource.java:172)
    at org.eclipse.swt.graphics.Resource.(Resource.java:120)
    at org.eclipse.swt.graphics.Image.(Image.java:605)
    at org.eclipse.jface.resource.URLImageDescriptor.createImage(URLImageDescriptor.java:241)
    at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:290)
    at org.eclipse.jface.resource.ImageDescriptor.createImage(ImageDescriptor.java:268)
    at org.eclipse.jface.dialogs.DialogPage.getImage(DialogPage.java:266)
    at org.eclipse.jface.wizard.WizardPage.getImage(WizardPage.java:152)
    at org.eclipse.jface.wizard.WizardDialog.updateTitleBar(WizardDialog.java:1468)
    at org.eclipse.jface.wizard.WizardDialog.update(WizardDialog.java:1321)
    at org.eclipse.jface.wizard.WizardDialog.showStartingPage(WizardDialog.java:1282)
    at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:638)
    at org.eclipse.jface.window.Window.create(Window.java:431)
    at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1094)
    at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:119)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:580)
    at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:414)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
    at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5855)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1529)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5065)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4517)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1155)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1046)
    at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
    at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:643)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:550)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:171)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:402)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1467)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1440)

  10. BoykoAlex commented on Jan 17, 2023

    @BoykoAlex
    Contributor

    Hope 2063ff4 would fix it. Namely the change to WizardPageWithSections. Seems like we forgot to call super.dispose() there which should dispose the page image if there is one. Not sure why I'm not seeing this issue on mac.

  11. martinlippert commented on Jan 17, 2023

    @martinlippert
    Member

    @olkornii Feel free to give the latest nightly builds a try, would be interesting to hear back from you whether you still see the issue on your end or not: https://dist.springsource.com/snapshot/STS4/nightly-distributions.html

  12. olkornii commented on Feb 7, 2023

    @olkornii
    Author

    @martinlippert @BoykoAlex
    We stopped testing Spring due to lack of resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

for: eclipsetheme: getting-startedtype: bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions