How do I debug a plugin in PyCharm (or RubyMine, WebStorm, etc)? Follow
Hello,
I've been building and debugging a plugin in IntelliJ Commnity Edition and Intellij Ultimate edition and have run into an issue specifically in PyCharms. My plugin doesn't work in PyCharms and I have no idea why. When I tried to change my plugin project's SDK to point to the PyCharms Community Edition and go into debug mode, it died with a NullPointer exception (which I will report on YouTrack when it is back up).
Is there some recommended way to test plugins in non-community edition IntelliJ? I am thinking of just maybe writing log statements to a text file or something...
The exception I get when I try to debug my plugin on PyCharms is:
com.intellij.ide.plugins.PluginManager$StartupAbortedException: java.lang.reflect.InvocationTargetException
at com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:88)
at java.lang.Thread.run(Thread.java:695)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.ide.plugins.PluginManager$2.run(PluginManager.java:85)
... 1 more
Caused by: java.lang.NullPointerException
at com.intellij.openapi.application.impl.ApplicationInfoImpl.getFullApplicationName(ApplicationInfoImpl.java:390)
at com.intellij.idea.IdeaLogger$1.getInfo(IdeaLogger.java:202)
at com.intellij.idea.IdeaLogger.logErrorHeader(IdeaLogger.java:146)
at com.intellij.idea.IdeaLogger.error(IdeaLogger.java:142)
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:107)
at com.intellij.openapi.application.impl.ApplicationInfoImpl.getShadowInstance(ApplicationInfoImpl.java:441)
at com.intellij.idea.StartupUtil.startLogging(StartupUtil.java:275)
at com.intellij.idea.StartupUtil.prepareAndStart(StartupUtil.java:105)
at com.intellij.idea.MainImpl.start(MainImpl.java:34)
Please sign in to leave a comment.
" My plugin doesn't work in PyCharm" = ??
Right, I don't know why my Plugin doesn't work in PyCharm, I'm trying to figure out why. The plugin is complicated and basic features do not work. There are no exceptions. I am not asking about why my plugin doesn't work. I am asking how I can debug my plugin using PyCharm. My plugin works fine in IntelliJ and RubyMine and WebStorm.
Did you follow rules from here http://confluence.jetbrains.com/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products
Yes, I absolutely followed the rules there. The plugin compiles when following these instructions:
It's when I try to launch the debugger that I get an exception in IntelliJ IDEA (Ultimate 13).
Now I'm actually getting a different exception when I try to debug:
com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing 'com.intellij.openapi.fileTypes.FileTypeManager'
java.lang.RuntimeException: com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing 'com.intellij.openapi.fileTypes.FileTypeManager'
com.intellij.openapi should be available to PyCharm right?
Thanks again for your help.
Here is my source code: https://github.com/btipling/DiskRead
Here is how I've setup my SDK:
http://glui.me/?i=6pjmwa71c2bopca/2014-02-04_at_8.17_AM_2x.png/
http://glui.me/?i=mj7szt4is1u7d49/2014-02-04_at_8.17_AM_2x_(1).png/
http://glui.me/?i=wjgr8zxsk017l2j/2014-02-04_at_8.17_AM_2x_(2).png/
http://glui.me/?i=5cna0imut50jsf7/2014-02-04_at_8.18_AM_2x.png/
These are the exceptions I've seen:
[ 66873] ERROR - llij.ide.plugins.PluginManager - com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing 'com.intellij.openapi.fileTypes.FileTypeManager'
java.lang.RuntimeException: com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing 'com.intellij.openapi.fileTypes.FileTypeManager'
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:258)
at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:57)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)
at com.intellij.ide.IdeEventQueue.e(IdeEventQueue.java:696)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:524)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:335)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing 'com.intellij.openapi.fileTypes.FileTypeManager'
at com.intellij.ide.plugins.PluginManager.handleComponentError(PluginManager.java:215)
at com.intellij.openapi.application.impl.ApplicationImpl.handleInitComponentError(ApplicationImpl.java:366)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:570)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:590)
at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:226)
at com.intellij.util.pico.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:213)
at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:200)
at org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer.getComponentInstance(AbstractDelegatingMutablePicoContainer.java:75)
at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponent(ComponentManagerImpl.java:121)
at com.intellij.openapi.application.impl.ApplicationImpl.createComponent(ApplicationImpl.java:386)
at com.intellij.openapi.components.impl.ComponentManagerImpl.a(ComponentManagerImpl.java:112)
at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:89)
at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:87)
at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:525)
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:250)
... 18 more
Caused by: org.picocontainer.defaults.UnsatisfiableDependenciesException: com.intellij.persistence.database.DbFileTypeFactory has unsatisfied dependency: class com.intellij.ultimate.UltimateVerifier among unsatisfiable dependencies: [[class com.intellij.ultimate.UltimateVerifier]] where AreaPicoContainer[null] was the leaf container being asked for dependencies.
at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getGreediestSatisfiableConstructor(ConstructorInjectionComponentAdapter.java:191)
at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:210)
at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53)
at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248)
at org.picocontainer.defaults.DecoratingComponentAdapter.getComponentInstance(DecoratingComponentAdapter.java:60)
at org.picocontainer.defaults.CachingComponentAdapter.getComponentInstance(CachingComponentAdapter.java:58)
at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getComponentInstance(ExtensionComponentAdapter.java:74)
at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getExtension(ExtensionComponentAdapter.java:111)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapters(ExtensionPointImpl.java:241)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.getExtensions(ExtensionPointImpl.java:185)
at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:111)
at com.intellij.openapi.extensions.Extensions.getExtensions(Extensions.java:98)
at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.a(FileTypeManagerImpl.java:153)
at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.initComponent(FileTypeManagerImpl.java:284)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:548)
... 30 more
[ 66876] ERROR - llij.ide.plugins.PluginManager - PyCharm Community Edition 3.0.2 Build #131.SNAPSHOT
[ 66876] ERROR - llij.ide.plugins.PluginManager - JDK: 1.6.0_65
[ 66876] ERROR - llij.ide.plugins.PluginManager - VM: Java HotSpot(TM) 64-Bit Server VM
[ 66876] ERROR - llij.ide.plugins.PluginManager - Vendor: Apple Inc.
[ 66876] ERROR - llij.ide.plugins.PluginManager - OS: Mac OS X
[ 66876] ERROR - llij.ide.plugins.PluginManager - Last Action:
Please check your PyCharm SDK classpath for anything named "database" or "persistence" or anything else pointing to plugins/API only available in IntelliJ IDEA Ultimate Edition and remove all these entries.
Thanks again for your help, I don't have anything like that. Here's my entire classpath contents:
Please remove anything from PyCharm.app/plugins/*
Thanks for your help again. I removed all PyCharm class paths referencing "plugin" and ran into some more bad dependencies at runtime. I will just have to go through the jars and remove them one at a time to see which ones contain things I don't need and remove them.
Thanks again.