Bug 450684 - Javadoc URL that redirects from http to https yields: Unknown javadoc format for <type from Oracle JRE rt.jar>
Summary: Javadoc URL that redirects from http to https yields: Unknown javadoc format ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.4.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.4.2   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 450678 451057 451650 452273 (view as bug list)
Depends on: 451289
Blocks:
  Show dependency tree
 
Reported: 2014-11-08 22:25 EST by EPP Error Reports CLA
Modified: 2015-01-28 00:18 EST (History)
10 users (show)

See Also:


Attachments
Rudimentary fix (1.52 KB, patch)
2014-11-10 10:40 EST, Jay Arthanareeswaran CLA
no flags Details | Diff
Fix v2 (4.64 KB, patch)
2014-11-12 09:18 EST, Markus Keller CLA
no flags Details | Diff
Fix v3 (4.74 KB, patch)
2014-11-12 09:52 EST, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description EPP Error Reports CLA 2014-11-08 22:25:28 EST
Hello committers,

we received a new error report for Eclipse 4.4.1.M20140925-0400.


General Information:
    anonymous-id:         f5797253-73aa-41ed-8998-5690655dd0a5
    eclipse-build-id:     4.4.1.M20140925-0400
    eclipse-product:      org.eclipse.epp.package.jee.product
    operating system:     Windows8 6.2.0 (x86_64) - win32
    java-runtime-version: 1.8.0_25-b18

The following plug-ins were present on the execution stack (*):
    1. org.eclipse.jdt.core_3.10.0.v20140902-0626
    2. org.eclipse.jdt_3.10.0.v20140925-0400
    3. org.eclipse.jdt.ui_3.10.1.v20140817-1500
    4. org.eclipse.jface.text_3.9.1.v20140827-1810
    5. org.eclipse.jface_3.10.1.v20140813-1009


Error Status:

    code:                   10.001
    plugin:                 org.eclipse.jdt.ui_3.10.1.v20140817-1500
    message:                Internal Error
    fingerprint:            7a304c08
    exception class:        org.eclipse.jdt.core.JavaModelException
    exception message:      Unknown javadoc format for Integer {key=Ljava/lang/Integer;} [in Integer.class [in java.lang [in C:\Program Files\Java\jre1.8.0_25\lib\rt.jar]]]
    number of children:     1
    
    org.eclipse.jdt.core.JavaModelException: Unknown javadoc format for Integer {key=Ljava/lang/Integer;} [in Integer.class [in java.lang [in C:\Program Files\Java\jre1.8.0_25\lib\rt.jar]]]
    at org.eclipse.jdt.internal.core.JavadocContents.getTypeDoc(JavadocContents.java:81)
    at org.eclipse.jdt.internal.core.BinaryType.getAttachedJavadoc(BinaryType.java:999)
    at org.eclipse.jdt.internal.ui.text.javadoc.JavadocContentAccess2.getHTMLContent(JavadocContentAccess2.java:500)
    at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo(JavadocHover.java:689)
    at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.internalGetHoverInfo(JavadocHover.java:607)
    at org.eclipse.jdt.internal.ui.text.java.hover.JavadocHover.getHoverInfo2(JavadocHover.java:599)
    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)
   

---   

      code:                   1.009
      plugin:                 org.eclipse.jdt.core_3.10.0.v20140902-0626
      message:                Unknown javadoc format for Integer {key=Ljava/lang/Integer;} [in Integer.class [in java.lang [in C:\Program Files\Java\jre1.8.0_25\lib\rt.jar]]]
      fingerprint:            00000000
      number of children:     0
    
    
   

    

Messages, stacktraces, and nested status objects may be shortened. Please visit 
http://dev.eclipse.org/recommenders/committers/confess/0.5/reports/-
for the complete error log.


Some general information and guidelines about how to use this bug report:

1. Feel free to move this bug to your own product and components. Please note
   that this bug is only accessible to Eclipse committers. If you move this bug
   please make sure that it's still in the "Security Advisor" group.

2. The bug contents of the fields status, resolution, keywords, and whitelist
   are presented to reporters. If you needs more information, please set the
   keyword "needinfo". This will trigger a specialized dialog asking the user
   to provide further details.

3. Use the following resolutions for the following situations:
   * CLOSED / FIXED: This bug has been fixed. Please provide additional
     information in the whiteboard field.
   * CLOSED / WORKSFORME: Use this resolution if you can't reproduce this issue
     and request further information. Please use the whiteboard text to specify
     more details what a user should provide and how.
   * CLOSED / INVALID: Use this resolution if the reported problem is a
     'user-configuration' problem. Please consider giving hints how to fix
     these issues in the whiteboard field.
   * CLOSED / NOT ECLIPSE: Use this if the problem is caused by another plugin
     not developed at Eclipse.org
   * CLOSED / MOVED: If this bug has been moved else where. Please provide more 
     information (e.g. a link) in the whiteboard field.

4. Please remember that only committers can view and comment on this bug. You
   may, however, manually add the reporting user to the bug's cc list. But keep
   in mind that the report may contains sensitive information.

5. If you are missing a feature, please file a enhancement request here:
   https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Recommenders.Incubator&component=Stacktraces
    
 

Thank you for your assistance.
Your friendly error-reports-inbox.


--
* Note: The list of present bundles and their respective versions was
  calculated by package naming heuristics. This may or may not reflect reality.
Comment 1 EPP Error Reports CLA 2014-11-08 22:25:29 EST
I've looked up the (to date) top-3 most similar bug groups and listed the 
closest bug of each group below. This report may or may not be duplicate of
those (low or similar scores for all entries may indicate that this hasn't
been reported yet):

>     1. Bug 450674: [jdt] Internal Error – 0,9    
>     2. Bug 446270: Internal Error (err_grp: ebf92dd6) – 0,7    
>     3. Bug 445045: Internal Error (err_grp: 7f164178) – 0,7    


If this report actually is a duplicate of those, please mark it as such. This
information helps me to improve the recommendations further for the next issue.

Thank you for your assistance.
Your friendly error-reports-inbox.
Comment 2 Marcel Bruch CLA 2014-11-09 02:03:46 EST
Moving to JDT core for review.  FWIW, I never saw this error before and thus  assume it's a misconfigured client. However, requested more details to be sure. Let's see whether reporters can provide more details.
Comment 3 Daniel Haftstein CLA 2014-11-09 06:05:04 EST
A (maybe) similar error occured while hovering the String "sun.nio.ch.WindowsSelectorImpl" which brought up the tooltip:
"Note: An exception occurred while getting the Javadoc. See log for details."
Comment 4 Marcel Bruch CLA 2014-11-09 06:25:32 EST
(In reply to Daniel Haftstein from comment #3)
> A (maybe) similar error occured while hovering the String
> "sun.nio.ch.WindowsSelectorImpl" which brought up the tooltip:
> "Note: An exception occurred while getting the Javadoc. See log for details."

Daniel, did you get notified by the error popup?
If so, can you provide more details about your OS, java version and vendor?
Comment 5 Marcel Bruch CLA 2014-11-09 07:39:38 EST
*** Bug 450678 has been marked as a duplicate of this bug. ***
Comment 6 Marcel Bruch CLA 2014-11-09 07:41:19 EST
Moving to JDT for review. We received that report in a short timeframe (a day) from 5 different users. Maybe it's worth investigating?
Comment 7 Daniel Haftstein CLA 2014-11-09 15:13:41 EST
(In reply to Marcel Bruch from comment #4)
> Daniel, did you get notified by the error popup?
> If so, can you provide more details about your OS, java version and vendor?

Running Eclipse Oomph, Code Recommenders Configuration
Project is set to use a 1.6 JRE (only the 1.8 jdk is available).

eclipseBuildId:     4.4.1.M20140925-0400
eclipseProduct:     org.eclipse.epp.package.java.product
javaRuntimeVersion: 1.8.0_25-b18
osgiWs:             win32
osgiOs:             Windows7
osgiOsVersion:      6.1.0
osgiArch:           x86_64

The error can be reproduced by hovering the String in the following class:

public class Test {
    private String test = "sun.nio.ch.WindowsSelectorImpl";
}
Comment 8 EPP Error Reports CLA 2014-11-09 17:36:50 EST
To date this log entry was reported 10 times.

Your friendly error reports bot.
Comment 9 Noopur Gupta CLA 2014-11-10 02:02:49 EST
I can reproduce this with 4.5 M3 while trying to hover and access the javadoc of any class in jdk8.
Comment 10 Jay Arthanareeswaran CLA 2014-11-10 03:17:51 EST
At quick glance, looks like the content-length header field has '0' set.
Comment 11 Jay Arthanareeswaran CLA 2014-11-10 03:37:23 EST
Some more update: Looks like a redirection is happening (301) to the https server and as a result the JDT is seeing the content-length as '0' as stated above.

Till we come up with a fix, the work around is to use the 'https' version of URL for Javadoc, such as this:

https://docs.oracle.com/javase/8/docs/api/
Comment 12 Jay Arthanareeswaran CLA 2014-11-10 03:51:34 EST
Apparently this is a bug (or) an expected behavior (depending on how it is looked) in HttpURLConnection. According to this Oracle bug:

http://bugs.java.com/bugdatabase/view_bug.do?bug_id=4620571

HttpURLConnection won't follow the redirection if there's a change in protocol - like here, from http to https.

Looks like we can't do much, other than (may be) giving some more informative error.
Comment 13 Jay Arthanareeswaran CLA 2014-11-10 04:13:17 EST
Tentatively targeting Mars.
Comment 14 Markus Keller CLA 2014-11-10 09:55:08 EST
This affects a large number of users, and the cause is hard to detect. Web browsers automatically redirect from http to https.

We have to work around the missing redirection, and we should backport this to 4.4.2.

I've filed bug 450841 to use https as default URL. But this will only be picked up by newly added JREs or if the user goes to "Preferences > Installed JREs", edits each JRE, and clicks "Restore Default"
Comment 15 Jay Arthanareeswaran CLA 2014-11-10 10:39:28 EST
(In reply to Markus Keller from comment #14)
> This affects a large number of users, and the cause is hard to detect. 

  We can supply better messages, so the users can easily get this corrected.

> Web browsers automatically redirect from http to https.
> We have to work around the missing redirection, and we should backport this
> to 4.4.2.

  JDT can perhaps provide a rudimentary redirect for this specific case, but we should keep in mind that web browsers are much more equipped to handle a redirect. Though not relevant for Oracle's Javadoc, in other cases, authentication and such could be tricky.
Comment 16 Jay Arthanareeswaran CLA 2014-11-10 10:40:23 EST
Created attachment 248546 [details]
Rudimentary fix

The fix could be along this line.
Comment 17 Markus Keller CLA 2014-11-10 12:19:35 EST
(In reply to Jayaprakash Arthanareeswaran from comment #16)
> Created attachment 248546 [details] [diff]
> Rudimentary fix
> 
> The fix could be along this line.

Looks good. I'd add a comment about the problem and this bug number, and then release for the I-build.
Comment 18 EPP Error Reports CLA 2014-11-11 07:53:59 EST
To date this log entry was reported 25 times.

Your friendly error reports bot.
Comment 19 EPP Error Reports CLA 2014-11-11 17:13:15 EST
*** Bug 451057 has been marked as a duplicate of this bug. ***
Comment 20 Markus Keller CLA 2014-11-12 09:18:52 EST
Created attachment 248607 [details]
Fix v2

Here's a better patch.

- #getResponseCode() already opens the connection as a side-effect. We should ensure we already set the connection timeouts before this occurs.
- Since JDT Core now depends on Java 5, we can can remove the reflective method invocations.
- Should not run into an endless loop if the server redirects many times.
- I've also removed the outdated comment for bug 117890.
Comment 21 Markus Keller CLA 2014-11-12 09:52:38 EST
Created attachment 248610 [details]
Fix v3

This time including the comment I said I would add...
Comment 22 EPP Error Reports CLA 2014-11-12 11:04:17 EST
To date this log entry was reported 50 times.

Your friendly error reports bot.
Comment 23 Jay Arthanareeswaran CLA 2014-11-12 11:08:32 EST
(In reply to Markus Keller from comment #21)
> Created attachment 248610 [details]
> Fix v3
> 
> This time including the comment I said I would add...

+1. Changes look good to me.
Comment 24 Markus Keller CLA 2014-11-12 11:50:52 EST
Released v3 to master: http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/?id=25cb9ce2b0a42eaaa079306fa88b8294a5b0343f

Keeping this bug for backport to 4.4.2.
Comment 25 Jay Arthanareeswaran CLA 2014-11-13 04:41:33 EST
(In reply to Markus Keller from comment #24)
> Released v3 to master:
> http://git.eclipse.org/c/jdt/eclipse.jdt.ui.git/commit/
> ?id=25cb9ce2b0a42eaaa079306fa88b8294a5b0343f

Couple of issues:

1. The correct commit is here: 

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?id=25cb9ce2b0a42eaaa079306fa88b8294a5b0343f

2. This is causing a test failure - bug 451289. I am looking at it.
Comment 26 EPP Error Reports CLA 2014-11-15 14:07:07 EST
To date this log entry was reported 100 times.

Your friendly error reports bot.
Comment 27 Jay Arthanareeswaran CLA 2014-11-16 03:53:36 EST
*** Bug 451650 has been marked as a duplicate of this bug. ***
Comment 28 Marcel Bruch CLA 2014-11-16 04:24:43 EST
Thanks for fixing this one so quickly. FWIW, as soon as you set this bug report to "fixed" users will get a popup notification that this issue has been fixed (see [1] for a short sequence about this workflow). The text in the whiteboard message is then displayed as part of the popup dialog content and thus may contain information how to update/get rid of this error (this popup will also be presented to 4.4 and 4.3 users that experience the same issue and have installed the reporting from our milestones update site).

[1] http://youtu.be/bODLj6q7jxo?t=1m55s
Comment 29 EPP Error Reports CLA 2014-11-19 09:00:52 EST
*** Bug 452273 has been marked as a duplicate of this bug. ***
Comment 30 Stephan Herrmann CLA 2014-11-20 05:03:28 EST
(In reply to Marcel Bruch from comment #28)
> Thanks for fixing this one so quickly. FWIW, as soon as you set this bug
> report to "fixed" users will get a popup notification that this issue has
> been fixed (see [1] for a short sequence about this workflow). The text in
> the whiteboard message is then displayed as part of the popup dialog content
> and thus may contain information how to update/get rid of this error (this
> popup will also be presented to 4.4 and 4.3 users that experience the same
> issue and have installed the reporting from our milestones update site).

This creates a clash with JDT's use of the whiteboard for verification purposes and similar. The message "To be verified for 4.5 M4" (see this bug) certainly makes more sense to JDT developers than to users.

Hm, do we need a second whiteboard?? Perhaps a tag inside the whiteboard could be used to mark "public" messages?
Comment 31 Marcel Bruch CLA 2014-11-20 05:19:14 EST
(In reply to Stephan Herrmann from comment #30)
> Hm, do we need a second whiteboard?? Perhaps a tag inside the whiteboard
> could be used to mark "public" messages?

Thanks Stephan.

Two short comments on this:
1. I don't find that style of JDT whiteboard message very problematic right now. 
2. Webmaster does not want to add custom (text) fields to bugzilla (only if really necessary). Since the error reporting is quite experimental, I'd not drive this further in this direction right now.

Maybe adding a second portal will be the better solution in the long run. We'll see. But I'll keep an eye on the whiteboard messages for now and think about another solution when I think this becomes a problem for users.
Comment 32 EPP Error Reports CLA 2014-11-22 17:23:45 EST
To date this log entry was reported 200 times.

Your friendly error reports bot.
Comment 33 Stephan Herrmann CLA 2014-11-22 18:39:49 EST
(In reply to Error Reports from comment #32)
> To date this log entry was reported 200 times.
> 
> Your friendly error reports bot.

Apparently the friendly error reports bot doesn't understand that this bug has already been resolved, just being kept open for back porting purposes.

(Committers recognize this by looking at the whiteboard entry :) )
Comment 34 Marcel Bruch CLA 2014-11-22 19:23:43 EST
Actually, there is no logic that stops it from adding a comment every 200 error reports from now. Maybe until we reach the 400th report, we may have the logic that it will stop reporting comments if a bug is fixed.
Comment 35 Jay Arthanareeswaran CLA 2014-11-24 01:00:24 EST
(In reply to Stephan Herrmann from comment #33)
> (In reply to Error Reports from comment #32)
> > To date this log entry was reported 200 times.
> > 
> > Your friendly error reports bot.
> 
> Apparently the friendly error reports bot doesn't understand that this bug
> has already been resolved, just being kept open for back porting purposes.

Yep :)

Actually this is in the process of being back ported, but unfortunately part of a group of multiple such bugs. So, the batch needs to to through rigorous testing, but I am hoping to push these in in a day or two.
Comment 36 Jay Arthanareeswaran CLA 2014-11-24 03:29:52 EST
I have reviewed and released this fix for 4.4.2:

http://git.eclipse.org/c/jdt/eclipse.jdt.core.git/commit/?h=R4_4_maintenance&id=b9e024e52a6b1f5f557e653f0bf938e07c6052d7

Hope this satisfies the error reporting bot :)
Comment 37 Marcel Bruch CLA 2014-11-24 06:06:24 EST
It will (In reply to Jayaprakash Arthanareeswaran from comment #36)
> I have reviewed and released this fix for 4.4.2:
> Hope this satisfies the error reporting bot :)

Thanks for the back-port! It will make all your 4.4.2 users happy. 

Users before 4.4.2, however, will experience this issue and will report it. The bot needs to be tweaked to not report these errors in these cases. I created an enhancement for this bug 452996.
Comment 38 Manoj N Palat CLA 2015-01-19 11:26:42 EST
Verified for Eclipse Luna SR2 Build id: M20150114-1500
[by code review]
Comment 39 Manoj N Palat CLA 2015-01-28 00:18:41 EST
Verified for Eclipse Mars 4.5 M5 Build id: I20150126-2000