Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 250707 - [Proxy] remains an issue : if gnome proxy is set to direct connection pd is null and the java code does not handle that
Summary: [Proxy] remains an issue : if gnome proxy is set to direct connection pd is n...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Team (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.5 M3   Edit
Assignee: Pawel Pogorzelski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-13 22:44 EDT by Alban Browaeys CLA
Modified: 2008-10-14 04:36 EDT (History)
8 users (show)

See Also:


Attachments
Fix the bug about gnome direct connection triggering a null pointer exception (977 bytes, patch)
2008-10-13 22:54 EDT, Alban Browaeys CLA
tomasz.zarna: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alban Browaeys CLA 2008-10-13 22:44:12 EDT
+++ This bug was initially created as a clone of Bug #232495 +++

gnomeproxy.c line 101 at 105: in getGConfProxyInfo

 	if (strcasecmp(cprotocol, "http") == 0 || useSame) {
		gboolean useProxy = gconf_client_get_bool(client,
				"/system/http_proxy/use_http_proxy", NULL);
		if (!useProxy) {
			proxyInfo = NULL;
			goto exit;
		}

thus if direct connection is choosen in gnome proxyInfo will be NULL.

Though the java code expect it not to be : UnixProvider.java l.169 at 172
		if (isGnomeLibLoaded) {
			try {
				// Then ask Gnome
				pd = getGConfProxyInfo(protocol);
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
				System.out.println(pd);
				if (Policy.DEBUG_SYSTEM_PROVIDERS)
					Policy.debug("Got Gnome proxy: " + pd); //$NON-NLS-1$
				pd.setSource("LINUX_GNOME"); //$NON-NLS-1$
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
				return pd;
			} catch (UnsatisfiedLinkError e) {
				// The library should be loaded, so this is a real exception
				Activator.logError(
						"Problem during accessing Gnome library", e); //$NON-NLS-1$
			}
		}


I don't have a patch yet because I don't know the use of pd.setSource ...
I am investigating.


Currently this break all gnome/eclipse install where gnome is set to direct connection (most common use case) with:
!ENTRY org.eclipse.ui 4 0 2008-10-14 04:00:05.816
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
        at org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider.getSystemProxyInfo(UnixProxyProvider.java:164)
        at org.eclipse.core.internal.net.proxy.unix.UnixProxyProvider.getProxyData(UnixProxyProvider.java:52)
        at org.eclipse.core.internal.net.AbstractProxyProvider.select(AbstractProxyProvider.java:43)
        at org.eclipse.core.internal.net.ProxyManager.getProxyDataForHost(ProxyManager.java:344)
        at org.eclipse.jsch.internal.core.Utils.getProxyData(Utils.java:111)
        at org.eclipse.jsch.internal.core.Utils.getProxyForHost(Utils.java:133)
        at org.eclipse.jsch.internal.core.JSchProvider.getProxyForHost(JSchProvider.java:126)
        at org.eclipse.team.internal.ccvs.core.connection.PServerConnection.getProxy(PServerConnection.java:148)
        at org.eclipse.team.internal.ccvs.core.connection.PServerConnection.open(PServerConnection.java:106)
        at org.eclipse.team.internal.ccvs.core.connection.Connection.open(Connection.java:132)
        at org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.createConnection(CVSRepositoryLocation.java:545)
        at org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.openConnection(CVSRepositoryLocation.java:806)
        at org.eclipse.team.internal.ccvs.core.client.Session.open(Session.java:159)
        at org.eclipse.team.internal.ccvs.core.connection.CVSRepositoryLocation.validateConnection(CVSRepositoryLocation.java:1041)
        at org.eclipse.team.internal.ccvs.ui.wizards.ModuleSelectionPage.validateLocation(ModuleSelectionPage.java:384)
        at org.eclipse.team.internal.ccvs.ui.wizards.ModuleSelectionPage$3.run(ModuleSelectionPage.java:208)
        at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Comment 1 Alban Browaeys CLA 2008-10-13 22:54:01 EDT
Created attachment 114991 [details]
Fix the bug about gnome direct connection triggering a null pointer exception

setSource being of no use for a non proxy connection and the correct behaviour for a non proxy connection being to return null this patch attempt to fix this last glitch.
Comment 2 Pawel Pogorzelski CLA 2008-10-14 04:22:49 EDT
Alban, the patch you provided looks good. Thanks!

Tomasz, could you release it?
Comment 3 Tomasz Zarna CLA 2008-10-14 04:36:03 EDT
Released to HEAD.