0

I have to use Finagle 6.35.0 for Scala 2.11 as a dependency.

I made my project dependent on

  1. finagle-core_2.11-6.35.0.jar
  2. finagle-stats_2.11-6.35.0.jar.

Error what I got:
java.lang.ClassNotFoundException: com.twitter.finagle.stats.ExceptionStatsHandler.

I expected this class to be in one of these jars. However none of these jars contains ExceptionStatsHandler which is a little bit surprising for me. I have searched for it in some other finagle .jars like for example finagle-commons-stats_2.11-6.35.0.jar but without success.

Could you tell me in which finagle dependency (.jar) I could find com.twitter.finagle.stats.ExceptionStatsHandler? Maybe it should be in one of previously mentioned ones but I use improper library version?

I am talking about .jars instead of maven or gradle dependencies because my project is a J-boss module and I have to manually add .jars as dependencies.

Vikrant Kashyap
  • 6,398
  • 3
  • 32
  • 52
luke
  • 3,435
  • 33
  • 41
  • You should be able to retrieve the jar with this maven dependency : https://mvnrepository.com/artifact/com.twitter/util-stats – Arnaud Dec 04 '18 at 09:48
  • 3
    To find the jar, go to [Central](https://search.maven.org/) and search for `fc:com.twitter.finagle.stats.ExceptionStatsHandler` (full classname). – chrylis -cautiouslyoptimistic- Dec 04 '18 at 09:48
  • @Arnaud Thanks. It is there. Write your comment as an answer and I'll accept it. – luke Dec 04 '18 at 09:57
  • @chrylis Your advice works as well. I will use it in the future in similar cases. Btw. I usually use `mvnrepository.com` instead of `search.maven.org`, maybe there is also similar way to search for dependency containing specified class? – luke Dec 04 '18 at 10:00
  • 1
    `search.maven.org` actually searches the Maven central repository, which is where maven looks for dependencies by default. – Steve C Dec 04 '18 at 13:22
  • @luke It's entirely likely that it's there, but I'm not familiar with the query syntax. – chrylis -cautiouslyoptimistic- Dec 04 '18 at 18:00
  • @chrylis I made a small research. Probably there is no such option on mvnrepository.com. I tried to find some documentation about searching on this website. Without success. I also found this question and answer [How to search public Maven/Ivy repositories for a particular class?](https://stackoverflow.com/a/12550846/1673775). So seemingly [jar-download.com](https://jar-download.com/maven-repository-class-search.php) and [search.maven.org](https://search.maven.org) are better in this particular case. – luke Dec 05 '18 at 07:16

1 Answers1

3

Searching for your class name we can find :

Source code: Class ExceptionStatsHandler.scala part of util-stats_2.12 version 18.1.0

With this information, we can find the according maven dependency : Utilities Stats

@chrylis also suggests a good way to search for a particular class in the Maven repository :

To find the jar, go to Central and search for fc:com.twitter.finagle.stats.ExceptionStatsHandler (full classname).

Arnaud
  • 17,229
  • 3
  • 31
  • 44