0

I have updated java to JDK 19 and when I try opening Eclipse Marketspace i am getting below error,

MarketplaceDiscoveryStrategy failed with an error Cannot complete request to https://marketplace.eclipse.org/api/p?client=org.eclipse.epp.mpc.core&client.version=1.6.4.v20180214-1810&os=win32&ws=win32&nl=en_US&java.version=1.8.0_211&product=org.eclipse.epp.package.java.product&product.version=4.7.3.M20180330-0640&runtime.version=3.13.0.v20170207-1030&platform.version=4.7.3.v20180330-0640: Unable to read repository at https://marketplace.eclipse.org/api/p?client=org.eclipse.epp.mpc.core&client.version=1.6.4.v20180214-1810&os=win32&ws=win32&nl=en_US&java.version=1.8.0_211&product=org.eclipse.epp.package.java.product&product.version=4.7.3.M20180330-0640&runtime.version=3.13.0.v20170207-1030&platform.version=4.7.3.v20180330-0640.

I wanted to Install testNg so I tried adding the certificate as follows and made it trust, Still facing the same issue.

keytool -import -alias TestNg -keystore "C:\Program Files\Java\jdk-19\lib\security\cacerts" -file TestNg.cer

I get below error,

Unable to read repository at https://dl.bintray.com/testng-team/testng-eclipse-release/content.xml. Unable to read repository at https://dl.bintray.com/testng-team/testng-eclipse-release/content.xml. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Am I missing anything, I don't see a JRE for JDK is that I am missing?

Ajeesh
  • 25
  • 1
  • 5
  • 4
    `platform.version=4.7.3.v20180330-0640` means your Eclipse is more than four years and 18(!) releases behind. Use the current Eclipse 2022-09 with an embedded Java and install [Java 19 Support for Eclipse 2022-09 (4.25)](https://marketplace.eclipse.org/content/java-19-support-eclipse-2022-09-425). – howlger Oct 04 '22 at 14:21
  • Same error after latest Eclipse. Cannot complete request to https://marketplace.eclipse.org/api/p?client=org.eclipse.epp.mpc.core&os=win32&platform.version=4.25: – Ajeesh Oct 06 '22 at 07:08
  • Latest Eclipse would not give you an error message with `platform.version=4.7.3.v20180330-0640`. Using `keytool` is completly wrong here and does not make sense at all for a different Java version than the one with which you run Eclipse. The update site `https://dl.bintray.com/testng-team/testng-eclipse-release` seems to be broken. Where did you get this update site? – howlger Oct 07 '22 at 06:44
  • This is not only happening for that particular TestNg. Even when I open Eclipse Market place i am getting the same error. – Ajeesh Oct 21 '22 at 14:00
  • The error says its not the latest Eclipse. What version shows the _Help > About Eclipse IDE_ dialog? – howlger Oct 21 '22 at 19:35
  • 2022-09 (4.25.0). – Ajeesh Oct 23 '22 at 02:14

1 Answers1

2

After exploring few I found a solution for this,

The reason behind the error was:

Our cooperate firewall (ZScalar) prevent these additional steps, and install attempts will fail with the below messages:

Unable to read repository at https://dl.bintray.com/testng-team/testng-eclipse-release/content.xml. Unable to read repository at https://dl.bintray.com/testng-team/testng-eclipse-release/content.xml. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

Java did not recognize the root certificate authority (CA).

How to fix this?

There are two ways to fix this:

  1. Admin team has to reconfigure the firewall to allow Java access to the certificate sites.(They did not agreed with this, so proceeded with below way).

  2. To verify the root certificates, determine where the cacerts file is located.

Cacerts file is available in eclipse jre folder. For example

C:\Eclipse 2022 09\eclipse-java-2022-09-R-win32-x86_64\eclipse\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.4.v20220903-1038\jre\lib\security\cacerts

Now the certificate for the software’s needs to be added to this cacerts file. Eclipse marketplace itself was not opening for me. So on browser I pinged the below link,

https://marketplace.eclipse.org/

Click on the HTTPS certificate chain and navigate the certificate hierarchy. At the top there should be a Primary Root CA. This could be missing from my java cacerts file. Export the certificate and saved in my computer. Now imported to cacerts file.

Open cmd where the certificate is expoted. Execute below command.

keytool -import -alias MarketPlace -keystore "C:\Eclipse 2022 09\eclipse-java-2022-09-R-win32-x86_64\eclipse\plugins\org.eclipse.justj.openjdk.hotspot.jre.full.win32.x86_64_17.0.4.v20220903-1038\jre\lib\security\cacerts" -file ZscalerRootCAMP.der

Here ZscalerRootCAMP.der is the certificate exported for Eclipse market place.

Restart eclipse, open Eclipse marketplace and now I am able to install software's.

Ajeesh
  • 25
  • 1
  • 5