Skip to content

Include httpclient5 dependency in compile scope#736

Merged
dennisvang merged 2 commits intodevelopfrom
fix/issue645
Jul 15, 2025
Merged

Include httpclient5 dependency in compile scope#736
dennisvang merged 2 commits intodevelopfrom
fix/issue645

Conversation

@dennisvang
Copy link
Copy Markdown
Contributor

@dennisvang dennisvang commented Jul 2, 2025

For some reason the httpclient5 dependency in pom.xml was only included in the test scope.

For earlier versions of spring this was not a problem, but something must have changed in recent spring-boot to cause #645. Probably this is due to apache-httpclient-in-resttemplate, because our errors indeed occur as a result of RestTemplate calls.

Made the following changes to fix this:

  • removed explicit test scope from the httpclient5 dependency, to make sure it is included in the default (compile) scope
  • removed explicit version for httpclient5, because this is actually a spring-boot managed dependency

Now pings are executed properly (the status 403 below is expected because pings from localhost are denied by index):

2025-07-02 17:52:09,129 31362 [scheduling-1] DEBUG org.springframework.web.client.RestTemplate - Writing [{clientUrl=http://localhost:8080}] with org.springframework.http.converter.json.MappingJackson2HttpMessageConverter
2025-07-02 17:52:09,146 31379 [scheduling-1] DEBUG org.springframework.web.client.RestTemplate - Response 403 FORBIDDEN
2025-07-02 17:52:09,147 31380 [scheduling-1] WARN  org.fairdatapoint.service.ping.PingService - Failed to ping http://localhost:8082: 403  on POST request for "http://localhost:8082": "{"timestamp":1751471529144,"status":403,"error":"Forbidden","message":"Client URL is denied: http://localhost:8080"}"

fixes #645

related:

Copy link
Copy Markdown
Contributor

@MarekSuchanek MarekSuchanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, not sure why it was just for test scope (maybe from times before the client was used directly in FDP and really only for tests)

@dennisvang dennisvang merged commit c153fc8 into develop Jul 15, 2025
13 checks passed
@dennisvang dennisvang deleted the fix/issue645 branch July 15, 2025 07:12
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.

Ping fails with NoClassDefFoundError: org/eclipse/jetty/util/log/Log

2 participants