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


Thank you for replying. 

I have added JavaEWAH to the class path as well. Also, I'm Java 6. I still get the same error. In fact, the first time I run the project after deployment, I get the following errror:

Caused by: java.lang.NoClassDefFoundError: com/jcraft/jsch/JSchException
at org.eclipse.jgit.transport.Transport.<clinit>( [org.eclipse.jgit-]
at [org.eclipse.jgit-]

If I do a project "Clean" in Eclipse, I get the "Could not initialize class org.eclipse.jgit.transport.Transport" error stated previously. 

On Fri, Nov 22, 2013 at 9:51 AM, Matthias Sohn <matthias.sohn@xxxxxxxxx> wrote:
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


Gaurav Sharma | Consultant
Direct: 319.294.6097 | E: gsharma@xxxxxxxxxxxxxxxxx


Back to the top