spring-attic / spring-ide

Spring Development Environment for Eclipse
300 stars 126 forks source link

Eclipse refactoring crash when rename a class with refactoring #399

Closed acirasa closed 4 years ago

acirasa commented 4 years ago

Hello all, with fresh install of the last version of Eclipse on Windows 10 (jdk 11), a simple rename of a class with refactoring tool cause an error in the log with this stacktrace: java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/corext/refactoring/tagging/ITextUpdating at org.springframework.ide.eclipse.boot.refactoring.TypeRenameParticipant.getUpdateTextualMatches(TypeRenameParticipant.java:141) at org.springframework.ide.eclipse.boot.refactoring.TypeRenameParticipant.access$2(TypeRenameParticipant.java:139) at org.springframework.ide.eclipse.boot.refactoring.TypeRenameParticipant$1.runInUIThread(TypeRenameParticipant.java:113) 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:185) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3961) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3588) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1160) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1049) at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155) at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:633) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:557) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:150) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) 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:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:660) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597) at org.eclipse.equinox.launcher.Main.run(Main.java:1468) Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating cannot be found by org.springframework.ide.eclipse.boot_3.9.10.201909171046-RELEASE at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:514) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:425) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:155) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 29 more

I try with Spring Toolsuite 4 eclipse version and i have the same error

kdvolder commented 4 years ago

with fresh install of the last version of Eclipse on Windows 10 (jdk 11)

Does this mean you tried this with a 'plain' Eclipse (i.e. no STS components, just Eclipse all by itself) and it also has the same problem?

If so, then this is not really a bug in STS but Eclipse and we should report it as a Eclipse bugzilla ticket.

If I misunderstand and you acutally meant you see this problem with STS but not with plain Eclipse then maybe its a problem with STS specifically.

We have to know the difference between these two in order to decide the proper way forward.

So... did you try a vanilla Eclipse? And does the problem also occur there?

acirasa commented 4 years ago

Hello, No, eclipse without STS not have the same problem. When add STS 4 plugin to a fresh install of Eclipse (without the STS plugin) the refactoring stop to work.

Best regards.

Il giorno ven 8 nov 2019 alle 19:20 Kris De Volder notifications@github.com ha scritto:

with fresh install of the last version of Eclipse on Windows 10 (jdk 11)

Does this mean you tried this with a 'plain' Eclipse (i.e. no STS components, just Eclipse all by itself) and it also has the same problem?

If so, then this is not really a bug in STS but Eclipse and we should report it as a Eclipse bugzilla ticket.

If I misunderstand and you acutally meant you see this problem with STS but not with plain Eclipse then maybe its a problem with STS specifically.

We have to know the difference between these two in order to decide the proper way forward.

So... did you try a vanilla Eclipse? And does the problem also occur there?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/spring-projects/spring-ide/issues/399?email_source=notifications&email_token=AFI7TXJDOXZHTKWKOVVBKMDQSWUW3A5CNFSM4JK2G7R2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDS6CSI#issuecomment-551936329, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFI7TXPI56LRW2Q74I5NQVDQSWUW3ANCNFSM4JK2G7RQ .

-- AVVISO DI RISERVATEZZA

Questa e-mail è ad uso esclusivo di colui al quale è indirizzata, e potrebbe contenere informazioni riservate. Se avete ricevuto questa e-mail per errore, o comunque non ne siete il destinatario, ci scusiamo per l'accaduto e Vi invitiamo cortesemente a darcene notizia e a distruggere il messaggio ricevuto. Vi ricordiamo che la diffusione, l'utilizzo e/o la conservazione dei dati ricevuti per errore costituiscono violazioni alle disposizioni del Decreto legislativo n. 196/2003 denominato "Codice in materia di protezione dei dati personali".

Confidentiality noticeThis message and its attachments are addressed solely to the persons aboveand may contain confidential information. If you have received the messagein error, be informed that any use of the content hereof is prohibited.Please return it immediately to the sender and delete the message. Should you have any questions, please contact us by replying to andreaprato.it@gmail.com .Thank you

acirasa commented 4 years ago

I think the most important error row log, in order to find cause of issue is:

java.lang.ClassNotFoundException: org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating cannot be found by org.springframework.ide.eclipse.boot_3.9.10.201909171046-RELEASE

I hope this help

kdvolder commented 4 years ago

java.lang.ClassNotFoundException: org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating cannot be found by org.springframework.ide.eclipse.boot_3.9.10.201909171046-RELEASE

Do you have the full error stack trace? I'm not sure where exactly you pulled that line from. But maybe look in the eclipse error log if you can find the whole stacktrace. The stacktrace could be vey helpful in seeing the cause of the error.

Also can you please provide the exact steps and details how you installed STS into Eclipse and what versions of Eclipse and STS you installed. We would like to try to reproduce this.THe process of installing plugins into Eclipse from update sites or marketplace is somewhat fragile and we need exact details on how you did it to reproduce the steps exactly.

In the mean time, could you please try a full distribution build of STS to see if that works better? Using the full distribution rules out problems caused by the plugin installation process. You can download full distribution release version from here:

https://spring.io/tools

or a snapshot version from here:

http://dist.springsource.com/snapshot/STS4/nightly-distributions.html

Sorry for asking for all these things but the information I have about the problem right now is just not enough to reproduce and figure out what the problem is caused by.

martinlippert commented 4 years ago

First, a quick side note: we have the same package org.springframework.ide.eclipse.boot.refactoring in both bundles org.springframework.ide.eclipse.boot as well as org.springframework.ide.eclipse.boot.refactoring, that should be solved somehow. It doesn't make a lot of sense to have this refactoring-related code being spread around.

On a second note, the class in question (org.eclipse.jdt.internal.corext.refactoring.tagging.ITextUpdating) comes from the org.eclipse.jdt.core.manipulation bundle - and strictly speaking the boot bundle doesn't define a dependency on that bundle as far as I can see. We should add that dependency, otherwise it seems to be somewhat random whether we can see that class or not. I can't reproduce the problem locally, but the missing dependency could still be an issue.

kdvolder commented 4 years ago

@martinlippert Agreed, even if we cannot reproduce the problem... it makes sense to cleanup somewhat the situation with org.springframework.ide.eclipse.boot.refactoring package and its dependencies.

I'll take a look at this now.

kdvolder commented 4 years ago

@acirasa Also my apologies for asking for the 'full stacktrace'. It seems you already included it in the first message of this thread and I completely forgot about it.

spring-projects-issues commented 4 years ago

(comment in Pivotal Tracker added by Kris De Volder:)

The error is reproducible for me now.

Here is how:

This rename triggers the 'TypeRenameParticipant' (i.e. the class from boot support that we see in the stacktrace).

When we proceed with the refactoring the rename participant popups a question. It asks if we also want to rename the DemoApplicationTests class. It is when I answer 'yes' on that dialog that I get the error.