Search code examples
javajarbundlebundlerjruby

Bundle and Running a Jar causes java.lang.reflect.InvocationTargetException


I just pulled down a repo that other people have been working on for a while. When I try to run "bundle" on the repo I get the following error java.lang.reflect.InvocationTargetException. However, all the Gems still bundle.

I then run our rake task to create the jar (rake jar) and my jar comes out. Then when I run java -jar myjar.jar -h (our help command) I once again get java.lang.reflect.InvocationTargetException. I have seen others do the same thing, and it works fine.

I assume this is some sort of environment issue since I did not change the code at all and it works for other people. I have both compiled & run the jar in Java 1.6 and JRuby 1.7.3 (Which is what other people are using as well).

The Gems that are being used are: Bundler, Jruby-Jars, Jruby-rack, Nokogiri, Rake, Rubyzip, Trollop and Warbler.

If anyone has any idea on why this would be cause, I would highly appreciate it. If you need any more information I would be happy to provide it.


Solution

  • This isn't a great answer, but I was having a similar issue on jruby 1.7.3 and using 1.7.10 fixed it. I'd still like to know what the issue with 1.7.3 was though, since that's the version everyone else on my team is using.