[jbosstools-issues] [JBoss JIRA] (JBIDE-21170) Virtualbox could not be found by CDK adapter
Rob Stryker (JIRA)
issues at jboss.org
Mon Dec 14 11:51:00 EST 2015
[ https://issues.jboss.org/browse/JBIDE-21170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13140926#comment-13140926 ]
Rob Stryker commented on JBIDE-21170:
-------------------------------------
There's a bunch of other issues stemming from this, but I really think this needs to be tackled as the root issue. There is very little I can do realistically to work around the problem of eclipse being launched with no Path. It would be nearly impossible for me to properly reconstruct a likely path unless I run a background command to get the path.
See, here's the issue:
1) We need to pass in a custom environment, because we do things like add SUB_USERNAME / SUB_PASSWORD to the environment.
2) To do this, we need to merge the existing environment, with the one eclipse has.
3) So we merge the two together, but neither our customizations nor eclipse have a PATH env.var.
4) If I know vagrant is at /usr/local/bin/vagrant because the user set it in the launch config, I can add /usr/local/bin to the environment, BUT...
5) Just adding /usr/local/bin is not enough, because the command will still fail with the following error message: /usr/bin/env: bash: No such file or directory
This happens bc I only added /usr/local/bin to the path (bc thats where the user told us vagrant is), but not /usr/bin. I can't reconstruct a complete path completely enough for it to be useful in any way. If vagrant happens to be in /usr/bin with all the other stuff than it might work (works for me in this case, with the patch I have coded), but it still won't work in [~mmalina]'s case because it still won't have /usr/bin on the path.
So why does this work in vagrant tools? Well, it probably worked in the past, but I doubt it works now. In the past, they didn't pass in an environment, started with an empty environment, which means the system default environment, which i believe is immune because it's not referencing the environment available in eclipse at all. But it was recently coded to allow some additions to environment if the user (or consuming plugins) required it.
I'll keep working to see if I can find more information, but this is a really strange situation and if it needs to be worked around every time we call runtime.exec() and pass in an environment, it will become a big issue all throughout various code, not just this.
> Virtualbox could not be found by CDK adapter
> --------------------------------------------
>
> Key: JBIDE-21170
> URL: https://issues.jboss.org/browse/JBIDE-21170
> Project: Tools (JBoss Tools)
> Issue Type: Bug
> Components: openshift
> Affects Versions: 4.3.1.Beta1
> Reporter: Martin Malina
> Assignee: Rob Stryker
>
> After I set up a CDK server adapter and fixed the wrong path to vagrant in the launch config, I then started the server adapter and got this:
> Server CDK Server Adapter at localhost failed to start.
> Console:
> {code}
> The provider 'virtualbox' that was requested to back the machine
> 'default' is reporting that it isn't usable on this system. The
> reason is shown below:
> Vagrant could not detect VirtualBox! Make sure VirtualBox is properly installed.
> Vagrant uses the `VBoxManage` binary that ships with VirtualBox, and requires
> this to be available on the PATH. If VirtualBox is installed, please find the
> `VBoxManage` binary and add it to the PATH environmental variable.
> {code}
> Along with this, there was an Unhandled event loop exception in the error view:
> {code}
> org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
> at org.eclipse.swt.SWT.error(SWT.java:4491)
> at org.eclipse.swt.SWT.error(SWT.java:4406)
> at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
> at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4024)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3700)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1127)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1018)
> at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:156)
> at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:654)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337)
> at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:598)
> at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
> at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139)
> 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:380)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
> 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:520)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
> Caused by: java.lang.NullPointerException
> at org.jboss.tools.central.editors.GettingStartedHtmlPage.updateEarlyAccess(GettingStartedHtmlPage.java:359)
> at org.jboss.tools.central.editors.GettingStartedHtmlPage.access$14(GettingStartedHtmlPage.java:342)
> at org.jboss.tools.central.editors.GettingStartedHtmlPage$6$1.run(GettingStartedHtmlPage.java:327)
> at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:162)
> at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:154)
> at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
> at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
> ... 23 more
> {code}
> In the command line, VBoxManage is accessible and it is located in /usr/local/bin/ and on my PATH.
> Max suggested I could try to start Eclipse from command line instead of double-clicking in Finder (which is the normal way to do it on Mac) and that helped.
> So for some reason when you start Eclipse using Eclipse.app from Finder, the PATH is incorrect.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jbosstools-issues
mailing list