Jcabi Github ExceptionInInitializerError

125 Views Asked by At

I am currently working on a Bukkit plugin, and trying to implement to get config files from github. I am trying to use JCabi-Github for this. I got the library implemented and working, but whenever I use it, it creates an error. I tried to use this code:

Github git = new RtGitHub(user, pass); 
  1. Which doesn't give any compile-time errors

  2. And following the Javadoc should be just right

But when it runs, it creates a java.lang.ExceptionInInitializerError.

How do I fix this?

2

There are 2 best solutions below

7
VonC On

Check how you are using your program with JCabi-GitHub.
See issue 1270:

I'm afraid that "compile via eclipse" is what broke the structure of the JAR file.
Try to package with Maven.

0
amihaiemil On

The problem is not only "compile via eclipse". There's a bug in the library: it reads some attributes from its Manifest.MF, which may be problematic when you package your app in a .war, for instance.

There is an open ticket to change this mechanism; until then, the best solution is to:

1) use Maven to build and package your app

2) use maven-assembly-plugin to hardcode the needed values into your final artifact's Manifest.MF.

See here: https://github.com/jcabi/jcabi-github/issues/1198#issuecomment-225122003