Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Error pushing to remote

On Fri, Nov 22, 2013 at 4:37 PM, Gaurav Sharma <gsharma@xxxxxxxxxxxxxxxxx> wrote:
I'm using the jgit.jar in a custom web application. I'm using the following code to push local repo changes to master:

String remote = "origin";
String branch = "refs/heads/master";
String trackingBranch = "refs/remotes/" + remote + "/master";
RefSpec spec = new RefSpec(branch + ":" + branch);
Iterable<PushResult> resultIterable = git.push().setRemote(remote)
PushResult result = resultIterable.iterator().next();
TrackingRefUpdate trackingRefUpdate = result

When I use this code in a standalone java class (i.e. with  public static void main method), it works just fine. But when I incorporate this into my project, it fails with the following error:

Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jgit.transport.Transport
at [org.eclipse.jgit-]

I have jsch.jar in the class path as well. Not sure why this is failing.

org.eclipse.jgit 3.1.0 has the following dependencies



I'd recommend to use jsch 0.1.50 instead AFAIR there are some
problems using older versions on Java 7


Back to the top