Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » JGit : Problem with using the Bundlewriter
JGit : Problem with using the Bundlewriter [message #1796535] Mon, 15 October 2018 20:09 Go to next message
Christian Jeschke is currently offline Christian JeschkeFriend
Messages: 1
Registered: October 2018
Junior Member
I try to write a Java application to bundle a git repository and write the bundle afterwards to a file. Unfortenly I get an Exception. I dived a little into the ResourceBundle Class and the Exception seems to be because of a missing ClassLoader. I would appreciate any hint I can't get. I attach both: the Exception I get and the code inside my main function.

	at java.util.ResourceBundle.getBundle(
	at org.eclipse.jgit.nls.TranslationBundle.load(
	at org.eclipse.jgit.nls.GlobalBundleCache.lookupBundle(
	at org.eclipse.jgit.nls.NLS.get(
	at org.eclipse.jgit.nls.NLS.getBundleFor(
	at org.eclipse.jgit.internal.JGitText.get(
	at org.eclipse.jgit.transport.BundleWriter.writeBundle(
	at JGitTest.main(

public static void main(String[] args) throws IOException, GitAPIException {
        File f‌ile = new File( "readme.txt" );
    	Git git = Git.init().setDirectory( f‌ile.getParentFile() ).call();
        git.commit().setMessage("Initial commit").call();
        System.out.println("Committed file " + f‌ile + " to repository at " + git.getRepository().getDirectory());
        Ref HEAD = git.getRepository().getRef("refs/heads/master");
        if (HEAD == null)
        	System.out.println("HEAD not fund");
        BundleWriter bundlewriter = new BundleWriter(git.getRepository());
	File filebundle = new File( "file.bundle" );
	System.out.println(mkdirs( filebundle.getAbsoluteFile().getParentFile() )); 
	OutputStream fos=null;
	fos=new FileOutputStream(filebundle);
	ProgressMonitor monitor = new EmptyProgressMonitor(){};
	try {
	      bundlewriter.writeBundle(monitor, fos);
	} catch (Exception e){
Re: JGit : Problem with using the Bundlewriter [message #1797279 is a reply to message #1796535] Mon, 29 October 2018 13:45 Go to previous message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 1121
Registered: July 2009
Senior Member
Are JGitText.class and present on your application's classpath ?
Previous Topic:I want to add a submodule with a relative path
Next Topic:Is it possible to check user/password credentials valid on repository?
Goto Forum:

Current Time: Tue Feb 18 23:03:45 GMT 2020

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

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

Back to the top