【问题标题】:Netbeans 7.3: Error connecting to Git repository with SSHNetbeans 7.3:使用 SSH 连接到 Git 存储库时出错
【发布时间】:2013-03-27 09:55:25
【问题描述】:

我正在尝试连接到远程服务器上的 git 存储库,以便可以在 Netbeans 7.3 中编辑源代码,但是当我尝试使用我的 ssh 私钥连接到存储库以克隆存储库时,我收到此错误:java.lang.ArrayIndexOutOfBoundsException: 779

日志:

INFO [org.netbeans.modules.git]: 
(address removed):
java.lang.ArrayIndexOutOfBoundsException: 779
java.lang.ArrayIndexOutOfBoundsException: 779
    at com.jcraft.jsch.Util.fromBase64(Util.java:50)
    at com.jcraft.jsch.KnownHosts.setKnownHosts(KnownHosts.java:157)
Caused: com.jcraft.jsch.JSchException
    at com.jcraft.jsch.KnownHosts.setKnownHosts(KnownHosts.java:171)
    at com.jcraft.jsch.JSch.setKnownHosts(JSch.java:184)
    at org.eclipse.jgit.transport.JschConfigSessionFactory.knownHosts(JschConfigSessionFactory.java:261)
    at org.eclipse.jgit.transport.JschConfigSessionFactory.createDefaultJSch(JschConfigSessionFactory.java:248)
    at org.netbeans.libs.git.jgit.JGitSshSessionFactory.getJSch(JGitSshSessionFactory.java:122)
    at org.netbeans.libs.git.jgit.JGitSshSessionFactory.getSession(JGitSshSessionFactory.java:105)
Caused: org.eclipse.jgit.errors.TransportException: (address removed): java.lang.ArrayIndexOutOfBoundsException: 779
    at org.netbeans.libs.git.jgit.JGitSshSessionFactory.getSession(JGitSshSessionFactory.java:111)
    at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:121)
    at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:248)
    at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:147)
    at org.netbeans.libs.git.jgit.commands.ListRemoteObjectsCommand.runTransportCommand(ListRemoteObjectsCommand.java:74)
Caused: org.netbeans.libs.git.GitException$AuthorizationException: (address removed): java.lang.ArrayIndexOutOfBoundsException: 779
    at org.netbeans.libs.git.jgit.commands.TransportCommand.handleException(TransportCommand.java:198)
    at org.netbeans.libs.git.jgit.commands.ListRemoteObjectsCommand.runTransportCommand(ListRemoteObjectsCommand.java:87)
    at org.netbeans.libs.git.jgit.commands.TransportCommand.run(TransportCommand.java:137)
    at org.netbeans.libs.git.jgit.commands.GitCommand.execute(GitCommand.java:73)
    at org.netbeans.libs.git.GitClient.listRemoteBranches(GitClient.java:655)
    at org.netbeans.modules.git.client.GitClient$31.call(GitClient.java:533)
    at org.netbeans.modules.git.client.GitClient$31.call(GitClient.java:529)
    at org.openide.util.NetworkSettings.suppressAuthenticationDialog(NetworkSettings.java:140)
    at org.netbeans.modules.git.client.GitClient$CommandInvoker$1$1.call(GitClient.java:790)
    at org.netbeans.modules.git.client.GitClient$CommandInvoker$1.call(GitClient.java:815)
    at org.netbeans.modules.git.client.GitClient$CommandInvoker.runMethodIntern(GitClient.java:823)
    at org.netbeans.modules.git.client.GitClient$CommandInvoker.runMethod(GitClient.java:756)
    at org.netbeans.modules.git.client.GitClient$CommandInvoker.runMethod(GitClient.java:734)
    at org.netbeans.modules.git.client.GitClient$CommandInvoker.access$400(GitClient.java:728)
    at org.netbeans.modules.git.client.GitClient.listRemoteBranches(GitClient.java:529)
[catch] at org.netbeans.modules.git.ui.clone.RepositoryStep$RepositoryStepProgressSupport.perform(RepositoryStep.java:197)
    at org.netbeans.modules.git.client.GitProgressSupport.performIntern(GitProgressSupport.java:102)
    at org.netbeans.modules.git.client.GitProgressSupport.run(GitProgressSupport.java:95)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2044)

任何想法如何解决这个问题?

【问题讨论】:

  • 你能复制调用堆栈吗? (如netbeans.org/bugzilla/show_bug.cgi?id=216024
  • @VonC 我不知道从哪里得到它。我使用了内置向导,打开了调用堆栈窗口,但什么也没有出现。消息后我也收到了一个号码,779
  • 您可以查找任何日志文件吗?搜索刚刚修改过的文件。
  • @VonC 找到了,我添加了发生异常的部分。
  • 干得好!会stackoverflow.com/a/2003460/6309 吗?基本上是自己把ssh服务器加到known_hosts文件中,看看错误是否依旧。

标签: git ssh netbeans-7 ssh-keys netbeans-7.3


【解决方案1】:

包括这种错误的所有线程都指向相同的解决方案。
参见例如“ArrayIndexOutOfBoundsException error when installing the IBM Intelligent Operations Center Platform Control Tool”。

Caused by: java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 810
at com.jcraft.jsch.Util.fromBase64(Util.java:48)
at com.jcraft.jsch.KnownHosts.setKnownHosts(KnownHosts.java:157)

原因

安装服务器上的 ssh 密钥库与环境不同步

解决问题

要纠正问题,请执行以下操作:

  1. 以 root 用户身份登录安装服务器。
  2. 删除/root/.ssh/known_hosts文件。
  3. 使用ssh 命令,使用每个服务器的完全限定主机名以root 用户身份访问四个目标服务器(应用程序、事件、数据和管理)。出现提示时接受 ssh 密钥。

与“com.jcraft.jsch.JSchException: UnknownHostKey”中的解决方案相同。

【讨论】:

  • 删除了 known_hosts 文件,它成功了!这是相当大的。谢谢。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-08-04
  • 1970-01-01
  • 2016-12-14
  • 2013-03-22
  • 2013-05-10
  • 1970-01-01
相关资源
最近更新 更多