Skip to content
This repository has been archived by the owner on Dec 20, 2017. It is now read-only.

NPE when accessing settings #64

Closed
tonio-ramirez opened this issue Oct 29, 2012 · 22 comments
Closed

NPE when accessing settings #64

tonio-ramirez opened this issue Oct 29, 2012 · 22 comments
Assignees
Labels
Milestone

Comments

@tonio-ramirez
Copy link

I'm getting a Null Pointer Exception when accessing the Settings page on a fresh install:

java.lang.NullPointerException
    at net.nicoulaj.idea.markdown.settings.MarkdownGlobalSettingsConfigurable.reset(Unknown Source)
    at net.nicoulaj.idea.markdown.settings.MarkdownGlobalSettingsConfigurable.createComponent(Unknown Source)
    at com.intellij.openapi.options.newEditor.OptionsEditor$Simple.<init>(OptionsEditor.java:1257)
    at com.intellij.openapi.options.newEditor.OptionsEditor.b(OptionsEditor.java:439)
    at com.intellij.openapi.options.newEditor.OptionsEditor.access$2500(OptionsEditor.java:67)
    at com.intellij.openapi.options.newEditor.OptionsEditor$8$1$1.run(OptionsEditor.java:414)
    at com.intellij.openapi.application.impl.ApplicationImpl.runEdtSafeAction(ApplicationImpl.java:1004)
    at com.intellij.openapi.options.newEditor.OptionsEditor$8$1.run(OptionsEditor.java:408)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:864)
    at com.intellij.openapi.options.newEditor.OptionsEditor$8.run(OptionsEditor.java:406)
    at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:434)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:680)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:145)

I cloned and built straight from GitHub, latest commit is de2e8c6.

To be clear:

$ git clone git://github.com/nicoulaj/idea-markdown.git
$ cd idea-markdown
$ ant

<install generated idea-markdown.zip in IDEA>
<Open Settings, navigate to Markdown>
<NPE>

Edit: forgot to add, this is with latest IDEA (11.1.4) build, IU-117-963, on Mac OSX 10.8.2.

@FDiskas
Copy link

FDiskas commented Oct 31, 2012

The problem exists On windows too
v5.0.2
PS-121.322

@baxang
Copy link

baxang commented Oct 31, 2012

I have the same issue here on OSX 10.8.2 & PhpStorm 5.0.3 Build 121.351 and I don't have the preview tab after reboot the IDE. I installed the plugin through Preferences panel.

@tonio-ramirez
Copy link
Author

The nullchecks got rid of the NPE, but now I'm getting a blank panel instead of the actual settings. (Well, not entirely blank... it has a "Reset" link/button at the top-right, and it says "Select configuration element in the tree to edit its settings". I haven't working with IDEA plugin development, nor with IDEA's gui design tool, but it seems the panel isn't being initialized, just instantiated.)

@hanswesterbeek
Copy link

Same here, after just having installed the plugin on Mac/IntelliJ Ultimate 11.1.4. What I get is a "Loading..." spinner, so the preference screen never opens

null
java.lang.NullPointerException
at net.nicoulaj.idea.markdown.settings.MarkdownGlobalSettingsConfigurable.reset(Unknown Source)
at net.nicoulaj.idea.markdown.settings.MarkdownGlobalSettingsConfigurable.createComponent(Unknown Source)
at com.intellij.openapi.options.newEditor.OptionsEditor$Simple.(OptionsEditor.java:1257)
at com.intellij.openapi.options.newEditor.OptionsEditor.b(OptionsEditor.java:439)
at com.intellij.openapi.options.newEditor.OptionsEditor.access$2500(OptionsEditor.java:67)
at com.intellij.openapi.options.newEditor.OptionsEditor$8$1$1.run(OptionsEditor.java:414)
at com.intellij.openapi.application.impl.ApplicationImpl.runEdtSafeAction(ApplicationImpl.java:1004)
at com.intellij.openapi.options.newEditor.OptionsEditor$8$1.run(OptionsEditor.java:408)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:864)
at com.intellij.openapi.options.newEditor.OptionsEditor$8.run(OptionsEditor.java:406)
at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:434)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:145)

@AubreyHewes
Copy link

After installing the latest revision f118c13. The NPE / neverending spinner problem is solved. Though now the settings are not displayed. What is displayed is the standard intellij text "Select configuration element in the tree to edit its settings".

This seems only to happen on a clean install of both the ide and the plugin. On an updated ide install (containing previous settings?) the settings form is displayed and is editable.

Affected (for me) IntelliJ IDE implementation:

  • PhpStorm version 5.0.2 - 5.0.4

@tsundberg
Copy link

Just uninstalled the plugin since it still produces the NPE mentioned above.

Idea Community Edition 11.1.4
Build #IC - 117.963
Mac OSx 10.7.5

@larvanitis
Copy link

@AubreyKingsquare can you upload the settings file from your config dir until this bug is fixed, please?

@davemerrill
Copy link

Same NPE using 0.8.2 with IDEA EAP 122.746 on Windows 7.

@aadrian
Copy link

aadrian commented Nov 19, 2012

Same stacktrace when accessing Settings using IDEA EAP 122.813 with Windows XP.

@petsagouris
Copy link

Stacktrace for spinner on Windows 7 iwth PHPStorm 5.0.4

java.lang.NullPointerException
    at net.nicoulaj.idea.markdown.settings.MarkdownGlobalSettingsConfigurable.reset(Unknown Source)
    at net.nicoulaj.idea.markdown.settings.MarkdownGlobalSettingsConfigurable.createComponent(Unknown Source)
    at com.intellij.openapi.options.newEditor.OptionsEditor$Simple.(OptionsEditor.java:1263)
    at com.intellij.openapi.options.newEditor.OptionsEditor.b(OptionsEditor.java:449)
    at com.intellij.openapi.options.newEditor.OptionsEditor.access$2500(OptionsEditor.java:67)
    at com.intellij.openapi.options.newEditor.OptionsEditor$8$1$1.run(OptionsEditor.java:424)
    at com.intellij.openapi.application.impl.ApplicationImpl.runEdtSafeAction(ApplicationImpl.java:1066)
    at com.intellij.openapi.options.newEditor.OptionsEditor$8$1.run(OptionsEditor.java:418)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:918)
    at com.intellij.openapi.options.newEditor.OptionsEditor$8.run(OptionsEditor.java:416)
    at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:457)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:662)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:148)

Which is the same as everyone else's (only some line numbers are nudged)

@davemerrill
Copy link

First off, thanks for doing this, it'd be really great to have.

But, sorry if I'm being thick, how does this plugin work? I assume it's supposed to display .md documents as they'd appear in an environment that interprets Markdown, and maybe have error checking and formatting tools and/or docs.

I don't see any of this in 0.8.2. Does any of this work for anyone?

I get the same crash as everyone else accessing the plugin's settings. Is there something that you have to do in there to enable it. Is it not working because it's not currently possible to do that? That seems unlikely, since I'd expect it to work as shipped, with settings just customizing how it behaves.

Stumped here.

Thanks again,
Dave Merrill

@isochronous
Copy link

The problem is that the settings are never being initialized, at all. The first time the plugin runs, it's supposed to (I'm guessing here both from looking at the code and looking at the code I'd expect to be here that's not) do some initialization based on both the form definition and the panel class definition.

If I had to take a guess at the problem, it's the fact that there ARE no defaults defined anywhere in the code. The author added the null reference check for the UI elements in the settings page, but that doesn't answer the question of WHY those UI elements are null, and it doesn't do anything to correct the situation (like setting defaults, for example).

I haven't really taken a close look at the .form file that defines the settings page, so it's possible there are some defaults declared in there, but it doesn't look like the binding between the data representation and the GUI element is happening.

@isochronous
Copy link

Man, I'd love to do whatever I can to help get this plugin up and running again. I use markdown a LOT these days and this plugin looks amazing - Sublime Text 2 is pretty good for markdown editing with the right packages installed, but it's not quite as nice as this would be, were it working.

if you need log files, different setups tested, anything, just let us know - I'm sure I'm not the only one eager to help this get back into a working state.

@davemerrill
Copy link

Not sure what'll happen, since this is a third-party plugin, but I filed an issue in the IDEA bug tracker, asking if they could maybe step in somehow, since this problem appears to be stuck. Please vote for it and/or comment, here: http://youtrack.jetbrains.com/issue/IDEA-95843

@nicoulaj
Copy link
Owner

Please don't... I just don't have time to work on this right now, please be patient or submit a pull request. You can always downgrade to a previous version if you need to.

@davemerrill
Copy link

Hi, didn't mean to harass or criticize you, and very much appreciate the work you've done on this, just trying to help, though I don't think Iv'e got the java or IDEA plugin background to actually help. Sometimes JetBrains can lend a hand, especially if it broke because of changes they made. Are you saying that an earlier version of the plugin should work with recent IDEA, even the Leda EAP? I assumed (just a guess though) that recent changes in IDEA were the cause. Not so? And again, thanks!

@bedeabza
Copy link

Happening in PHPStorm 6 EAP (build 124.237) as well when trying to access markdown settings in the settings window:

null
java.lang.NullPointerException
    at net.nicoulaj.idea.markdown.settings.MarkdownGlobalSettingsConfigurable.reset(Unknown Source)
    at net.nicoulaj.idea.markdown.settings.MarkdownGlobalSettingsConfigurable.createComponent(Unknown Source)
    at com.intellij.openapi.options.newEditor.OptionsEditor$Simple.<init>(OptionsEditor.java:1260)
    at com.intellij.openapi.options.newEditor.OptionsEditor.b(OptionsEditor.java:445)
    at com.intellij.openapi.options.newEditor.OptionsEditor.access$2500(OptionsEditor.java:68)
    at com.intellij.openapi.options.newEditor.OptionsEditor$8$1$1.run(OptionsEditor.java:414)
    at com.intellij.openapi.application.impl.ApplicationImpl.runEdtSafeAction(ApplicationImpl.java:1103)
    at com.intellij.openapi.options.newEditor.OptionsEditor$8$1.run(OptionsEditor.java:408)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:935)
    at com.intellij.openapi.options.newEditor.OptionsEditor$8.run(OptionsEditor.java:406)
    at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:465)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:153)

Maybe this helps

@nicoulaj
Copy link
Owner

I just can't reproduce this on IntelliJ 12.0.1 with my previous fix, so I released it as 0.8.3.

Pretty sure it was a bug in the EAP itself => reopen if you see it occur again in IntelliJ 12.0.1+ and idea-markdown 0.8.3+.

@tonio-ramirez
Copy link
Author

I just built 0.8.3 and installed it on IntelliJ IDEA 12.0.1 and am still seeing an empty settings pane.
markdown-settings

@FDiskas
Copy link

FDiskas commented Dec 22, 2012

Fresh install on Development version off phpStorm PS-124.295
By opening settings the error appear.

java.lang.NullPointerException
    at net.nicoulaj.idea.markdown.settings.MarkdownGlobalSettingsConfigurable.reset(Unknown Source)
    at net.nicoulaj.idea.markdown.settings.MarkdownGlobalSettingsConfigurable.createComponent(Unknown Source)
    at com.intellij.openapi.options.newEditor.OptionsEditor$Simple.<init>(OptionsEditor.java:1260)
    at com.intellij.openapi.options.newEditor.OptionsEditor.b(OptionsEditor.java:445)
    at com.intellij.openapi.options.newEditor.OptionsEditor.access$2500(OptionsEditor.java:68)
    at com.intellij.openapi.options.newEditor.OptionsEditor$8$1$1.run(OptionsEditor.java:414)
    at com.intellij.openapi.application.impl.ApplicationImpl.runEdtSafeAction(ApplicationImpl.java:1103)
    at com.intellij.openapi.options.newEditor.OptionsEditor$8$1.run(OptionsEditor.java:408)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:935)
    at com.intellij.openapi.options.newEditor.OptionsEditor$8.run(OptionsEditor.java:406)
    at com.intellij.openapi.application.impl.ApplicationImpl$6.run(ApplicationImpl.java:465)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:153)

@michaelahlers
Copy link

Having this problem with the release in the JetBrains repository.

@nicoulaj
Copy link
Owner

This was due to Ant build not using IDEA's custom Java compiler. It should be fixed now, pushing out release 0.8.3. Those who don't want to wait for the release to be published in Jetbrains repositories can grab it here.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests