Duncan Jones
Duncan Jones

Reputation: 69349

Eclipse times out when trying to show Javadoc for classes in rt.jar

Just recently, my Eclipse installation has stopped reliably displaying Javadoc information for any of the classes in rt.jar. Neither the hover-over documentation, nor the content assist are able to display Javadoc for any non-local types. The issue is sporadic, with the Javadocs sometimes working perfectly for several hours at a time.

Looking in the workspace log, I see messages such as the following:

!ENTRY org.eclipse.jdt.ui 4 10001 2012-08-13 10:03:58.050
!MESSAGE Internal Error
!STACK 1
Java Model Exception: Java Model Status [Timed out while retrieving the attached javadoc for String {key=Ljava/lang/String;} [in String.class [in java.lang [in C:\Program Files\Java\jre6\lib\rt.jar]]] ]
  at org.eclipse.jdt.internal.core.JavaElement.getURLContents(JavaElement.java:808)
  at org.eclipse.jdt.internal.core.BinaryType.getJavadocContents(BinaryType.java:1037)
  at org.eclipse.jdt.internal.core.BinaryType.getAttachedJavadoc(BinaryType.java:995)
  at org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2.getHTMLContent(JavadocContentAccess2.java:463)
  at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:619)
  at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.internalGetHoverInfo(JavadocHover.java:565)
  at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo2(JavadocHover.java:557)
  at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:163)
  at org.eclipse.jdt.internal.ui.text.java.hover.BestMatchHover.getHoverInfo2(BestMatchHover.java:129)
  at org.eclipse.jdt.internal.ui.text.java.hover.JavaEditorTextHoverProxy.getHoverInfo2(JavaEditorTextHoverProxy.java:85)
  at org.eclipse.jface.text.TextViewerHoverManager$4.run(TextViewerHoverManager.java:166)
!SUBENTRY 1 org.eclipse.jdt.core 4 1012 2012-08-13 10:03:58.050
!MESSAGE Timed out while retrieving the attached javadoc for String {key=Ljava/lang/String;} [in String.class [in java.lang [in C:\Program Files\Java\jre6\lib\rt.jar]]]

I initially wondered if McAfee on-access scan was getting in the way - it has a terrible habit of grinding to a halt when encountering JARs - but I was reassured to see my settings were still in place to ignore all JAR files (plus, as an added bonus, the contents of C:\Program...\Java).

Has anyone encountered this problem before? Is there a way to increase the timeout value being applied here?

Things I have tried:

None has worked.

Upvotes: 2

Views: 2575

Answers (2)

user1769617
user1769617

Reputation: 47

I had the same problem with Eclipse 3.7.1 and solved it by going to

Window -> Preferences -> Java -> Installed JREs -> Execution Environment -> JavaSE-1.7

and then I selected the jdk option instead of jre7

Upvotes: 3

Duncan Jones
Duncan Jones

Reputation: 69349

The issue was triggered because my Eclipse installation was configured to use my local JRE, rather than my JDK. As the JRE does not contain the Java sources (nor attached Javadocs), Eclipse was forced to retrieve this information from the web. Presumably some network lag was causing problems on occasions.

I resolved this by adding a reference to my local JDK in Preferences > Java > Installed JREs and removing the reference to the old JRE.

Upvotes: 4

Related Questions