2

I get the error below every time I try to run a project. I did set the Project SDK to java 8, tried open jdk as well as oracle jdk, but still I get the error below. I worked with this project before and had no problems, but it does not run on my new computer. On this machine I had java 11 installed before, but I deleted it. I am using a mac.

Does anyone know why I get this error?

Thank You in Advance.

enter image description here

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'getClientHttpRequestFactory' defined in class path resource [com/vocalink/bps/reporting/config/RestTemplateConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.http.client.ClientHttpRequestFactory]: Factory method 'getClientHttpRequestFactory' threw exception; nested exception is java.lang.UnsupportedOperationException: clientBuilder.sslSocketFactory(SSLSocketFactory) not supported on JDK 9+
Dinu Nicolae
  • 1,019
  • 2
  • 17
  • 42
  • Possibly this answer could help: https://stackoverflow.com/questions/50594350/alternative-to-sslsocketfactory-in-java10 – edward_wong Sep 09 '20 at 12:02

2 Answers2

1

The problem is in the jdk version. There are 2 solutions to this problem:

  1. update okhttp version;
  2. use an older jdk (used 1.8.0_202 and it worked).
Dinu Nicolae
  • 1,019
  • 2
  • 17
  • 42
1

It's the same answer as here https://stackoverflow.com/a/63792370/1542667

You are using a long deprecated method that can't be cleanly supported across a range of JVM versions.

Yuri Schimke
  • 12,435
  • 3
  • 35
  • 69