Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 535781

Summary: [EPP Photon RC3] java.lang.NoClassDefFoundError: org/eclipse/linuxtools/docker/core/IDockerConnection
Product: [Technology] EPP Reporter: Bernd Hufmann <bernd.hufmann>
Component: cpp-packageAssignee: Project Inbox <epp.packager-inbox>
Status: RESOLVED WONTFIX QA Contact:
Severity: critical    
Priority: P3 CC: cdtdoug, jjohnstn, jonah, malaperle, mirec.z, rgrunber
Version: unspecified   
Target Milestone: later   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/124371
https://git.eclipse.org/c/linuxtools/org.eclipse.linuxtools.git/commit/?id=b2366f4a815b1e48ec9f0927be6f922faf6dae73
https://git.eclipse.org/r/124372
https://git.eclipse.org/c/linuxtools/org.eclipse.linuxtools.git/commit/?id=4fd02d33ce82c80eb23bc45595159a40c2777a4a
Whiteboard:
Attachments:
Description Flags
error log file none

Description Bernd Hufmann CLA 2018-06-11 15:40:46 EDT
java.lang.NoClassDefFoundError: org/eclipse/linuxtools/docker/core/IDockerConnection
	at org.eclipse.linuxtools.internal.docker.ui.propertytesters.ConnectionPropertyTester.isConnectionEstablished(ConnectionPropertyTester.java:69)
	at org.eclipse.linuxtools.internal.docker.ui.propertytesters.ConnectionPropertyTester.isConnectionEstablished(ConnectionPropertyTester.java:52)
	at org.eclipse.linuxtools.internal.docker.ui.propertytesters.ConnectionPropertyTester.test(ConnectionPropertyTester.java:42)
	at org.eclipse.core.internal.expressions.Property.test(Property.java:58)
	at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:100)
	at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:71)
	at org.eclipse.ui.internal.services.EvaluationReference.evaluate(EvaluationReference.java:98)
	at org.eclipse.ui.internal.services.EvaluationReference.changed(EvaluationReference.java:92)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:114)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:362)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:377)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.activate(EclipseContext.java:681)
	at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener$2.run(ShellActivationListener.java:127)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener.activate(ShellActivationListener.java:123)
	at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener.handleEvent(ShellActivationListener.java:73)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1721)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1369)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1396)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
	at org.eclipse.swt.widgets.Shell.gtk_focus_in_event(Shell.java:1431)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:1984)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:6468)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5904)
	at org.eclipse.swt.internal.gtk.GTK._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.GTK.gtk_main_do_event(GTK.java:4084)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1383)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:1626)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4516)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:818)
	at org.eclipse.jface.window.Window.open(Window.java:794)
	at org.eclipse.ui.internal.dialogs.AboutDialog.lambda$0(AboutDialog.java:131)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:71)
	at org.eclipse.ui.internal.dialogs.AboutDialog.buttonPressed(AboutDialog.java:127)
	at org.eclipse.jface.dialogs.Dialog.lambda$0(Dialog.java:619)
	at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:81)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:249)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5686)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1370)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4940)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4518)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:818)
	at org.eclipse.jface.window.Window.open(Window.java:794)
	at org.eclipse.ui.internal.about.AboutHandler.execute(AboutHandler.java:28)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:291)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:93)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:318)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:252)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:161)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:204)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:393)
	at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:151)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:565)
	at org.eclipse.jface.action.ActionContributionItem.lambda$4(ActionContributionItem.java:397)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5686)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1370)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4940)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4518)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1170)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1059)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:667)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:597)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:656)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:592)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1498)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1471)
Comment 1 Bernd Hufmann CLA 2018-06-11 15:47:55 EDT
What I did is to import and existing project to a new workspace (C/C++ project). Then in the ProjectExplorer, I did a single selection (e.g. Project) and the I get a pop-up with and exception. I copied the stack back trace to the bug.
Comment 2 Bernd Hufmann CLA 2018-06-11 16:01:04 EDT
I'm using 20180607-0625_eclipse-cpp-photon-RC3-linux.gtk.x86_64.tar.gz downloaded from here:

https://ci.eclipse.org/packaging/job/photon.epp-tycho-build/307/artifact/org.eclipse.epp.packages/archive/
Comment 3 Jeff Johnston CLA 2018-06-11 16:24:01 EDT
(In reply to Bernd Hufmann from comment #2)
> I'm using 20180607-0625_eclipse-cpp-photon-RC3-linux.gtk.x86_64.tar.gz
> downloaded from here:
> 
> https://ci.eclipse.org/packaging/job/photon.epp-tycho-build/307/artifact/org.
> eclipse.epp.packages/archive/

Could you provide details of the Error Log?  The bug above appears to be the Docker Core plug-in is not loading for you (IDockerConnection is a basic class for many releases now).  I have the Linux x86_64 version of the CPP EPP RC3 downloaded to my RHEL laptop and it works without such an issue.
Comment 4 Jonah Graham CLA 2018-06-11 16:31:25 EDT
I have tried and so far have failed to reproduce this. Also running exactly same version. 

This is the code causing the problem:

69: if (receiver instanceof IDockerConnection) {
70:   return expectedValue.equals(((IDockerConnection) receiver)
71:       .getState() == EnumDockerConnectionState.ESTABLISHED);
72: }

Clicking on virtually anything should cause line 69 to be hit, and clicking on an item in the Docker Explorer view will cause it to be true.

I have tried a few things, including attaching a debugger and I can step through that code without a problem.

Something strange is going on here.

Is there any other version of the docker plug-ins visible. I expect it to be these:
$ ll org.eclipse.linuxtools.docker.*
-rw-rw-r-- 1 jonah jonah 233883 Jun  7 07:37 org.eclipse.linuxtools.docker.core_4.0.0.201806061356.jar
-rw-rw-r-- 1 jonah jonah  51875 Jun  7 07:37 org.eclipse.linuxtools.docker.editor_1.0.0.201806061356.jar
-rw-rw-r-- 1 jonah jonah 925965 Jun  7 07:37 org.eclipse.linuxtools.docker.ui_4.0.0.201806061356.jar
Comment 5 Jeff Johnston CLA 2018-06-11 16:45:01 EDT
(In reply to Jonah Graham from comment #4)
> I have tried and so far have failed to reproduce this. Also running exactly
> same version. 
> 
> This is the code causing the problem:
> 
> 69: if (receiver instanceof IDockerConnection) {
> 70:   return expectedValue.equals(((IDockerConnection) receiver)
> 71:       .getState() == EnumDockerConnectionState.ESTABLISHED);
> 72: }
> 
> Clicking on virtually anything should cause line 69 to be hit, and clicking
> on an item in the Docker Explorer view will cause it to be true.
> 
> I have tried a few things, including attaching a debugger and I can step
> through that code without a problem.
> 
> Something strange is going on here.
> 
> Is there any other version of the docker plug-ins visible. I expect it to be
> these:
> $ ll org.eclipse.linuxtools.docker.*
> -rw-rw-r-- 1 jonah jonah 233883 Jun  7 07:37
> org.eclipse.linuxtools.docker.core_4.0.0.201806061356.jar
> -rw-rw-r-- 1 jonah jonah  51875 Jun  7 07:37
> org.eclipse.linuxtools.docker.editor_1.0.0.201806061356.jar
> -rw-rw-r-- 1 jonah jonah 925965 Jun  7 07:37
> org.eclipse.linuxtools.docker.ui_4.0.0.201806061356.jar

As mentioned, the Docker plug-in is clearly failing to load on his system.  The error log may provide a clue.  If not, running with OSGI console may be required.
Comment 6 Bernd Hufmann CLA 2018-06-11 16:46:22 EDT
Created attachment 274436 [details]
error log file

Attachment contains the Full error log file
Comment 7 Jonah Graham CLA 2018-06-11 17:31:50 EDT
Comment on attachment 274436 [details]
error log file

Jeff, I imagine you already saw this, and of course you were right, the bundle failed to load. 

For my ease of reading the root cause exception -- trimmed down from the log:


!ENTRY org.eclipse.osgi 4 0 2018-06-11 16:11:06.986
!MESSAGE An error occurred while automatically activating bundle org.eclipse.linuxtools.docker.core (302).
!STACK 0
org.osgi.framework.BundleException: Exception in org.eclipse.linuxtools.docker.core.Activator.start() of bundle org.eclipse.linuxtools.docker.core.

Caused by: java.lang.IllegalArgumentException: Host name may not be null
	at org.apache.http.util.Args.containsNoBlanks(Args.java:81)
	at org.apache.http.HttpHost.<init>(HttpHost.java:81)
	at org.glassfish.jersey.apache.connector.ApacheConnector.<init>(ApacheConnector.java:255)
	at org.glassfish.jersey.apache.connector.ApacheConnectorProvider.getConnector(ApacheConnectorProvider.java:115)
	at org.glassfish.jersey.client.ClientConfig$State.initRuntime(ClientConfig.java:425)
	at org.glassfish.jersey.client.ClientConfig$State.access$000(ClientConfig.java:90)
	at org.glassfish.jersey.client.ClientConfig$State$3.get(ClientConfig.java:122)
	at org.glassfish.jersey.client.ClientConfig$State$3.get(ClientConfig.java:119)
	at org.glassfish.jersey.internal.util.collection.Values$LazyValueImpl.get(Values.java:340)
	at org.glassfish.jersey.client.ClientConfig.getRuntime(ClientConfig.java:733)
	at org.glassfish.jersey.client.ClientRequest.getConfiguration(ClientRequest.java:285)
	at org.glassfish.jersey.client.JerseyInvocation.validateHttpMethodAndEntity(JerseyInvocation.java:135)
	at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:105)
	at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:101)
	at org.glassfish.jersey.client.JerseyInvocation.<init>(JerseyInvocation.java:92)
	at org.glassfish.jersey.client.JerseyInvocation$AsyncInvoker.method(JerseyInvocation.java:620)
	at com.spotify.docker.client.DefaultDockerClient.request(DefaultDockerClient.java:2628)
	at com.spotify.docker.client.DefaultDockerClient.ping(DefaultDockerClient.java:502)
	at org.eclipse.linuxtools.internal.docker.core.DockerConnection.ping(DockerConnection.java:375)
	at org.eclipse.linuxtools.internal.docker.core.DockerConnection.open(DockerConnection.java:285)
	at org.eclipse.linuxtools.internal.docker.core.DefaultTCPConnectionSettingsProvider.getConnectionSettings(DefaultTCPConnectionSettingsProvider.java:32)
	at org.eclipse.linuxtools.internal.docker.core.DefaultDockerConnectionSettingsFinder.getKnownConnectionSettings(DefaultDockerConnectionSettingsFinder.java:210)
	at org.eclipse.linuxtools.docker.core.DockerConnectionManager.reloadConnections(DockerConnectionManager.java:56)
	at org.eclipse.linuxtools.docker.core.DockerConnectionManager.<init>(DockerConnectionManager.java:46)
	at org.eclipse.linuxtools.docker.core.DockerConnectionManager.getInstance(DockerConnectionManager.java:40)
	at org.eclipse.linuxtools.docker.core.Activator.start(Activator.java:41)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:779)
	at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:772)
Comment 8 Jeff Johnston CLA 2018-06-11 17:53:05 EDT
(In reply to Bernd Hufmann from comment #6)
> Created attachment 274436 [details]
> error log file
> 
> Attachment contains the Full error log file

The code in question is trying to establish a connection to http://127.0.0.1:2375  and the underlying ping is seeing a host name which is null.

The only thing I can think of off the top of my head is your /etc/hosts.conf file.  Do you have 127.0.0.1 set up to be localhost, etc. or do you have nothing specified?  The underlying calls could be trying to resolve the 127.0.0.1 into a host name which is unspecified.

FWIW: my local /etc/hosts.conf file is as follows.

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
Comment 9 Eclipse Genie CLA 2018-06-11 19:23:33 EDT
New Gerrit change created: https://git.eclipse.org/r/124371
Comment 10 Jeff Johnston CLA 2018-06-11 19:24:54 EDT
I am pushing a fix to handle the IllegalArgumentException gracefully.  This will be in Linux Tools RC4.
Comment 12 Eclipse Genie CLA 2018-06-11 20:17:56 EDT
New Gerrit change created: https://git.eclipse.org/r/124372
Comment 14 Bernd Hufmann CLA 2018-06-11 21:41:33 EDT
(In reply to Jeff Johnston from comment #8)
> (In reply to Bernd Hufmann from comment #6)
> > Created attachment 274436 [details]
> > error log file
> > 
> > Attachment contains the Full error log file
> 
> The code in question is trying to establish a connection to
> http://127.0.0.1:2375  and the underlying ping is seeing a host name which
> is null.
> 
> The only thing I can think of off the top of my head is your /etc/hosts.conf
> file.  Do you have 127.0.0.1 set up to be localhost, etc. or do you have
> nothing specified?  The underlying calls could be trying to resolve the
> 127.0.0.1 into a host name which is unspecified.
> 

My /etc/hosts file has the settings below. Not clear to me if it is incorrectly setup.

127.0.0.1	localhost
127.0.0.1	localhost	ip6-localhost ip6-loopback
Comment 15 Bernd Hufmann CLA 2018-06-11 21:44:03 EDT
Fix in Gerrit patch makes sense. It handles such a case gracefully.

Thanks for the quick response and fix.

BR
Bernd
Comment 16 Bernd Hufmann CLA 2018-06-12 10:34:22 EDT
I've installed the nightly build today and the problem is not there anymore.

Thanks
Bernd
Comment 17 Roland Grunberg CLA 2018-06-12 11:13:53 EDT
In ApacheConnector prior to line 255, we have :

proxyUri = config.getProperty(ClientProperties.PROXY_URI);
if (proxyUri != null) {
  final URI u = getProxyUri(proxyUri);
  final HttpHost proxy = new HttpHost(u.getHost(), u.getPort(), u.getScheme());
...

u.getHost() is causing the illegal argument, so it would seem that for some reason proxyUri is set to something that might not be valid.

Looking further in DefaultDockerClient, I see as part of the constructor, updateProxy, which does :

final String proxyHost = System.getProperty("http.proxyHost");
  if (proxyHost != null) {
    config.property(ClientProperties.PROXY_URI, proxyHost + ":"
                + checkNotNull(System.getProperty("http.proxyPort"), "http.proxyPort"));

So I wonder if on the affected system, http.proxyHost might be set to something.
Comment 18 Miroslav ZaƄko CLA 2018-07-03 03:39:17 EDT
same here after clicking CTRL+A (Select All) in editor:
java.lang.NoClassDefFoundError: org/eclipse/linuxtools/docker/core/IDockerConnection
	at org.eclipse.linuxtools.internal.docker.ui.propertytesters.ConnectionPropertyTester.isConnectionEstablished(ConnectionPropertyTester.java:67)
	at org.eclipse.linuxtools.internal.docker.ui.propertytesters.ConnectionPropertyTester.test(ConnectionPropertyTester.java:40)
	at org.eclipse.core.internal.expressions.Property.test(Property.java:58)
	at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:100)
	.....

final release 4.8 version
Comment 19 Jonah Graham CLA 2021-05-07 10:41:35 EDT
I believe this bug either is no longer relevant, or is missing details. If this bug is still relevant, please make a comment and we'll move it to the correct project/component for further investigation.

This change was made as part of a bulk change.