Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

m2e catgalog wizard is not working when open catalog is clicked #179

Closed
jimmybirrias opened this issue Apr 26, 2021 · 9 comments
Closed
Labels
usability Improvements that can give a better usability or user experience

Comments

@jimmybirrias
Copy link

Hello M2E team I am looking for some help regarding with the m2e catalogs with the m2e connectors install wizard, I am getting the following error when I click Window > Preference > Maven > Discovery > Open catalog I got this message in the wizard:

image
Also in the $workspace/.metadata/.log I am seeing this stack trace:

org.eclipse.core.runtime.CoreException: IO failure: cannot load discovery directory
        at org.eclipse.equinox.internal.p2.discovery.compatibility.RemoteBundleDiscoveryStrategy.performDiscovery(RemoteBundleDiscoveryStrategy.java:94)
        at org.eclipse.equinox.internal.p2.discovery.Catalog.performDiscovery(Catalog.java:85)
        at org.eclipse.m2e.internal.discovery.wizards.MavenCatalogViewer$2.run(MavenCatalogViewer.java:164)
        at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)
Caused by: org.eclipse.equinox.internal.p2.discovery.compatibility.util.IOWithCauseException: Feature 'http://javax.xml.XMLConstants/feature/secure-processing' is not recognized.
        at org.eclipse.equinox.internal.p2.discovery.compatibility.DirectoryParser.parse(DirectoryParser.java:43)

I have checked the catalog URL (http://download.eclipse.org/technology/m2e/discovery/directory-1.8.xml) and it is reachable:
image

My question here is, is there a workaround for this issue?

@vrubezhny
Copy link
Contributor

vrubezhny commented Apr 28, 2021

@jimmybirrias Could you please specify what is the version you're running on and tell if you are behind any proxy? Any Antivivirus Software installed which may block jar downloading?
In case if it's possible, Could you please try to update to the latest version and try again?

Could you please also specify what JRE/SDK you're running on? Probably it worth to move to Java 11 in case you're on Java 8 and check if the problem still persist - m2e is not supported against Java 8; please use at least Java 11.

Thanks in advance

@jimmybirrias
Copy link
Author

jimmybirrias commented Apr 28, 2021

Thanks for the response @vrubezhny, I am not running eclipse behind of any proxy or vpn, I am running it using the following IBM SDK:
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 8.0.6.20 - pwa6480sr6fp20-20201120_02(SR6 FP20))
IBM J9 VM (build 2.9, JRE 1.8.0 Windows 10 amd64-64-Bit Compressed References 20201102_458768 (JIT enabled, AOT enabled)
OpenJ9 - 5b31a42
OMR - 6ad3a34
IBM - b7e48f4)
JCL - 20201119_01 based on Oracle jdk8u271-b09

@vrubezhny
Copy link
Contributor

@jimmybirrias Thanks for the details.

Unfortunately, as I said, m2e is not supported against Java 8. So please use at least Java 11.

HTH

@laeubi laeubi added the usability Improvements that can give a better usability or user experience label Dec 16, 2022
@eliasbalasis
Copy link

eliasbalasis commented Jun 15, 2024

This is still failing on Eclipse 2024-06 running on Java 21 and either Windows 10 or 11

org.eclipse.equinox.p2.core.ProvisionException: An error occurred while downloading https://github.com/eclipse-m2e/m2e-discovery-catalog/releases/download/2.x/catalog-2.x.xml. The cache file <workspace>\.metadata\.plugins\org.eclipse.equinox.p2.discovery.compatibility\cache\downloading\discovery554145892 could not be renamed to <workspace>\.metadata\.plugins\org.eclipse.equinox.p2.discovery.compatibility\cache\discovery554145892.
	at org.eclipse.equinox.internal.p2.discovery.compatibility.util.CacheManager.updateCache(CacheManager.java:228)
	at org.eclipse.equinox.internal.p2.discovery.compatibility.util.CacheManager.createCache(CacheManager.java:137)
	at org.eclipse.equinox.internal.p2.discovery.compatibility.util.TransportUtil.readResource(TransportUtil.java:99)
	at org.eclipse.equinox.internal.p2.discovery.compatibility.RemoteBundleDiscoveryStrategy.performDiscovery(RemoteBundleDiscoveryStrategy.java:84)
	at org.eclipse.equinox.internal.p2.discovery.Catalog.performDiscovery(Catalog.java:88)
	at org.eclipse.m2e.internal.discovery.wizards.MavenCatalogViewer.lambda$1(MavenCatalogViewer.java:158)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:124)

The problem is not present in Eclipse 2023-12 though.

This is shooting on the foot people wanting to upgrade.

@christopherj89
Copy link

This is still failing on Eclipse 2024-06 running on Java 21 and either Windows 10 or 11

org.eclipse.equinox.p2.core.ProvisionException: An error occurred while downloading https://github.com/eclipse-m2e/m2e-discovery-catalog/releases/download/2.x/catalog-2.x.xml. The cache file <workspace>\.metadata\.plugins\org.eclipse.equinox.p2.discovery.compatibility\cache\downloading\discovery554145892 could not be renamed to <workspace>\.metadata\.plugins\org.eclipse.equinox.p2.discovery.compatibility\cache\discovery554145892.
	at org.eclipse.equinox.internal.p2.discovery.compatibility.util.CacheManager.updateCache(CacheManager.java:228)
	at org.eclipse.equinox.internal.p2.discovery.compatibility.util.CacheManager.createCache(CacheManager.java:137)
	at org.eclipse.equinox.internal.p2.discovery.compatibility.util.TransportUtil.readResource(TransportUtil.java:99)
	at org.eclipse.equinox.internal.p2.discovery.compatibility.RemoteBundleDiscoveryStrategy.performDiscovery(RemoteBundleDiscoveryStrategy.java:84)
	at org.eclipse.equinox.internal.p2.discovery.Catalog.performDiscovery(Catalog.java:88)
	at org.eclipse.m2e.internal.discovery.wizards.MavenCatalogViewer.lambda$1(MavenCatalogViewer.java:158)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:124)

The problem is not present in Eclipse 2023-12 though.

This is shooting on the foot people wanting to upgrade.

facing the same issue with eclipse 2024-06

@TB-HunBoka
Copy link

I was facing the same issue. Problem is it could not move the file from the downloading folder to the cache folder. (No idea why)
If you see the "could not be renamed to" text in the error message then there is a workaround:
copy the files from the downloading folder to cache. You have to do that twice.
Here are the stepts:

  1. click Window > Preference > Maven > Discovery > Open catalog
  2. copy the file discovery554145892 from .metadata.plugins\org.eclipse.equinox.p2.discovery.compatibility\cache\downloading\ to .metadata.plugins\org.eclipse.equinox.p2.discovery.compatibility\cache\
  3. click Window > Preference > Maven > Discovery > Open catalog
  4. copy the file discovery-1503674835 from .metadata.plugins\org.eclipse.equinox.p2.discovery.compatibility\cache\downloading\ to .metadata.plugins\org.eclipse.equinox.p2.discovery.compatibility\cache\
  5. click Window > Preference > Maven > Discovery > Open catalog should work

@gloowa
Copy link

gloowa commented Aug 2, 2024

I can confirm the problem with "cannot be renamed" still exists and above workaround works.

The problem is in

org.eclipse.equinox.internal.p2.discovery.compatibility.util.CacheManager.updateCache

	if (cacheFile.exists())
		safeDelete(cacheFile);
		if (temp(tempFilFile.renameTo(cacheFile)) {
			(...)

File.renameTo() does not support changing file path, and it says so in the method javadoc.
Files.move() should be used instead.

I've opened eclipse-equinox/p2#536 for this

@merks
Copy link
Contributor

merks commented Aug 3, 2024

This problem is caused by the issue reported against p2 which is now fixed:

eclipse-equinox/p2#536

@HannesWell
Copy link
Contributor

Thank you @gloowa for the investigation and thank you Ed for the fix.
Both is very welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usability Improvements that can give a better usability or user experience
Projects
None yet
Development

No branches or pull requests

9 participants