0

I'm using google identity toolkit to make a library. When I give this library to others, their app crashes at startup complaining that NoClassDefFoundError on GitkitClientException.

To me this is strange because:

  1. The GitkitClientException.class is in the final jar (in fact this happens to Spring Boot application we well)
  2. I checked every method, none of my public method throws a GitkitClientException. My understanding is, if the Exception is handled internally and not thrown. The library user should not need the dependency.

EDIT: I know when the library user add gitkitclient as their dependency as well they will not have this crash. But I really want this to be transparent.

The final fat jar looks like this: (this is a dropwizard app)

├── ch │
├── com │ ├── google │ │ ├── common │ │ ├── identitytoolkit │ │
│ └── fasterxml ├── META_INF ├── net │ └── models.go ├── org └── about.html └── jetty-dir.css

Archer
  • 507
  • 1
  • 8
  • 21
  • How is the GitKit library packaged into your distributed jar? – Jim Garrison Aug 27 '16 at 03:31
  • @JimGarrison my jar is a normal jar, only contains my classes. But I also distribute a pom file. So in the library user's maven, they use this jar and pom locally, and use maven shade plugin to generate a fat jar. I can see the GitkitClientException in the final fat jar. – Archer Aug 27 '16 at 03:33
  • WHERE in the jar? In a jar-within-the-final-jar, or in the normal package hierarchy? Clearly the classloader on the subject system cannot find the class, so it's not where it can be found. – Jim Garrison Aug 27 '16 at 03:35
  • @JimGarrison you make perfect sense. I have two application, in the spring boot jar, it is under /BOOT-INF/lib/. In the dropwizard fat jar, it is in normal package hierarchy. Both of them complain about the same class. – Archer Aug 27 '16 at 03:39
  • Without a lot more information (i.e. jar listing showing all the pertinent structure), pom.xml, and probably other stuff like Spring Boot config, I doubt anyone will be able to help. – Jim Garrison Aug 27 '16 at 03:41

0 Answers0