JGIT:致命:无法初始化类org.eclipse.jgit.transport.Transport

时间:2015-10-15 12:16:35

标签: java jenkins jgit

当我使用Jenkins构建我的项目时,我收到了错误:

Could not initialize class org.eclipse.jgit.transport.Transport
java.lang.NoClassDefFoundError: Could not initialize class org.eclipse.jgit.transport.Transport
    at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:120)
    at org.jenkinsci.plugins.gitclient.JGitAPIImpl$2.execute(JGitAPIImpl.java:631)
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:761)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1012)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1043)
    at hudson.scm.SCM.checkout(SCM.java:485)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1277)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:610)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:532)
    at hudson.model.Run.execute(Run.java:1741)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:408)

当我提供git存储库时,我也会收到错误:

Failed to connect to repository : Command "/usr/bin/git -c core.askpass=true ls-remote -h ssh://ha.nguyen@192.168.10.13/CVS/git/Brea HEAD" returned status code 128:
    stdout: 
    stderr: Permission denied, please try again. 
    Permission denied, please try again. 
    Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). 
    fatal: The remote end hung up unexpectedly

请帮助我,明天是我的截止日期。 :(

2 个答案:

答案 0 :(得分:1)

尝试重新启动您的 Jenkins,希望能有所帮助。

systemctl restart jenkins

服务 jenkins 重启

答案 1 :(得分:0)

第二条错误消息似乎表明凭据有问题。

您可以尝试以下操作:

  • SSH到Jenkins服务器并测试您是否可以手动克隆存储库
  • 如果可以,请使用Jenkins凭证进行测试
  • 在Jenkins构建的配置屏幕上,您是否看到错误消息? Jenkins将尝试在配置屏幕上连接到您的存储库,并告知您这是否无效。