Open kiwionly2 opened 2 years ago
Thanks for opening this issue. A contributor should be by to give feedback soon. In the meantime, please check out the contributing guidelines and explore other ways you can get involved.
Hi @kiwionly2 can you provide the steps you followed to produce this issue and I will try to reproduce this myself
@hessio, is a bit tricky to reproduce this error, this is very much depend on the java class loader ( depend which jar file it load first)
So far I use maven (version 3.6.2 ) not able to reproduce the error.
However, I write a Gradle (version 7.2) build script and try to build the jar, it show this error.
Let me know if you want the Gradle build script, I could send to you for try out.
@hessio
I created a branch so you could easier reproduce error.
Steps as below( assume run on your machine with any open JDK 1.8 installed )
cd auth/server
..\gradlew build
, gradlew ( gradlew wrapper) will automatic install on your machine and run the build command. You will able to see the error when compile fail.This issue/pull request has been marked as needs attention
as it has been left pending without new activity for 4 days. Tagging @nileshgovande @bkirunge7 @knrajnambiar76 @t7ko-seagate for appropriate assignment. Sorry for the delay & Thank you for contributing to CORTX. We will get back to you as soon as possible.
Thanks kiwionly2 for reporting this issue, @shalakadharap can you please review this and create a Jira story
Hi @shalakadharap were you able to create a Jira issue for this issue?
For the convenience of the Seagate development team, this issue has been mirrored in a private Seagate Jira Server: https://jts.seagate.com/browse/EOS-26087. Note that community members will not be able to access that Jira server but that is not a problem since all activity in that Jira mirror will be copied into this GitHub issue.
This issue/pull request has been marked as needs attention
as it has been left pending without new activity for 4 days. Tagging @nileshgovande @bkirunge7 @knrajnambiar76 @t7ko-seagate for appropriate assignment. Sorry for the delay & Thank you for contributing to CORTX. We will get back to you as soon as possible.
Hi,
While I try to compile the java server, I had found that current jar dependencies might create a jar hell. ( It might be an issue if we upgrade build tool in future and thing might no longer work, I am using Gradle to build and it actually produce an error)
This is cause by JUnit library loading hamcrest version is difference then the one inside Mockito ( you could see that is lot more class in hamcrest 1.3 which is transitive load by JUnit 4.13.1.
The issue could occurs if the build tool of java class loader is loading the class from Mockito's hamcrest before loading the one from hamcrest jar.
E.g. say a test class import CoreMatchers ( A lot of test classes in auth/server is import this )
And the build tool class loader is load the CoreMatchers class in Mockito, it will give compile error. ( because no containsString() method found)
Because the correct CoreMatchers class should be the one in hamcrest jar
Suggestion solution:
Upgrade Mockito library and we could also could upgrade hamcrest library to latest version
In pom.xml
Now the version of Mockiti, the jar file no longer contain org.hamcrest.*
Then in all the test classes, migrate code from
to
So align with new version of Mockito.