0

I'm using maven-3.8.1 along with java -1.8 to construct my spring microservice project. During install, I am getting these errors tracing to all methods of one the classes :

java.lang.NoSuchMethodError: org.mockito.MockitoAnnotations.openMocks(Ljava/Lang/object;)Ljava/Lang/Autocloseable; 

I'm also using mockito 2.15 along with powermock 2.0 so I know they're compatible with each other.

Any help would be appreciated.

Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74
Mansi Mishra
  • 1
  • 1
  • 1
  • try lower version of Mockito. On the powermock github page https://github.com/powermock/powermock/wiki/Mockito#supported-versions there is stated, that Mockito 2.8.9+ is compatible with PowerMock 2.x, but it also says, that "A lot of issues are not resolved still." – Michal Krasny Jun 11 '21 at 11:52
  • Why do you need powermock? – khmarbaise Jun 11 '21 at 11:54
  • what do you think? https://stackoverflow.com/questions/67432118/how-to-fix-this-error-java-lang-nosuchmethoderror-java-lang-autocloseable-org – Murilo Alves Mar 11 '22 at 15:58

0 Answers0