我似乎无法在IntelliJ IDEA中设置SFTP连接以进行部署。每当我尝试连接到服务器时,我都会得ArrayIndexOutOfBoundsException
。在设置FTP服务器时,我没有得到这个例外,一切似乎都正常。
服务器可以访问,我仔细检查了我的登录详细信息......
有谁知道如何解决这个问题?
答案 0 :(得分:4)
感谢CrazyCoder指出idea.log文件。我只是在“事件日志”中四处看看,这很空: - )
当我添加日志文件时,我发现以下异常:
2013-05-25 16:36:37,608 [49048641] WARN - i.remotebrowser.ServerTreeNode - Could not connect to SFTP server at "sftp://server01.local/".
org.apache.commons.vfs2.FileSystemException: Could not connect to SFTP server at "sftp://server01.local/".
at org.apache.commons.vfs2.provider.sftp.SftpFileProvider.doCreateFileSystem(SftpFileProvider.java:108)
at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.getFileSystem(AbstractOriginatingFileProvider.java:102)
at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:80)
at org.apache.commons.vfs2.provider.AbstractOriginatingFileProvider.findFile(AbstractOriginatingFileProvider.java:64)
at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:698)
at org.apache.commons.vfs2.impl.DefaultFileSystemManager.resolveFile(DefaultFileSystemManager.java:624)
at com.jetbrains.plugins.webDeployment.connections.RemoteConnectionPool.createConnection(RemoteConnectionPool.java:121)
at com.jetbrains.plugins.webDeployment.connections.RemoteConnectionManager.openConnection(RemoteConnectionManager.java:122)
at com.jetbrains.plugins.webDeployment.ui.remotebrowser.ServerTreeContext.getConnection(ServerTreeContext.java:83)
at com.jetbrains.plugins.webDeployment.ui.remotebrowser.ServerTreeNode.computeFile(ServerTreeNode.java:266)
at com.jetbrains.plugins.webDeployment.ui.remotebrowser.ServerTreeNode.getChildren(ServerTreeNode.java:132)
at com.intellij.ui.treeStructure.SimpleTreeStructure.getChildElements(SimpleTreeStructure.java:25)
at com.intellij.ide.util.treeView.AbstractTreeUi$31.run(AbstractTreeUi.java:1618)
at com.intellij.ide.util.treeView.AbstractTreeUi.execute(AbstractTreeUi.java:1824)
at com.intellij.ide.util.treeView.AbstractTreeUi.getChildrenFor(AbstractTreeUi.java:1615)
at com.intellij.ide.util.treeView.AbstractTreeUi.access$4600(AbstractTreeUi.java:60)
at com.intellij.ide.util.treeView.AbstractTreeUi$46.run(AbstractTreeUi.java:2702)
at com.intellij.ide.util.treeView.AbstractTreeUi.execute(AbstractTreeUi.java:1824)
at com.intellij.ide.util.treeView.AbstractTreeUi.access$2400(AbstractTreeUi.java:60)
at com.intellij.ide.util.treeView.AbstractTreeUi$57$1.run(AbstractTreeUi.java:3379)
at com.jetbrains.plugins.webDeployment.ui.remotebrowser.WebServerTreeBuilder.runBackgroundLoading(WebServerTreeBuilder.java:90)
at com.intellij.ide.util.treeView.AbstractTreeUi$57.run(AbstractTreeUi.java:3370)
at com.intellij.ide.util.treeView.AbstractTreeUi.execute(AbstractTreeUi.java:1824)
at com.intellij.ide.util.treeView.AbstractTreeUi.access$2400(AbstractTreeUi.java:60)
at com.intellij.ide.util.treeView.AbstractTreeUi$58.run(AbstractTreeUi.java:3435)
at com.intellij.util.concurrency.WorkerThread.run(WorkerThread.java:108)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:454)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:152)
Caused by: org.apache.commons.vfs2.FileSystemException: Error during processing known-hosts file "/Users/Robert/.ssh/known_hosts".
at org.apache.commons.vfs2.provider.sftp.SftpClientFactory.createConnection(SftpClientFactory.java:126)
at org.apache.commons.vfs2.provider.sftp.SftpFileProvider.doCreateFileSystem(SftpFileProvider.java:97)
... 33 more
Caused by: com.jcraft.jsch.JSchException: java.lang.ArrayIndexOutOfBoundsException
at com.jcraft.jsch.KnownHosts.setKnownHosts(KnownHosts.java:171)
at com.jcraft.jsch.KnownHosts.setKnownHosts(KnownHosts.java:60)
at com.jcraft.jsch.JSch.setKnownHosts(JSch.java:269)
at org.apache.commons.vfs2.provider.sftp.SftpClientFactory.createConnection(SftpClientFactory.java:122)
... 34 more
Caused by: java.lang.ArrayIndexOutOfBoundsException
我的known_hosts
文件(Error during processing known-hosts file "/Users/Robert/.ssh/known_hosts"
)似乎有问题。我备份并删除它,现在一切似乎都运行良好。我只需查看哪一行是时髦的,因为ssh
和sftp
实用程序在终端内工作得很好,并且不会抱怨我的known_hosts
文件。< / p>
希望这对其他有同样错误的人来说很方便。