Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » (solved) Newbie getting bizarre ClassNotFoundException: JSchException
(solved) Newbie getting bizarre ClassNotFoundException: JSchException [message #778266] Thu, 12 January 2012 03:14 Go to next message
Alex Dreadd is currently offline Alex DreaddFriend
Messages: 8
Registered: January 2012
Junior Member
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 19:35]

Report message to a moderator

Re: Newbie getting bizarre ClassNotFoundException: JSchException [message #778317 is a reply to message #778266] Thu, 12 January 2012 11:06 Go to previous messageGo to next message
Matthew Webber is currently offline Matthew WebberFriend
Messages: 198
Registered: December 2010
Senior Member
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 20:59 Go to previous messageGo to next message
Alex Dreadd is currently offline Alex DreaddFriend
Messages: 8
Registered: January 2012
Junior Member
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 09:55 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 612
Registered: July 2009
Senior Member
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 19:35 Go to previous message
Alex Dreadd is currently offline Alex DreaddFriend
Messages: 8
Registered: January 2012
Junior Member
Thank you. Git clone succeeded. Problem solved.
Previous Topic:Problems with autocrlf
Next Topic:Should an empty bin/ directory be checked in?
Goto Forum:
  


Current Time: Mon Nov 24 01:42:32 GMT 2014

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

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