git-lfs-migrate icon indicating copy to clipboard operation
git-lfs-migrate copied to clipboard

NoClassDefFoundError while Migrating existing repository data to LFS [Using git-lfs-migrate]

Open samsonpaul87 opened this issue 7 years ago • 4 comments

Hi, I have completed following steps (https://github.com/git-lfs/git-lfs/wiki/Tutorial#migrating-existing-repository-data-to-lfs) to migrate existing repository data to LFS, mentioned here.

  • Install Java 1.8 or later
  • Download the latest binaries from here
  • Do a mirror clone of the repository to rewrite: git clone --mirror [email protected]:bozaro/git-lfs-migrate.git

I ended up with NoClassDefFoundError while trying to run the following step

  • Rewrite e.g. all *.mp4 video files in the repository:

Following is my full stack. Please note that, I have changed the .git file name and project name, due to security issues.

admin@admin-ThinkPad:~/MyProjects/MiProject_Repo_Mirror$ java -jar git-lfs-migrate.jar      -s miproject_android_studio.git      -d miproject_android_studio_lfs-migrate-converted.git      -g https://[email protected]/miproject/miproject_android_studio_lfs-migrate-converted.git      "*.sqlite"      "*.sqlite.zip"
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
	at java.lang.Class.getMethod0(Class.java:3018)
	at java.lang.Class.getMethod(Class.java:1784)
	at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: org.apache.http.client.HttpClient
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 7 more
admin@admin-ThinkPad:~/MyProjects/MiProject_Repo_Mirror$ 


samsonpaul87 avatar Jan 31 '17 13:01 samsonpaul87

@bozaro , @robinst , @leth , @brad . Could someone look into this issue and help me resolve it. Thanks.

samsonpaul87 avatar Feb 01 '17 10:02 samsonpaul87

Looks like you lost vendors directory from git-lfs-migrate.zip archive...

bozaro avatar Feb 01 '17 15:02 bozaro

@bozaro . Looks like vendors directory is inside git-lfs-migrate.zip file. I am not at all referring the zip file archive in the command. What should be the command to execute? Currently, I am executing the following command. Please go through it and let me know, the proper command to get it work. java -jar git-lfs-migrate.jar -s miproject_android_studio.git -d miproject_android_studio_lfs-migrate-converted.git -g https://[email protected]/miproject/miproject_android_studio_lfs-migrate-converted.git "*.sqlite" "*.sqlite.zip"

samsonpaul87 avatar Feb 01 '17 16:02 samsonpaul87

Command is correct, but vendors directory should presend near git-lfs-migrate.jar. So, you simply need unpack whole .zip-archive and run command without moving/deleting files.

bozaro avatar Feb 16 '17 19:02 bozaro