eclipse-m2e/m2e-core

update m2e corrupts search

Closed this issue ยท 5 comments

SCENARIO:
Eclipse 2024-06 for Java EE
Help -> About... -> Installation details -> select M2E - Maven integration for Eclipse (2.6.1....), press Update...

Go through the update procedure (it ends up with M2E - Maven Integration for Eclipse 2.6.2.20240828-1954).

After Eclipse restart try to use Search in Eclipse

EXPECTED:
Search works

ACTUALLY:

Text Search
An internal error occurred during: "File Search Worker".
'byte[] org.eclipse.core.resources.IFile.readNBytes(int)'

The issue is similar to the one reported for another plug-in Genuitec/Copilot4Eclipse-community#23

Maybe it's related to Eclipse update itself and not to specific plugins?

Maybe it's related to Eclipse update itself and not to specific plugins?

That is very unlikely. Please verify whether this can be reproduced with a fresh installation and a fresh workspace. There have been a couple of similar issues caused by plugins from the same vendor which persisted even after disabling or even after uninstalling those plugins.

The bug has already been confirmed in the link you mentioned that it is not caused by Eclipse itself or m2e:

We apologize for this inconvenience.

DETAILS
Thanks for sharing this info. We identified a really odd situation where somewhere (haven't isolated it) there is a loose specification on the eclipse search.core plugin. And because Copilot4Eclipse setup Eclipse to look for it's dependent plugins from the latest Eclipse distro it resulted in the Eclipse provisioning system optimistically picking up a new search plugin version from the recent 2024-09 release. This created an incompatibility with the Eclipse search facility.

Hello @howlger.
I was able to reproduce the problem after m2e update on clean workspace, without CoPilot or any other custom plug-ins installed except for those bundled into Eclipse 2024-06 for Java EE

I can reproduce it. It is not related to m2e and to third-party plugins. It is an Eclipse platform issue, and maybe also a p2 (Eclipse Equinox) issue.

It is unclear to me why in the Eclipse IDE for Enterprise Java and Web Developers 2024-06 updating M2E - Maven Integration for Eclipse to 2.6.2.20240828-1954 also updates the unrelated org.eclipse.search.core plugin. Also the embedded Java (org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64) is updated from 21.0.3.v20240426 to 21.0.5.v20241023-1957.

There is a bug in org.eclipse.search.core 3.16.300.v20240708-0708 requiring org.eclipse.core.resources 3.14 instead of 3.21.100 or higher which results in org.eclipse.core.resources not being updated causing this issue. eclipse-platform/eclipse.platform.ui#2510 should fix that bug for upcoming releases.

As workaround update to Eclipse 2024-09.

Just as an info for everyone else who stumbles upon this problem:
I managed to uninstall the updated org.eclipse.search.core plugin and reinstall an old version via the following commands:

eclipsec.exe -application org.eclipse.equinox.p2.director -uninstallIU org.eclipse.search.core
eclipsec.exe -application org.eclipse.equinox.p2.director -repository https://download.eclipse.org/releases/2023-12/ -installIU org.eclipse.search.core

For those who are on Mac this code will of course not work, so here are the versions of these lines that work for Mac

/Applications/Eclipse\ 202403.app/Contents/MacOS/eclipse -application org.eclipse.equinox.p2.director -uninstallIU org.eclipse.search.core

/Applications/Eclipse\ 202403.app/Contents/MacOS/eclipse -application org.eclipse.equinox.p2.director -repository https://download.eclipse.org/releases/2023-12/ -installIU org.eclipse.search.core