overstory / marklogic-intellij-plugin

Plugin to support XQuery + MarkLogic debugging in Intellij Idea
Apache License 2.0
12 stars 2 forks source link

Debugger throws exception: "Cannot get property 'text' on null object" #55

Open lukasz1234567890 opened 6 years ago

lukasz1234567890 commented 6 years ago

Configured the plugin and MarkLogic to run queries however debugger throws exception:

Thread-0(error): 14:33:34.030  Unexpected exception, stopping: java.lang.NullPointerException: Cannot get property 'text' on null object
Thread-0(error): 14:33:34.032  Exception running debugger: java.lang.NullPointerException: Cannot get property 'text' on null object
java.lang.NullPointerException: Cannot get property 'text' on null object
    at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60)
    at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:174)
    at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:47)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
    at org.intellij.xquery.runner.rt.debugger.marklogic.MarkLogicDebugConnector.resourceFileText(MarkLogicDebugConnector.groovy:553)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite$StaticMetaMethodSiteNoUnwrap.invoke(StaticMetaMethodSite.java:133)
    at org.codehaus.groovy.runtime.callsite.StaticMetaMethodSite.callStatic(StaticMetaMethodSite.java:102)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callStatic(AbstractCallSite.java:214)
    at org.intellij.xquery.runner.rt.debugger.marklogic.MarkLogicDebugConnector.xfile(MarkLogicDebugConnector.groovy:547)
    at org.intellij.xquery.runner.rt.debugger.marklogic.MarkLogicDebugConnector.getCapturedAppserverId(MarkLogicDebugConnector.groovy:157)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
    at org.codehaus.groovy.runtime.metaclass.MethodMetaProperty$GetBeanMethodMetaProperty.getProperty(MethodMetaProperty.java:76)
    at org.codehaus.groovy.runtime.callsite.GetEffectivePogoPropertySite.callGroovyObjectGetProperty(GetEffectivePogoPropertySite.java:68)
    at org.intellij.xquery.runner.rt.debugger.marklogic.MarkLogicDebugConnector.clearStoppedRequests(MarkLogicDebugConnector.groovy:222)
    at org.intellij.xquery.runner.rt.debugger.marklogic.MarkLogicDebuggerApp.runDebuggerApp(MarkLogicDebuggerApp.java:449)
    at org.intellij.xquery.runner.rt.debugger.marklogic.MarkLogicDebuggerApp.access$300(MarkLogicDebuggerApp.java:43)
    at org.intellij.xquery.runner.rt.debugger.marklogic.MarkLogicDebuggerApp$1.run(MarkLogicDebuggerApp.java:471)
    at java.lang.Thread.run(Thread.java:745)
IntelliJ IDEA 2018.1.4 (Community Edition)
Build #IC-181.5087.20, built on May 17, 2018
JRE: 1.8.0_152-release-1136-b39 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
ronhitchens commented 6 years ago

Sorry to leave this so long without responding. This exception "can't happen". I indicates that the plugin was unable to read one of the XQuery files that are part of the debugger. These files are bundled into the jar file and should always be present. Are you using a copy of the plugin that you built yourself? Installing the plugin from the JetBrains repository (from within IntelliJ itself) works fine. It is possible to build the plugin from source but it's much preferable to install from inside IntelliJ. I'm closing this issue.

GoatyGuy commented 5 years ago

If this exception can't happen, why do i get this exception then? I did not change anything of the plugin. I selected it on the IntelliJ market, installed it, tried to run the debugger and boom...

dxmand commented 5 years ago

Hey Ron, I just started using this plugin and I'm having the exact same issue. I downloaded the plugin from the marketplace and I'm using IntelliJ Community 2019.1. Any ideas?

ronhitchens commented 5 years ago

I will look into it, but am extremely busy with my day job at the moment so it may be a while before I can get to it. Since the plugin was released, IntelliJ has had several more releases and each release seems to break compatibility in one way or another. There are some significant changes that have prevented me from building against the latest release of IntelliJ but until now the plugin has kept working. This bug is a bit odd because the NPE is happening on loading a file that's bundled into the plugin jar.

I do have a few fixes that I've already made that need to be built and pushed out, along with a few other bits that still need doing. There are also a handful of syntax fixes that need doing, but that requires cracking open the parser definitions which I've so far managed to avoid doing. I'm hopeful that will happen reasonably soon.

dxmand commented 5 years ago

Thanks for the response. Is there a specific version of IntelliJ that I should try?

ronhitchens commented 5 years ago

You'd have to go quite a way back. The earliest version that the plugin will accept is 173.3727.127, but that's pretty old now. I don't know what public version number that maps to, but you may not be able to find it anyway. You probably don't want to give up the newer features. I will do my best to get a new release out as soon as I can.

dxmand commented 5 years ago

Sounds good. We've started using MarkLogic and this plugin looks like a great tool to help us with our XQuery development and troubleshooting.

ronhitchens commented 4 years ago

In version 1.1 of the plugin, I added a few checks to avoid a null pointer exception. It is still inexplicable that the NPE occurred in the first place. I would be interested to know if you still experience this problem with 1.1. If so, any details about your runtime environment would be appreciated.