derkork/intellij-leiningen-plugin — Issue #7: NPE when creating a new project.clj file
Author: rherrick
Created: 2011-12-12 16:58:45+00:00
State: open

I got the following error when creating a new project.clj file in IntelliJ 11, build 111.69. I just right-click, create the new file, name it project.clj, and get the error below. The file is created successfully. Once I've added some code to the file, I can add the project to the Leiningen window and run the various targets, so that all seems fine.

Let me know if you need any more info on this issue.

```
null
java.lang.NullPointerException
at clojure.core$name__4748.invoke(core.clj:1053)
at de.janthomae.leiningenplugin.leiningen.LeiningenProjectFile$_getName__91.invoke(LeiningenProjectFile.clj:57)
at de.janthomae.leiningenplugin.leiningen.LeiningenProjectFile.getName(Unknown Source)
at de.janthomae.leiningenplugin.project.LeiningenProject.refreshDataFromFile(LeiningenProject.java:86)
at de.janthomae.leiningenplugin.project.LeiningenProject.reimport(LeiningenProject.java:128)
at de.janthomae.leiningenplugin.project.LeiningenProjectsManager.importLeiningenProject(LeiningenProjectsManager.java:75)
at de.janthomae.leiningenplugin.project.LeiningenProjectsManagerWatcher$1.after(LeiningenProjectsManagerWatcher.java:67)
at sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:110)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:220)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:226)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:212)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:209)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:200)
at com.intellij.util.messages.impl.MessageBusImpl.access$000(MessageBusImpl.java:42)
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:128)
at $Proxy79.beforePsiChanged(Unknown Source)
at com.intellij.psi.impl.PsiManagerImpl.beforeChange(PsiManagerImpl.java:518)
at com.intellij.psi.impl.PsiManagerImpl.beforeChildAddition(PsiManagerImpl.java:244)
at com.intellij.psi.impl.file.impl.PsiVFSListener$2.run(PsiVFSListener.java:112)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:874)
at com.intellij.psi.impl.file.impl.PsiVFSListener.fileCreated(PsiVFSListener.java:99)
at com.intellij.openapi.vfs.impl.BulkVirtualFileListenerAdapter.a(BulkVirtualFileListenerAdapter.java:65)
at com.intellij.openapi.vfs.impl.BulkVirtualFileListenerAdapter.after(BulkVirtualFileListenerAdapter.java:45)
at sun.reflect.GeneratedMethodAccessor61.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.util.messages.impl.MessageBusConnectionImpl.deliverMessage(MessageBusConnectionImpl.java:110)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:220)
at com.intellij.util.messages.impl.MessageBusImpl.doPumpMessages(MessageBusImpl.java:226)
at com.intellij.util.messages.impl.MessageBusImpl.pumpMessages(MessageBusImpl.java:212)
at com.intellij.util.messages.impl.MessageBusImpl.sendMessage(MessageBusImpl.java:202)
at com.intellij.util.messages.impl.MessageBusImpl.access$000(MessageBusImpl.java:42)
at com.intellij.util.messages.impl.MessageBusImpl$2.invoke(MessageBusImpl.java:128)
at $Proxy15.after(Unknown Source)
at com.intellij.openapi.vfs.newvfs.persistent.PersistentFS.processEvents(PersistentFS.java:697)
at com.intellij.openapi.vfs.newvfs.persistent.PersistentFS.a(PersistentFS.java:638)
at com.intellij.openapi.vfs.newvfs.persistent.PersistentFS.createChildFile(PersistentFS.java:447)
at com.intellij.openapi.vfs.newvfs.impl.VirtualFileSystemEntry.createChildData(VirtualFileSystemEntry.java:283)
at com.intellij.psi.impl.file.PsiDirectoryImpl.add(PsiDirectoryImpl.java:450)
at com.intellij.psi.impl.file.PsiJavaDirectoryImpl.add(PsiJavaDirectoryImpl.java:64)
at org.jetbrains.plugins.clojure.actions.ClojureTemplatesFactory.createFromTemplate(ClojureTemplatesFactory.java:54)
at org.jetbrains.plugins.clojure.actions.NewClojureActionBase.createFileFromTemplate(NewClojureActionBase.java:114)
at org.jetbrains.plugins.clojure.actions.NewClojureFileAction.doCreate(NewClojureFileAction.java:45)
at org.jetbrains.plugins.clojure.actions.NewClojureActionBase.create(NewClojureActionBase.java:105)
at com.intellij.ide.actions.CreateElementActionBase$MyInputValidator.create(CreateElementActionBase.java:139)
at com.intellij.ide.actions.ElementCreator$1.run(ElementCreator.java:73)
at com.intellij.openapi.application.RunResult.run(RunResult.java:37)
at com.intellij.openapi.command.WriteCommandAction$2$1.run(WriteCommandAction.java:122)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:874)
at com.intellij.openapi.command.WriteCommandAction$2.run(WriteCommandAction.java:120)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:112)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:88)
at com.intellij.openapi.command.WriteCommandAction.performWriteCommandAction(WriteCommandAction.java:118)
at com.intellij.openapi.command.WriteCommandAction.access$000(WriteCommandAction.java:34)
at com.intellij.openapi.command.WriteCommandAction$1.run(WriteCommandAction.java:73)
at com.intellij.openapi.command.WriteCommandAction.execute(WriteCommandAction.java:78)
at com.intellij.ide.actions.ElementCreator.tryCreate(ElementCreator.java:67)
at com.intellij.ide.actions.CreateElementActionBase$MyInputValidator.canClose(CreateElementActionBase.java:148)
at com.intellij.openapi.ui.Messages$InputDialog.doOKAction(Messages.java:1156)
at com.intellij.openapi.ui.DialogWrapper$OkAction.doAction(DialogWrapper.java:1478)
at com.intellij.openapi.ui.DialogWrapper$DialogWrapperAction.actionPerformed(DialogWrapper.java:1449)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
at javax.swing.plaf.basic.BasicRootPaneUI$Actions.actionPerformed(BasicRootPaneUI.java:191)
at javax.swing.SwingUtilities.notifyAction(SwingUtilities.java:1639)
at javax.swing.JComponent.processKeyBinding(JComponent.java:2851)
at javax.swing.KeyboardManager.fireBinding(KeyboardManager.java:267)
at javax.swing.KeyboardManager.fireKeyboardAction(KeyboardManager.java:216)
at javax.swing.JComponent.processKeyBindingsForAllComponents(JComponent.java:2928)
at javax.swing.JComponent.processKeyBindings(JComponent.java:2920)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2814)
at java.awt.Component.processEvent(Component.java:6065)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4651)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
at java.awt.Component.dispatchEventImpl(Component.java:4523)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:602)
at java.awt.EventQueue$1.run(EventQueue.java:600)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:616)
at java.awt.EventQueue$2.run(EventQueue.java:614)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:686)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:521)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:416)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:374)
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:684)
at com.intellij.openapi.ui.impl.DialogWrapperPeerImpl.show(DialogWrapperPeerImpl.java:410)
at com.intellij.openapi.ui.DialogWrapper.showAndGetOk(DialogWrapper.java:1323)
at com.intellij.openapi.ui.DialogWrapper.show(DialogWrapper.java:1308)
at com.intellij.openapi.ui.Messages.showInputDialog(Messages.java:557)
at org.jetbrains.plugins.clojure.actions.NewClojureActionBase.invokeDialog(NewClojureActionBase.java:44)
at com.intellij.ide.actions.CreateElementActionBase.actionPerformed(CreateElementActionBase.java:76)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter$1.run(ActionMenuItem.java:260)
at com.intellij.openapi.wm.impl.FocusManagerImpl.runOnOwnContext(FocusManagerImpl.java:850)
at com.intellij.openapi.wm.impl.IdeFocusManagerImpl.runOnOwnContext(IdeFocusManagerImpl.java:119)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem$ActionTransmitter.actionPerformed(ActionMenuItem.java:226)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at com.intellij.openapi.actionSystem.impl.ActionMenuItem.fireActionPerformed(ActionMenuItem.java:100)
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:6288)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6053)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4651)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4481)
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:4481)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:602)
at java.awt.EventQueue$1.run(EventQueue.java:600)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:616)
at java.awt.EventQueue$2.run(EventQueue.java:614)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:686)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:530)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:416)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:374)
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)
```