Community
Participate
Working Groups
When trying to display a javadoc for any element, eclipse "hangs" for a minute. Obviously it is tried to get the javadoc from the configured location http://java.sun.com/j2se/... (which is correct) but cannot connect via proxy. The proxy is configured in the network configuration of MacOSX and (just for test) under Team - CVS - Proxy Settings. A solution might be, to download the javadoc and browse offline. But I think it should be necessary to leave the online access, when connected to a network. But if youre disconnected, there shouldnt be minute-long timeouts, which makes it unusable when offline. The Eclipse Help-Browser can, anyhow, connect via proxy to the web (e.g. websearch). ------------------------------------------- eclipse.buildId=I20060217-1115 java.version=1.4.2_09 java.vendor=Apple Computer, Inc. BootLoader constants: OS=macosx, ARCH=ppc, WS=carbon, NL=de_DE Command-line arguments: -os macosx -ws carbon -arch ppc Error 2006-04-11 12:57:42.79 Internal Error Java Model Exception: Java Model Status [Cannot retrieve the attached javadoc for String [in String.class [in java.lang [in /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Classes/classes.jar [in imsbusiness]]]]java.net.SocketException: Malformed reply from SOCKS server at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:130) at java.net.SocksSocketImpl.connectV4(SocksSocketImpl.java:296) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:379) at java.net.Socket.connect(Socket.java:452) at java.net.Socket.connect(Socket.java:402) at sun.net.NetworkClient.doConnect(NetworkClient.java:139) at sun.net.www.http.HttpClient.openServer(HttpClient.java:402) at sun.net.www.http.HttpClient.openServer(HttpClient.java:618) at sun.net.www.http.HttpClient.<init>(HttpClient.java:306) at sun.net.www.http.HttpClient.<init>(HttpClient.java:267) at sun.net.www.http.HttpClient.New(HttpClient.java:339) at sun.net.www.http.HttpClient.New(HttpClient.java:320) at sun.net.www.http.HttpClient.New(HttpClient.java:315) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:521) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:498) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:626) at org.eclipse.jdt.internal.core.JavaElement.getURLContents(JavaElement.java:731) at org.eclipse.jdt.internal.core.BinaryType.getJavadocContents(BinaryType.java:1074) at org.eclipse.jdt.internal.core.BinaryMethod.getAttachedJavadoc(BinaryMethod.java:467) at org.eclipse.jdt.ui.JavadocContentAccess.getHTMLContentReader(JavadocContentAccess.java:121) at org.eclipse.jdt.internal.ui.text.java.ProposalInfo.extractJavadoc(ProposalInfo.java:92) at org.eclipse.jdt.internal.ui.text.java.ProposalInfo.computeInfo(ProposalInfo.java:70) at org.eclipse.jdt.internal.ui.text.java.ProposalInfo.getInfo(ProposalInfo.java:54) at org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.getAdditionalProposalInfo(AbstractJavaCompletionProposal.java:438) at org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.getAdditionalProposalInfo(LazyJavaCompletionProposal.java:236) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation(AdditionalInfoController.java:221) at org.eclipse.jface.text.AbstractInformationControlManager.doShowInformation(AbstractInformationControlManager.java:820) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation(AbstractInformationControlManager.java:810) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run(AdditionalInfoController.java:173) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3142) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2912) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) ] at org.eclipse.jdt.internal.core.JavaElement.getURLContents(JavaElement.java:778) at org.eclipse.jdt.internal.core.BinaryType.getJavadocContents(BinaryType.java:1074) at org.eclipse.jdt.internal.core.BinaryMethod.getAttachedJavadoc(BinaryMethod.java:467) at org.eclipse.jdt.ui.JavadocContentAccess.getHTMLContentReader(JavadocContentAccess.java:121) at org.eclipse.jdt.internal.ui.text.java.ProposalInfo.extractJavadoc(ProposalInfo.java:92) at org.eclipse.jdt.internal.ui.text.java.ProposalInfo.computeInfo(ProposalInfo.java:70) at org.eclipse.jdt.internal.ui.text.java.ProposalInfo.getInfo(ProposalInfo.java:54) at org.eclipse.jdt.internal.ui.text.java.AbstractJavaCompletionProposal.getAdditionalProposalInfo(AbstractJavaCompletionProposal.java:438) at org.eclipse.jdt.internal.ui.text.java.LazyJavaCompletionProposal.getAdditionalProposalInfo(LazyJavaCompletionProposal.java:236) at org.eclipse.jface.text.contentassist.AdditionalInfoController.computeInformation(AdditionalInfoController.java:221) at org.eclipse.jface.text.AbstractInformationControlManager.doShowInformation(AbstractInformationControlManager.java:820) at org.eclipse.jface.text.AbstractInformationControlManager.showInformation(AbstractInformationControlManager.java:810) at org.eclipse.jface.text.contentassist.AdditionalInfoController$1.run(AdditionalInfoController.java:173) at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123) at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3142) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2912) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)
Could you please provide the javadoc attachment URL that you are using?
Do you pass the proxy information to Eclipse when you start ?
Are you using an authenticated connection over the proxy server with login/password ?
Can you try to start Eclipse with the following vm arguments ? -DproxySet=true -DproxyHost=myProxyMachineName -DproxyPort=proxyPort where you specify the right name for your proxy and the right port. In order to specify vm arguments on the command line, you can edit the eclipse.ini file and add the following lines at the end: -DproxySet=true -DproxyHost=myProxyMachineName -DproxyPort=proxyPort You need to put each argument on its own line after the -vmargs argument. Let me know if this helps. Thanks.
This page seems to describe the properties names: http://java.sun.com/j2se/1.4.2/docs/guide/net/properties.html or: http://java.sun.com/j2se/1.5.0/docs/guide/net/properties.html Let me know if adding these settings helps you with proxy connections.
------- Comment #1 From Olivier Thomann 2006-04-11 10:55 [reply] ------- Could you please provide the javadoc attachment URL that you are using? -> the javadoc url is http://java.sun.com/j2se/1.5.0/docs/api/ ------- Comment #2 From Olivier Thomann 2006-04-11 11:02 [reply] ------- Do you pass the proxy information to Eclipse when you start ? -> yes, the Help - About - Configuration Details shows the right proxy / port ------- Comment #3 From Olivier Thomann 2006-04-11 12:14 [reply] ------- Are you using an authenticated connection over the proxy server with login/password ? -> the proxy does not require login ------- Comment #4 From Olivier Thomann 2006-04-11 12:20 [reply] ------- Can you try to start Eclipse with the following vm arguments ? -> i did, as expected the lines http.proxyHost=[myproxynamehere] http.proxyPort=8080 http.proxySet=true are doubled
This requires a proxy support from core level.
Changing OS from Mac OS to Mac OS X as per bug 185991
*** Bug 261409 has been marked as a duplicate of this bug. ***
(In reply to comment #7) > This requires a proxy support from core level. For this we need to call Platform's proxy API, namely IProxyService, IProxyData, etc. So the JDT/Core plugin will need to depend on “org.eclipse.ui.net” and “org.eclipse.core.net” plugins. Olivier, while I dont think there's any harm in it, I would like to take your opinion on whether this sounds ok.
(In reply to comment #10) > For this we need to call Platform's proxy API, namely IProxyService, > IProxyData, etc. So the JDT/Core plugin will need to depend on > “org.eclipse.ui.net” and “org.eclipse.core.net” plugins. Olivier, while I dont > think there's any harm in it, I would like to take your opinion on whether this > sounds ok. We cannot depend on any UI code. So we cannot add a dependency on org.eclipse.ui.net. If we need org.eclipse.ui.net, then some code from that bundle should be moved down to the core level.
Moving to M5. This is too late for M4.
Where are we for this bug ?
(In reply to comment #13) > Where are we for this bug ? This is the next item on my plate once bug 186342 and bug 247564 are fixed.
Created attachment 186615 [details] proposed fix This patch simply changes the timeout for the read operation to 5 secs. It also introduces a new JavaModelStatus constant to convey that the javadoc couldnt be retrieved due to timeout. I couldn't really test the patch since I couldnt reproduce the condition when a proxy is in use and fetching javadoc is taking too much time. But, this should be enough to avoid the "hang". Olivier what do you think? Otherwise proxy support is already in place and we dont need to do anything extra. So the above comment can be ignored.
Looks good. In fact proxy support has been added in platform core after this bug has been opened.
Released in HEAD for 3.7M5. Verification to be done using code inspection
URLConnection#setReadTimeout is a java 1.5 api. So can't be used. :(
Created attachment 186980 [details] rectified fix This fix uses system wide properties sun.net.client.defaultConnectTimeout sun.net.client.defaultReadTimeout to set the timeout. Since the values are cached and used further on, i've left them as 10 seconds.
Released above patch in HEAD.
(In reply to comment #18) > URLConnection#setReadTimeout is a java 1.5 api. So can't be used. :( Ayushman, if having this method would help, then we should change the JDT/Core bundle EE to be 1.5. We can do that even if we don't use generics in our API. We would continue to preserve 1.4 code for the compiler code, but we could get access to all 1.5 types, fields and methods for the remaining JDT/Core code. What do you think ? Daniel, I believe it could simplify the code to use 1.5 APIs.
(In reply to comment #21) > (In reply to comment #18) > > URLConnection#setReadTimeout is a java 1.5 api. So can't be used. :( > Ayushman, if having this method would help, then we should change the JDT/Core > bundle EE to be 1.5. We can do that even if we don't use generics in our API. > We would continue to preserve 1.4 code for the compiler code, but we could get > access to all 1.5 types, fields and methods for the remaining JDT/Core code. > > What do you think ? That would be great! Not just in the sense of this bug (which can otherwise be worked around by setting system properties while launching eclipse), but generally as well!
(In reply to comment #21) > (In reply to comment #18) > > URLConnection#setReadTimeout is a java 1.5 api. So can't be used. :( > Ayushman, if having this method would help, then we should change the JDT/Core > bundle EE to be 1.5. We can do that even if we don't use generics in our API. > We would continue to preserve 1.4 code for the compiler code, but we could get > access to all 1.5 types, fields and methods for the remaining JDT/Core code. > > What do you think ? > > Daniel, I believe it could simplify the code to use 1.5 APIs. I'm not in favor of a mixed world but would support switching JDT Core to 1.5 entirely if there are no objections from the JDT Core co-leads. Especially interesting (for JDT UI) would be to get a generified AST API.
(In reply to comment #23) > I'm not in favor of a mixed world but would support switching JDT Core to 1.5 > entirely if there are no objections from the JDT Core co-leads. Especially > interesting (for JDT UI) would be to get a generified AST API. Srikanth, please comment on this. Thanks. The compiler code has always be more restrictive due to the limitation to run the batch compiler on system using only Foundation 1.1. We need for now to maintain this. This should not refrain the remaining code of JDT/Core from moving to 1.5 APIs.
Ayushman, please use reflection to retrieve the setTimeout method and call it. That way it would be fixed when Eclipse is running on a 1.5 VM and it would not work on a 1.4 VM. 1.4 VM are not recommended anymore to run Eclipse. The move to 1.5 for the JDT/Core bundle will be done in 3.8 time frame and at that time we will remove the reflection layer and directly use the method. Thanks.
(In reply to comment #24) > (In reply to comment #23) > > I'm not in favor of a mixed world but would support switching JDT Core to 1.5 > > entirely if there are no objections from the JDT Core co-leads. Especially > > interesting (for JDT UI) would be to get a generified AST API. > Srikanth, please comment on this. Agree with proposal in comment# 25.
Created attachment 187079 [details] proposed fix v2.0 This patch uses reflection to set the read and connect timeouts on URLConnection. In case those methods are not available (becoz of java 1.4), the system-wide properties are set. Olivier, does this patch look ok?
.
(In reply to comment #27) > Olivier, does this patch look ok? Almost :-). Since 1.4 is not supposed to be used anymore to run Eclipse, I would completely remove the code that is using system properties. So no fall back story for 1.4. For the code: Class URLClass = Class.forName("java.net.URLConnection") I think you can simply do: connection.getClass(); And I would use exact exception catching instead of Exception.
Created attachment 187103 [details] Proposed fix Proposal that matches my previous comment. Ayushman, please review. If ok, then please release. Thanks.
Released above patch in HEAD for 3.7M5
Verified for 3.7M5 by code inspection using build I20110124-1800
*** Bug 237436 has been marked as a duplicate of this bug. ***
*** Bug 215320 has been marked as a duplicate of this bug. ***