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

Fix JMeter-Plugin fails to download json-lib #671

Closed
wants to merge 1 commit into from

Conversation

Baraujo25
Copy link
Contributor

Issue explanation

When installing JMeter plugin v1.10 in a new fresh new JMeter(v5.6.1), JMeter Plugins requires the following dependencies to be downloaded:
image
When trying to comply with those requirements one faces:
image
Alongside with a stacktrace that presents as follow:

2024-09-18 16:48:31,909 ERROR o.j.r.PluginManager: Failed to download json-lib
org.apache.http.client.ClientProtocolException: null
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:839) ~[httpclient-4.5.14.jar:4.5.14]
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) ~[httpclient-4.5.14.jar:4.5.14]
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) ~[httpclient-4.5.14.jar:4.5.14]
	at org.jmeterplugins.repository.JARSourceHTTP.execute(JARSourceHTTP.java:499) ~[jmeter-plugins-manager-1.10.jar:?]
	at org.jmeterplugins.repository.JARSourceHTTP.getJAR(JARSourceHTTP.java:389) ~[jmeter-plugins-manager-1.10.jar:?]
	at org.jmeterplugins.repository.PluginManager.applyChanges(PluginManager.java:167) [jmeter-plugins-manager-1.10.jar:?]
	at org.jmeterplugins.repository.PluginManagerDialog$4.run(PluginManagerDialog.java:212) [jmeter-plugins-manager-1.10.jar:?]
Caused by: org.apache.http.client.CircularRedirectException: Circular redirect to 'https://search.maven.org/remotecontent?filepath=net/sf/json-lib/json-lib/2.4/json-lib-2.4-jdk15.jar'
	at org.apache.http.impl.client.DefaultRedirectStrategy.getLocationURI(DefaultRedirectStrategy.java:193) ~[httpclient-4.5.14.jar:4.5.14]
	at org.apache.http.impl.client.DefaultRedirectStrategy.getRedirect(DefaultRedirectStrategy.java:223) ~[httpclient-4.5.14.jar:4.5.14]
	at org.apache.http.impl.client.DefaultRequestDirector.handleResponse(DefaultRequestDirector.java:1078) ~[httpclient-4.5.14.jar:4.5.14]
	at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:509) ~[httpclient-4.5.14.jar:4.5.14]
	at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835) ~[httpclient-4.5.14.jar:4.5.14]
	... 6 more

Solution

Configure a new download url for json-lib library. New url points to the repository instead of using search.maven.org.

Old url which used search.maven.org isn't working anymore, it actually
redirects to nexus web page.
@Baraujo25
Copy link
Contributor Author

Well, now that I rethink, it's bound to happen with any library that used the search.maven.org as download url.
I have included json-lib in jmeter as a workaround for the meantime, and the download of cmdrunner failed:
image
Trace:

2024-09-18 17:02:17,071 ERROR o.j.r.JARSourceHTTP: Error downloading url:https://search.maven.org/remotecontent?filepath=kg/apc/cmdrunner/2.3/cmdrunner-2.3.jar got response code:403
2024-09-18 17:02:17,073 ERROR o.j.r.PluginManager: Failed to download cmdrunner
java.io.IOException: HTTP/1.1 403 Forbidden
	at org.jmeterplugins.repository.JARSourceHTTP.getJAR(JARSourceHTTP.java:393) ~[jmeter-plugins-manager-1.10.jar:?]
	at org.jmeterplugins.repository.PluginManager.applyChanges(PluginManager.java:167) [jmeter-plugins-manager-1.10.jar:?]
	at org.jmeterplugins.repository.PluginManagerDialog$4.run(PluginManagerDialog.java:212) [jmeter-plugins-manager-1.10.jar:?]

Which it's interesting.. since now it's a 40x response 🤔

@undera
Copy link
Owner

undera commented Sep 19, 2024

From my experience, this problem is temporary and caused by some issues in Maven central. Usually it goes away after short time.
The whole point of search.maven... URLs is to let it choose the mirror automatically. IMO we should stick to this practice as more generic and future-proof.

Does the problem persist for you after some time? Is it specific to this version of JMeter?

@Baraujo25
Copy link
Contributor Author

@undera you are more than right! Issue was temporary. Never happened to me before tbh. I was just trying to rise concern and help in case some big changes were happening in maven central.

I'm closing the issue. Apologies for the inconveniences!

@Baraujo25 Baraujo25 closed this Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants