title: Spring MVC project runs on terminal but getting error when run on Intellij
body: <p>I have a Spring MVC web application that should be deployed on Tomcat server. It gets deployed when I run it from terminal i.e., maven build and then copying and pasting the .war file in webapps folder of Tomcat. But when I build and run the same application in Intellij using Smart Tomcat plugin I get NullPoiinterException error. I do not how to debug it. I am new to Spring MVC. I have attaches the stacktract.txt file.</p>
  
  <p><strong>stacktrace.txt</strong></p>
  
  <pre><code>java.lang.IllegalArgumentException: Argument for @NotNull parameter 'file' of com/intellij/openapi/module/ModuleUtilCore.findModuleForFile must not be null
      at com.intellij.openapi.module.ModuleUtilCore.$$$reportNull$$$0(ModuleUtilCore.java)
      at com.intellij.openapi.module.ModuleUtilCore.findModuleForFile(ModuleUtilCore.java)
      at com.poratu.idea.plugins.tomcat.conf.TomcatSettingsEditor$2.textChanged(TomcatSettingsEditor.java:150)
      at com.intellij.ui.DocumentAdapter.insertUpdate(DocumentAdapter.java:15)
      at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:201)
      at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:748)
      at javax.swing.text.AbstractDocument.insertString(AbstractDocument.java:707)
      at javax.swing.text.PlainDocument.insertString(PlainDocument.java:130)
      at javax.swing.text.AbstractDocument.replace(AbstractDocument.java:669)
      at javax.swing.text.JTextComponent.setText(JTextComponent.java:1717)
      at com.intellij.ui.components.JBTextField.setText(JBTextField.java:84)
      at com.intellij.openapi.ui.TextFieldWithBrowseButton.setText(TextFieldWithBrowseButton.java:104)
      at com.poratu.idea.plugins.tomcat.conf.TomcatSettingsEditor.resetEditorFrom(TomcatSettingsEditor.java:65)
      at com.poratu.idea.plugins.tomcat.conf.TomcatSettingsEditor.resetEditorFrom(TomcatSettingsEditor.java:37)
      at com.intellij.openapi.options.SettingsEditor.lambda$resetFrom$0(SettingsEditor.java:73)
      at com.intellij.openapi.options.SettingsEditor.bulkUpdate(SettingsEditor.java:80)
      at com.intellij.openapi.options.SettingsEditor.resetFrom(SettingsEditor.java:73)
      at com.intellij.execution.impl.ConfigurationSettingsEditor$ConfigToSettingsWrapper.resetEditorFrom(ConfigurationSettingsEditor.java:292)
      at com.intellij.execution.impl.ConfigurationSettingsEditor$ConfigToSettingsWrapper.resetEditorFrom(ConfigurationSettingsEditor.java:276)
      at com.intellij.openapi.options.CompositeSettingsEditor.resetEditorFrom(CompositeSettingsEditor.java:52)
      at com.intellij.execution.impl.ConfigurationSettingsEditorWrapper.resetEditorFrom(ConfigurationSettingsEditorWrapper.java:98)
      at com.intellij.execution.impl.ConfigurationSettingsEditorWrapper.resetEditorFrom(ConfigurationSettingsEditorWrapper.java:25)
      at com.intellij.openapi.options.SettingsEditor.lambda$resetFrom$0(SettingsEditor.java:73)
      at com.intellij.openapi.options.SettingsEditor.bulkUpdate(SettingsEditor.java:80)
      at com.intellij.openapi.options.SettingsEditor.resetFrom(SettingsEditor.java:73)
      at com.intellij.openapi.options.SettingsEditorConfigurable.reset(SettingsEditorConfigurable.java:41)
      at com.intellij.execution.impl.SingleConfigurationConfigurable.reset(SingleConfigurationConfigurable.java:131)
      at com.intellij.execution.impl.SingleConfigurationConfigurable.editSettings(SingleConfigurationConfigurable.java:94)
      at com.intellij.execution.impl.RunConfigurable.getSafeUserObject(RunConfigurable.kt:352)
      at com.intellij.execution.impl.RunConfigurable.access$getSafeUserObject(RunConfigurable.kt:73)
      at com.intellij.execution.impl.RunConfigurable$initTree$3.valueChanged(RunConfigurable.kt:239)
      at javax.swing.JTree.fireValueChanged(JTree.java:2927)
      at javax.swing.JTree$TreeSelectionRedirector.valueChanged(JTree.java:3391)
      at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(DefaultTreeSelectionModel.java:635)
      at com.intellij.ui.treeStructure.Tree$MySelectionModel.fireValueChanged(Tree.java:650)
      at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(DefaultTreeSelectionModel.java:1093)
      at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(DefaultTreeSelectionModel.java:294)
      at javax.swing.JTree.setSelectionPaths(JTree.java:1647)
      at javax.swing.JTree.setSelectionRows(JTree.java:1729)
      at javax.swing.JTree.setSelectionRow(JTree.java:1704)
      at com.intellij.util.ui.tree.TreeUtil.lambda$showAndSelect$10(TreeUtil.java:565)
      at com.intellij.util.ui.tree.TreeUtil.showAndSelect(TreeUtil.java:600)
      at com.intellij.util.ui.tree.TreeUtil.showRowCentered(TreeUtil.java:510)
      at com.intellij.util.ui.tree.TreeUtil.showRowCentered(TreeUtil.java:501)
      at com.intellij.util.ui.tree.TreeUtil.showRowCentred(TreeUtil.java:496)
      at com.intellij.util.ui.tree.TreeUtil.selectPath(TreeUtil.java:427)
      at com.intellij.util.ui.tree.TreeUtil.selectInTree(TreeUtil.java:909)
      at com.intellij.util.ui.tree.TreeUtil.selectInTree(TreeUtil.java:897)
      at com.intellij.execution.impl.RunConfigurable.selectConfiguration(RunConfigurable.kt:307)
      at com.intellij.execution.impl.RunConfigurable.access$selectConfiguration(RunConfigurable.kt:73)
      at com.intellij.execution.impl.RunConfigurable$selectConfigurableOnShow$1.run(RunConfigurable.kt:283)
      at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
      at java.awt.EventQueue.access$500(EventQueue.java:98)
      at java.awt.EventQueue$3.run(EventQueue.java:715)
      at java.awt.EventQueue$3.run(EventQueue.java:709)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
      at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719)
      at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:668)
      at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
      at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
      at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
      at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
      at java.awt.Dialog.show(Dialog.java:1077)
      at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl$MyDialog.show(DialogWrapperPeerImpl.java:698)
      at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:430)
      at com.intellij.openapi.ui.DialogWrapper.invokeShow(DialogWrapper.java:1681)
      at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1630)
      at com.intellij.execution.actions.EditRunConfigurationsAction.actionPerformed(EditRunConfigurationsAction.java:48)
      at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:258)
      at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:275)
      at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.lambda$actionPerformed$0(ActionMenuItem.java:287)
      at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:283)
      at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:106)
      at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:277)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
      at com.intellij.openapi.actionSystem.impl.ActionMenuItem.lambda$fireActionPerformed$0(ActionMenuItem.java:111)
      at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:88)
      at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:111)
      at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:120)
      at com.intellij.openapi.application.TransactionGuard.submitTransaction(TransactionGuard.java:122)
      at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:111)
      at com.intellij.ui.plaf.beg.BegMenuItemUI.doClick(BegMenuItemUI.java:522)
      at com.intellij.ui.plaf.beg.BegMenuItemUI.access$300(BegMenuItemUI.java:35)
      at com.intellij.ui.plaf.beg.BegMenuItemUI$MyMouseInputHandler.mouseReleased(BegMenuItemUI.java:544)
      at java.awt.Component.processMouseEvent(Component.java:6548)
      at javax.swing.JComponent.processMouseEvent(JComponent.java:3325)
      at java.awt.Component.processEvent(Component.java:6313)
      at java.awt.Container.processEvent(Container.java:2237)
      at java.awt.Component.dispatchEventImpl(Component.java:4903)
      at java.awt.Container.dispatchEventImpl(Container.java:2295)
      at java.awt.Component.dispatchEvent(Component.java:4725)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
      at java.awt.Container.dispatchEventImpl(Container.java:2281)
      at java.awt.Window.dispatchEventImpl(Window.java:2746)
      at java.awt.Component.dispatchEvent(Component.java:4725)
      at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
      at java.awt.EventQueue.access$500(EventQueue.java:98)
      at java.awt.EventQueue$3.run(EventQueue.java:715)
      at java.awt.EventQueue$3.run(EventQueue.java:709)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
      at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
      at java.awt.EventQueue$4.run(EventQueue.java:737)
      at java.awt.EventQueue$4.run(EventQueue.java:735)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
      at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:719)
      at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:664)
      at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:363)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
  </code></pre>