MPS loses connection with IDEA
MPS Build #219
I had gone part way thru the Hello World tutorial and accidentally killed IDEA. I restarted IDEA. When I continued with the tutorial and got to the following screen (Attachment 1)
I was unable to continue because the pop-up would not
show up for the "". Eventually I noticed in the MPS console window the errors below. I tried
shutting down MPS and IDEA, restarting IDEA and them MPS,
but the errors continued to be output to the MPS console.
ERROR - s.ide.command.CommandProcessor - Exception during executing command null
java.lang.RuntimeException: java.lang.ClassNotFoundException: TheSimplestLanguage.generator.baseLanguage.Queries
at jetbrains.mps.generator.ReflectionNativeClassProvider.registerClassifier(ReflectionNativeClassProvider.java:137)
at jetbrains.mps.generator.NativeClassProvider.getClassifier(NativeClassProvider.java:147)
at jetbrains.mps.baseLanguage.generator.target.ReflectionClassifierFinder.get(ReflectionClassifierFinder.java:24)
at jetbrains.mps.bootstrap.editorLanguage.editor.QueryMethodIdEditor.getQueriesClass(QueryMethodIdEditor.java:193)
at jetbrains.mps.bootstrap.editorLanguage.editor.QueryMethodIdEditor.getAvailableIdsUsingReflection(QueryMethodIdEditor.java:170)
at jetbrains.mps.bootstrap.editorLanguage.editor.QueryMethodIdEditor.createActions(QueryMethodIdEditor.java:115)
at jetbrains.mps.bootstrap.editorLanguage.editor.QueryMethodIdEditor$2.createActions(QueryMethodIdEditor.java:77)
at jetbrains.mps.nodeEditor.AbstractNodeSubstituteInfo.items(AbstractNodeSubstituteInfo.java:82)
at jetbrains.mps.nodeEditor.AbstractNodeSubstituteInfo.getMatchingItems(AbstractNodeSubstituteInfo.java:56)
at jetbrains.mps.nodeEditor.EditorUtil.validateCell(EditorUtil.java:76)
at jetbrains.mps.nodeEditor.EditorComponentKeyboardHandler.processKeyPressed(EditorComponentKeyboardHandler.java:162)
at jetbrains.mps.nodeEditor.AbstractEditorComponent$12.run(AbstractEditorComponent.java:1061)
at jetbrains.mps.ide.command.CommandProcessor.executeCommand_internal(CommandProcessor.java:77)
at jetbrains.mps.ide.command.CommandProcessor.executeCommand(CommandProcessor.java:62)
at jetbrains.mps.ide.command.CommandProcessor.executeCommand(CommandProcessor.java:51)
at jetbrains.mps.nodeEditor.AbstractEditorComponent.processKeyPressed(AbstractEditorComponent.java:1059)
at jetbrains.mps.nodeEditor.AbstractEditorComponent$6.keyPressed(AbstractEditorComponent.java:213)
at java.awt.Component.processKeyEvent(Component.java:5446)
at javax.swing.JComponent.processKeyEvent(JComponent.java:2680)
at java.awt.Component.processEvent(Component.java:5265)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1810)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:668)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:916)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:794)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:632)
at java.awt.Component.dispatchEventImpl(Component.java:3841)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Window.dispatchEventImpl(Window.java:1766)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Caused by: java.lang.ClassNotFoundException: TheSimplestLanguage.generator.baseLanguage.Queries
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.findSystemClass(ClassLoader.java:882)
at jetbrains.mps.reloading.MPSClassLoader.loadClass(MPSClassLoader.java:34)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at jetbrains.mps.generator.ReflectionNativeClassProvider.registerClassifier(ReflectionNativeClassProvider.java:32)
... 38 more
Please sign in to leave a comment.
I have tryed again today after having shutdown and rebooted my computer, and I am not able to get past this point
in the tutorial because of this error.
-- Doug
Hello, Doug,
Thank you for feedback.
Submitted as MPS-453
http://www.jetbrains.net/jira/browse/MPS-453
Is there any way to get MPS back working before this is fixed? A workaround? Maybe it's just that particular
part of the Tutorial that's broken?
Hello, Doug,
> Is there any way to get MPS back working before this is fixed? A
workaround? Maybe it's just that particular
> part of the Tutorial that's broken?
If you restart MPS and IDEA and start tutorial from scratch everything
should work right.
I found another solution. I noticed when I started MPS up, with the intention of deleting the TheSimplestLanguage project and starting over, that the TheSimplestLanguage showed "generation required", so I right clicked and regenerated the language and the problem is gone. I guess the problem was that MPS has lost it's "connection" to IDEA and didn't have the ability to restore it from the context of my problem report. I'm back in action.
Well I got a little farther, but then got a fatal error from IDEA:
No message
java.lang.NullPointerException
at com.intellij.psi.impl.PsiElementFactoryImpl.createImportStatement(PsiElementFactoryImpl.java:195)
at jetbrains.mps.plugin.MPSSupportHandler$16.run(MPSSupportHandler.java:370)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:109)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:20)
at jetbrains.mps.plugin.MPSSupportHandler$23$1.run(MPSSupportHandler.java:536)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:139)
at jetbrains.mps.plugin.MPSSupportHandler$23.run(MPSSupportHandler.java:534)
at com.intellij.openapi.application.impl.LaterInvocatorEx$1.run(LaterInvocatorEx.java:1)
at com.intellij.openapi.application.impl.LaterInvocatorEx$FlushQueue.run(LaterInvocatorEx.java:3)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:25)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:128)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:62)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
java.lang.NullPointerException
at com.intellij.psi.impl.PsiElementFactoryImpl.createImportStatement(PsiElementFactoryImpl.java:195)
at jetbrains.mps.plugin.MPSSupportHandler$16.run(MPSSupportHandler.java:370)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:109)
at com.intellij.openapi.command.impl.CommandProcessorImpl.executeCommand(CommandProcessorImpl.java:20)
at jetbrains.mps.plugin.MPSSupportHandler$23$1.run(MPSSupportHandler.java:536)
at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:139)
at jetbrains.mps.plugin.MPSSupportHandler$23.run(MPSSupportHandler.java:534)
at com.intellij.openapi.application.impl.LaterInvocatorEx$1.run(LaterInvocatorEx.java:1)
at com.intellij.openapi.application.impl.LaterInvocatorEx$FlushQueue.run(LaterInvocatorEx.java:3)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:25)
at com.intellij.ide.IdeEventQueue.a(IdeEventQueue.java:128)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:62)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
This happened just after I completed this step in the tutorial:
"Set the name of the new MappingConfiguration to HelloWorldGenerator. Add a mapping rule to the mapping rules list. MPS currently uses what are called 'query methods' to select which nodes of the model should be transformed. Query methods are currently written in Java, until such a time when they will be able to be written directly in MPS using a query language. Select 'New query method' in the 'for each' field of the mapping rule. Use 'AllTextConcepts' for the query method ID."
IDEA popped up with the "Queries" template and then boom!
-- Doug
Instead of exiting everything, I said "continue" to the fatal error and pasted the suggested code into the template but got a number of "red" errors from IDEA's syntax checker -- see attachment 1. I notice that the template is different than the one in the tutorial, missing a bunch of
imports. I tryed typing the missing imports in by hand, but it doesn't know what 'jetbrains' is...
I decided I was just getting deeper into the mess, so I should take your advise and start from scratch. I tryed to delete the TheSimplestLanguage, but could find nothing anywhere that allows the deletion of a project. So I guess I'll have to make a new project with a different name.
I just noticed when returning to work on my real project that part of the problem was that MPS had "inserted" its project into my real one (see attachment 1). I had started MPS up with IDEA already hosting my real project.
Guess MPS needs to work with an otherwise empty IDEA!