Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » (solved) Newbie getting bizarre ClassNotFoundException: JSchException
(solved) Newbie getting bizarre ClassNotFoundException: JSchException [message #778266] Wed, 11 January 2012 22:14 Go to next message
Eclipse UserFriend
I was trying out JGit and set up a very simple program (I am using Eclipse to create the program - but it's a standalone application, so I don't want an eclipse dependency or anything):

	public static void main(String[] args) throws Exception
		{
		File WORKDIR = new File("/home/ismavatar/bot-enigma/git-stable");
		String REPO = "htt" + "ps://github.com/enigma-dev/enigma-dev.git"; //split up so the forums don't yell at me for posting links
		Git.cloneRepository().setURI(REPO).setDirectory(WORKDIR).call();
		}


and made sure JGit was in my build path (which it is, since the Git class is resolving).

Running the program generated the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: com/jcraft/jsch/JSchException
	at org.eclipse.jgit.transport.Transport.<clinit>(Transport.java:111)
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:119)
	at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:173)
	at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:119)
	at org.ircbot.Tester.main(Tester.java:18)
Caused by: java.lang.ClassNotFoundException: com.jcraft.jsch.JSchException
	at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
	... 5 more


Where Tester.java:18 is the Git.cloneRepository line, of course.

After the call, the directory is created with nothing but a populated .git folder, so it looks like it failed after setting up the meta data.

On second run of the exact same code above, I get the somewhat expected:

org.eclipse.jgit.api.errors.JGitInternalException: Destination path "git-stable" already exists and is not an empty directory


and no ClassLoader error.

Any and all help is greatly appreciated.

[Updated on: Fri, 13 January 2012 14:35] by Moderator

Re: Newbie getting bizarre ClassNotFoundException: JSchException [message #778317 is a reply to message #778266] Thu, 12 January 2012 06:06 Go to previous messageGo to next message
Eclipse UserFriend
If the result is a directory with a .git folder but no working copy, the cause is typically that authentication to the respository failed. Also check that your proxy is defined correctly.

What happens when you "git clone https://github.com/enigma-dev/enigma-dev.git" from the command line?

Matthew
Re: Newbie getting bizarre ClassNotFoundException: JSchException [message #778495 is a reply to message #778317] Thu, 12 January 2012 15:59 Go to previous messageGo to next message
Eclipse UserFriend
Thank you for the reply, here are the results of running your command on the command line:

$ git clone htt\
> ps://github.com/enigma-dev/enigma-dev.git #split for forums
Cloning into enigma-dev...
remote: Counting objects: 11638, done.
remote: Compressing objects: 100% (2711/2711), done.
remote: Total 11638 (delta 8313), reused 11592 (delta 8267)
Receiving objects: 100% (11638/11638), 13.60 MiB | 2.59 MiB/s, done.
Resolving deltas: 100% (8313/8313), done.
$ ls -aF enigma-dev/
./               ENIGMAsystem/         .git/       packages/
../              events_compat.res     .gitignore  pluginsource/
Compilers/       events_localless.res  MacOS/      settings.ey
CompilerSource/  events.res            Makefile    Windows/
$ 

It did not ask me for authentication. The duration of the operation was no more than 5 seconds.
Re: Newbie getting bizarre ClassNotFoundException: JSchException [message #778562 is a reply to message #778266] Fri, 13 January 2012 04:55 Go to previous messageGo to next message
Eclipse UserFriend
JGit needs jsch library for ssh protocol handling. Should be available on Maven central.
Re: Newbie getting bizarre ClassNotFoundException: JSchException [message #778760 is a reply to message #778562] Fri, 13 January 2012 14:35 Go to previous messageGo to next message
Eclipse UserFriend
Thank you. Git clone succeeded. Problem solved.
Re: Newbie getting bizarre ClassNotFoundException: JSchException [message #1737853 is a reply to message #778760] Wed, 13 July 2016 10:12 Go to previous message
Eclipse UserFriend
Hello Alex Dreadd.
I am getting the same error.
Can you tell us how you solve it ?
Previous Topic:Could not initialize class org.eclipse.jgit.util.FS
Next Topic:Listing tags in egit gets out of memory error
Goto Forum:
  


Current Time: Wed Jul 23 02:22:27 EDT 2025

Powered by FUDForum. Page generated in 0.03737 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top