Deploying external sources on appserver startup

A user of the Jetty plug-in reported that "Add | External Source..."
on the Deployment tab of a Run/Debug Configuration doesn't work.

I can reproduce the problem and see this exception in idea.log when
clicking OK on the "Select files or directories to deploy" filechooser:

  ERROR - com.intellij.ide.IdeEventQueue - Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(343,140),absolute(710,201),button=1,modifiers=Button1,clickCount=1] on dialog0
java.lang.IllegalArgumentException: Argument 1 for @NotNull parameter of com/intellij/javaee/deployment/ui/DeploymentSettingsPanel.createPanel must not be null
     at com.intellij.javaee.deployment.ui.DeploymentSettingsPanel.createPanel(DeploymentSettingsPanel.java)
     at com.intellij.javaee.deployment.ui.DeploymentSettingsPanel.addDeploymentModel(DeploymentSettingsPanel.java:272)
     at com.intellij.javaee.deployment.ui.actions.AddExternalFileToDeployAction.actionPerformed(AddExternalFileToDeployAction.java:53)
     at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:234)
     at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:629)
     at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:98)
     at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:220)
     at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
     at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:92)
     at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:512)
     at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:44)
     at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:532)
     at java.awt.Component.processMouseEvent(Component.java:6267)
     at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
     at java.awt.Component.processEvent(Component.java:6032)
     at java.awt.Container.processEvent(Container.java:2041)
     at java.awt.Component.dispatchEventImpl(Component.java:4630)
     at java.awt.Container.dispatchEventImpl(Container.java:2099)
     at java.awt.Component.dispatchEvent(Component.java:4460)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
     at java.awt.Container.dispatchEventImpl(Container.java:2085)
     at java.awt.Window.dispatchEventImpl(Window.java:2478)
     at java.awt.Component.dispatchEvent(Component.java:4460)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
     at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:652)
     at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:502)
     at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:405)
     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:369)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
     at java.awt.Dialog$1.run(Dialog.java:1046)
     at java.awt.Dialog$3.run(Dialog.java:1098)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.awt.Dialog.show(Dialog.java:1096)
     at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:670)
     at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:412)
     at com.intellij.openapi.ui.DialogWrapper.showAndGetOk(DialogWrapper.java:1063)
     at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1048)
     at com.intellij.execution.actions.EditRunConfigurationsAction.actionPerformed(EditRunConfigurationsAction.java:39)
     at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep$1.run(PopupFactoryImpl.java:500)
     at com.intellij.openapi.wm.impl.FocusManagerImpl.e(FocusManagerImpl.java:469)
     at com.intellij.openapi.wm.impl.FocusManagerImpl.d(FocusManagerImpl.java:452)
     at com.intellij.openapi.wm.impl.FocusManagerImpl.access$200(FocusManagerImpl.java:49)
     at com.intellij.openapi.wm.impl.FocusManagerImpl$1.runEdt(FocusManagerImpl.java:77)
     at com.intellij.openapi.util.EdtRunnable$1.run(EdtRunnable.java:25)
     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
     at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:652)
     at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:506)
     at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:405)
     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:369)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

None of my plug-in code features in the stacktrace, and I don't see any
of my code being called during this process.  What should I be doing to
prevent the IAE?  Presumably overriding some base appserver method
implementation that's returning null?

If I perform the same action using the Tomcat integration then the chosen
war file is added correctly.

I noticed that for Tomcat the chooser filters out jar files but for Jetty
it doesn't.  What should I be doing to prevent jar files from being
shown?  I don't see any relevant FileFilter in the Tomcat Integration
source.

Thanks for any pointers...

--
Mark Scott
mark@codebrewer.com

2 comments
Comment actions Permalink

You need to override DeploymentProvider#createNewDeploymentModel(CommonModel,DeploymentSource) method instead of deprecated
createNewDeploymentModel(CommonModel, ArtifactPointer) to avoid the exception.

Acceptable extensions for file chooser are determined by artifact types supported by the server. You can return
Arrays.asList(WebArtifactUtil.getInstance().getExplodedWarArtifactType(), WebArtifactUtil.getInstance().getWarArtifactType())
from implementation of DeploymentProvider#getSupportedArtifactTypes to indicate what the servers supports only web artifacts.

A user of the Jetty plug-in reported that "Add | External Source..."
on the Deployment tab of a Run/Debug Configuration doesn't work.

>

I can reproduce the problem and see this exception in idea.log when
clicking OK on the "Select files or directories to deploy" filechooser:

>

  ERROR - com.intellij.ide.IdeEventQueue - Error during dispatching of java.awt.event.MouseEvent[MOUSE_RELEASED,(343,140),absolute(710,201),button=1,modifiers=Button1,clickCount=1] on dialog0
java.lang.IllegalArgumentException: Argument 1 for @NotNull parameter of com/intellij/javaee/deployment/ui/DeploymentSettingsPanel.createPanel must not be null
     at com.intellij.javaee.deployment.ui.DeploymentSettingsPanel.createPanel(DeploymentSettingsPanel.java)
     at com.intellij.javaee.deployment.ui.DeploymentSettingsPanel.addDeploymentModel(DeploymentSettingsPanel.java:272)
     at com.intellij.javaee.deployment.ui.actions.AddExternalFileToDeployAction.actionPerformed(AddExternalFileToDeployAction.java:53)
     at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:234)
     at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:629)
     at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:98)
     at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:220)
     at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
     at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:92)
     at com.intellij.ui.plaf.beg.BegMenuItemUI.a(BegMenuItemUI.java:512)
     at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:44)
     at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:532)
     at java.awt.Component.processMouseEvent(Component.java:6267)
     at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
     at java.awt.Component.processEvent(Component.java:6032)
     at java.awt.Container.processEvent(Container.java:2041)
     at java.awt.Component.dispatchEventImpl(Component.java:4630)
     at java.awt.Container.dispatchEventImpl(Container.java:2099)
     at java.awt.Component.dispatchEvent(Component.java:4460)
     at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
     at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
     at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
     at java.awt.Container.dispatchEventImpl(Container.java:2085)
     at java.awt.Window.dispatchEventImpl(Window.java:2478)
     at java.awt.Component.dispatchEvent(Component.java:4460)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
     at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:652)
     at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:502)
     at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:405)
     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:369)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:178)
     at java.awt.Dialog$1.run(Dialog.java:1046)
     at java.awt.Dialog$3.run(Dialog.java:1098)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.awt.Dialog.show(Dialog.java:1096)
     at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:670)
     at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:412)
     at com.intellij.openapi.ui.DialogWrapper.showAndGetOk(DialogWrapper.java:1063)
     at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1048)
     at com.intellij.execution.actions.EditRunConfigurationsAction.actionPerformed(EditRunConfigurationsAction.java:39)
     at com.intellij.ui.popup.PopupFactoryImpl$ActionPopupStep$1.run(PopupFactoryImpl.java:500)
     at com.intellij.openapi.wm.impl.FocusManagerImpl.e(FocusManagerImpl.java:469)
     at com.intellij.openapi.wm.impl.FocusManagerImpl.d(FocusManagerImpl.java:452)
     at com.intellij.openapi.wm.impl.FocusManagerImpl.access$200(FocusManagerImpl.java:49)
     at com.intellij.openapi.wm.impl.FocusManagerImpl$1.runEdt(FocusManagerImpl.java:77)
     at com.intellij.openapi.util.EdtRunnable$1.run(EdtRunnable.java:25)
     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
     at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:652)
     at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:506)
     at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:405)
     at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:369)
     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

>

None of my plug-in code features in the stacktrace, and I don't see any
of my code being called during this process.  What should I be doing to
prevent the IAE?  Presumably overriding some base appserver method
implementation that's returning null?

>

If I perform the same action using the Tomcat integration then the chosen
war file is added correctly.

>

I noticed that for Tomcat the chooser filters out jar files but for Jetty
it doesn't.  What should I be doing to prevent jar files from being
shown?  I don't see any relevant FileFilter in the Tomcat Integration
source.

>

Thanks for any pointers...

>


--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0
Comment actions Permalink

Thanks, Nikolay - that was very helpful.

--
Mark Scott
mark@codebrewer.com

0

Please sign in to leave a comment.