Eclipse Pydev自动完成无法处理错误:java.lang.RuntimeException:python客户端仍然没有连接回eclipse java vm

时间:2014-05-21 16:59:49

标签: eclipse pydev

我与pydev的日食在过去1 - 2年间一直没有任何问题。我不知道是什么导致它,但可能是因为我做了java升级(但是,这是第一次发生)。

问题:我的eclipse pydev autocomplete挂起并且无法正常工作。

enter image description here

日志:

java.lang.RuntimeException: The python client still hasn't connected back to the eclipse java vm (will retry...)
    at org.python.pydev.core.log.Log.log(Log.java:54)
    at org.python.pydev.editor.codecompletion.shell.AbstractShell.startIt(AbstractShell.java:334)
    at org.python.pydev.editor.codecompletion.shell.ShellsContainer.getServerShell(ShellsContainer.java:232)
    at org.python.pydev.editor.codecompletion.shell.ShellsContainer.getServerShell(ShellsContainer.java:165)
    at org.python.pydev.editor.codecompletion.shell.AbstractShell.getServerShell(AbstractShell.java:222)
    at org.python.pydev.editor.codecompletion.revisited.modules.CompiledModule.createInnerFromServer(CompiledModule.java:330)
    at org.python.pydev.editor.codecompletion.revisited.modules.CompiledModule.getGlobalTokens(CompiledModule.java:531)
    at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.internalGenerateGetCompletionsForModule(AbstractASTManager.java:715)
    at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:541)
    at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:510)
    at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:502)
    at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:493)
    at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.internalGenerateGetCompletionsForModule(AbstractASTManager.java:723)
    at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:541)
    at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:510)
    at org.python.pydev.editor.codecompletion.revisited.AbstractASTManager.getCompletionsForModule(AbstractASTManager.java:502)
    at org.python.pydev.editor.codecompletion.revisited.modules.SourceModule.findGlobalTokDef(SourceModule.java:974)
    at org.python.pydev.editor.codecompletion.revisited.modules.SourceModule.findDefinitionsFromModAndTok(SourceModule.java:923)
    at org.python.pydev.editor.codecompletion.revisited.modules.SourceModule.findDefinition(SourceModule.java:905)
    at org.python.pydev.editor.codecompletion.revisited.modules.SourceModule.findDefinition(SourceModule.java:664)
    at org.python.pydev.editor.codecompletion.revisited.modules.SourceModule.findDefinition(SourceModule.java:1)
    at org.python.pydev.editor.refactoring.PyRefactoringFindDefinition.findActualDefinition(PyRefactoringFindDefinition.java:177)
    at org.python.pydev.editor.refactoring.PyRefactoringFindDefinition.findActualDefinition(PyRefactoringFindDefinition.java:79)
    at com.python.pydev.refactoring.refactorer.RefactorerFindDefinition.findDefinition(RefactorerFindDefinition.java:61)
    at com.python.pydev.refactoring.refactorer.Refactorer.findDefinition(Refactorer.java:114)
    at com.python.pydev.refactoring.wizards.rename.PyRenameEntryPoint.checkInitialConditions(PyRenameEntryPoint.java:232)
    at com.python.pydev.refactoring.markoccurrences.MarkOccurrencesJob.createRequest(MarkOccurrencesJob.java:102)
    at org.python.pydev.shared_ui.mark_occurrences.BaseMarkOccurrencesJob.run(BaseMarkOccurrencesJob.java:168)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

设定:

eclipse.buildId=4.3.2.M20140221-1700
java.version=1.7.0_10
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.standard.product
Command-line arguments:  -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.standard.product
Eclipse Standard Kepler Service Release 2
pydev 3.5.0.201xxx
Windows 7

eclipse.ini文件:

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140116-2212
-product
org.eclipse.epp.package.standard.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m
-Djava.net.preferIPv4Stack=true

我的Java设置:

> java -version
java version "1.7.0_55"
Java(TM) SE Runtime Environment (build 1.7.0_55-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.55-b03, mixed mode)

Java is installed at: C:\Program Files\Java (has jdk1.7.0_55 and jre7 folders)

我尝试了以下方法:

  1. 重新安装java
  2. 删除并读取了Workspace / pydev / Python Interpreter
  3. 已禁用防火墙
  4. 我相信它是因为,java没有启动(我找不到任何名为java的进程来自taskmgr)

    请帮忙

2 个答案:

答案 0 :(得分:1)

因此,在花了很多时间调试这个问题后,我能够解决自己的问题。

我采取了以下步骤来解决我的问题:

  1. 在eclipse.ini中添加了以下右前的-vmargs 行(这允许java.exe一直启动)

    -vm

    C:\ Program Files \ Java \ jdk1.7.0_55 \ bin \ java.exe

  2. 在主机文件C:\ windows \ system32 \ drivers \ etc \ hosts文件末尾添加以下行(允许\ eclipse \ plugins \ org.python.pydev_3.5.0.201405201709 \ pysrc \ pycompletionserver.py连接到java eclipse vm。注意:或者,您可以编辑\ eclipse \ plugins \ org.python.pydev_3.5.0.201405201709 \ pysrc \ pydev_localhost.py文件并替换' localhost' with ' 127.0.0.1&#39)

    127.0.0.1 localhost

  3. 注意:我在整个会话期间都禁用了防火墙。

答案 1 :(得分:0)

在我的情况下,我不小心将一个错误编辑到一个核心python模块(os)中,这打破了许多其他模块的导入,这导致了同样的问题。只需卸载并重新安装python就可以解决问题。