Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException when there is a proxy for https protocol in ~/.m2/settings.xml #1879

Closed
brampouwelse opened this issue Feb 6, 2017 · 3 comments

Comments

@brampouwelse
Copy link
Contributor

IllegalArgumentException when the maven settings.xml contains a proxy for https protocol

        <proxy>
            <id>https</id>
            <active>true</active>
            <protocol>https</protocol>
            <host>my.proxy.host</host>
            <port>1234</port>
            <username></username>
            <password></password>
        </proxy>
Exception: java.lang.IllegalArgumentException: No enum constant java.net.Proxy.Type.HTTPS
	at java.lang.Enum.valueOf(Enum.java:238)
	at aQute.lib.converter.Converter.convert(Converter.java:246)
	at aQute.bnd.connection.settings.SettingsParser.parse(SettingsParser.java:76)
	at aQute.bnd.connection.settings.SettingsParser.parse(SettingsParser.java:58)
	at aQute.bnd.connection.settings.SettingsParser.<init>(SettingsParser.java:44)
	at aQute.bnd.connection.settings.ConnectionSettings.parse(ConnectionSettings.java:301)
	at aQute.bnd.connection.settings.ConnectionSettings.readSettings(ConnectionSettings.java:55)
	at aQute.bnd.build.Workspace.setTypeSpecificPlugins(Workspace.java:620)
	at aQute.bnd.osgi.Processor.getPlugins(Processor.java:527)
	at org.bndtools.builder.CnfWatcher.processEvent(CnfWatcher.java:84)
	at org.bndtools.builder.CnfWatcher.resourceChanged(CnfWatcher.java:41)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:299)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:289)
	at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:152)
	at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:374)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1469)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2253)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2267)
	at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:128)
	at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:73)
	at org.eclipse.ui.internal.editors.text.WorkspaceOperationRunner.run(WorkspaceOperationRunner.java:63)
	at org.eclipse.ui.editors.text.TextFileDocumentProvider.executeOperation(TextFileDocumentProvider.java:458)
	at org.eclipse.ui.editors.text.TextFileDocumentProvider.saveDocument(TextFileDocumentProvider.java:761)
	at org.eclipse.ui.texteditor.AbstractTextEditor.performSave(AbstractTextEditor.java:5025)
	at org.eclipse.ui.texteditor.AbstractTextEditor.doSave(AbstractTextEditor.java:4820)
	at bndtools.editor.BndEditor.reallySave(BndEditor.java:258)
	at bndtools.editor.BndEditor.doSave(BndEditor.java:246)
	at org.eclipse.ui.internal.SaveableHelper$2.run(SaveableHelper.java:157)
	at org.eclipse.ui.internal.SaveableHelper$5.run(SaveableHelper.java:286)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:437)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:353)
	at org.eclipse.ui.internal.WorkbenchWindow$14.run(WorkbenchWindow.java:2184)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchWindow.run(WorkbenchWindow.java:2180)
	at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:294)
	at org.eclipse.ui.internal.SaveableHelper.runProgressMonitorOperation(SaveableHelper.java:272)
	at org.eclipse.ui.internal.SaveableHelper.savePart(SaveableHelper.java:162)
	at org.eclipse.ui.internal.WorkbenchPage.saveSaveable(WorkbenchPage.java:3904)
	at org.eclipse.ui.internal.WorkbenchPage.saveEditor(WorkbenchPage.java:3918)
	at org.eclipse.ui.internal.handlers.SaveHandler.execute(SaveHandler.java:54)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:295)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:90)
	at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source)
	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:282)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:264)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
	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:488)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.executeCommand(KeyBindingDispatcher.java:286)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.press(KeyBindingDispatcher.java:507)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.processKeyEvent(KeyBindingDispatcher.java:558)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.filterKeySequenceBindings(KeyBindingDispatcher.java:378)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher.access$0(KeyBindingDispatcher.java:324)
	at org.eclipse.e4.ui.bindings.keys.KeyBindingDispatcher$KeyDownFilter.handleEvent(KeyBindingDispatcher.java:86)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1097)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4243)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1501)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1524)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1509)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1538)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1534)
	at org.eclipse.swt.widgets.Canvas.sendKeyEvent(Canvas.java:515)
	at org.eclipse.swt.widgets.Control.doCommandBySelector(Control.java:1090)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5817)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSResponder.interpretKeyEvents(NSResponder.java:68)
	at org.eclipse.swt.widgets.Composite.keyDown(Composite.java:610)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5727)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:227)
	at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:2140)
	at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2402)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:5789)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:5218)
	at org.eclipse.swt.widgets.Display.applicationProc(Display.java:5367)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:128)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3695)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:165)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:369)
	at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:993)
	at org.bndtools.utils.jface.ProgressRunner.execute(ProgressRunner.java:35)
	at org.bndtools.core.ui.wizards.shared.TemplateSelectionWizardPage.loadTemplates(TemplateSelectionWizardPage.java:367)
	at org.bndtools.core.ui.wizards.shared.TemplateSelectionWizardPage.setVisible(TemplateSelectionWizardPage.java:114)
	at org.eclipse.jface.wizard.WizardDialog.showStartingPage(WizardDialog.java:1242)
	at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:590)
	at org.eclipse.jface.window.Window.create(Window.java:426)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1095)
	at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:120)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
	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:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4248)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1501)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1524)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1509)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1313)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4072)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3698)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:165)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:369)
	at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:993)
	at org.bndtools.utils.jface.ProgressRunner.execute(ProgressRunner.java:35)
	at org.bndtools.core.ui.wizards.shared.TemplateSelectionWizardPage.loadTemplates(TemplateSelectionWizardPage.java:367)
	at org.bndtools.core.ui.wizards.shared.TemplateSelectionWizardPage.setVisible(TemplateSelectionWizardPage.java:114)
	at org.eclipse.jface.wizard.WizardDialog.showStartingPage(WizardDialog.java:1242)
	at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:590)
	at org.eclipse.jface.window.Window.create(Window.java:426)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1095)
	at org.eclipse.ui.internal.actions.NewWizardShortcutAction.run(NewWizardShortcutAction.java:120)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:473)
	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:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4248)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1501)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1524)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1509)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1313)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4072)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3698)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:687)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:604)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	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:673)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1519)

@gamerson
Copy link
Contributor

gamerson commented Feb 6, 2017

Hmm yes it seems that bnd's SettingsParser is going to have to be less strict. Right now its based on serializing down to Proxy.Type enum, and Maven's is any string that would be used in a proxy server protocol scheme.

@bjhargrave
Copy link
Member

bjhargrave commented Feb 17, 2017

The doc for -connection-settings is clear that only 'http'| 'direct' | 'socks' are the supported protocols. Why don't you just set the protocol to http?

@brampouwelse
Copy link
Contributor Author

I didn't want bnd to use my maven settings in the first place (#1880) but it does. So if you decide to re-use existing settings from another app (maven in this case) IMHO all configurations that are considered valid by the app you're re-using configuration from should be accepted as valid configurations.

@bjhargrave bjhargrave added this to the Abeyance milestone Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants