rhdunn / xquery-intellij-plugin

XQuery, XPath and XSLT Language Support for the IntelliJ IDE
https://rhdunn.github.io/xquery-intellij-plugin/
Apache License 2.0
25 stars 9 forks source link

java.lang.ExceptionInInitializerError - BaseX 9.7.3 #157

Open CanOfBees opened 2 years ago

CanOfBees commented 2 years ago

Hi -

I'm getting the following error when I try to add or edit either a standalone or server instance of BaseX v9.7.3: java.lang.ExceptionInInitializerError. This error displays in the "Edit Query Processor Instance" window.

I'm also seeing an "IDE Internal Error" report:

uk.co.reecedunn.intellij.plugin.processor.query.HostConnectionException: Connection error.
    at uk.co.reecedunn.intellij.plugin.basex.query.session.binding.ClientSession.<init>(ClientSession.kt:38)
    at uk.co.reecedunn.intellij.plugin.basex.query.session.BaseX.connect(BaseX.kt:44)
    at uk.co.reecedunn.intellij.plugin.processor.query.QueryProcessorSettings.getSession(QueryProcessorSettings.kt:90)
    at uk.co.reecedunn.intellij.plugin.processor.query.execution.ui.QueryProcessorComboBox$servers$1.invoke(QueryProcessorComboBox.kt:148)
    at uk.co.reecedunn.intellij.plugin.processor.query.execution.ui.QueryProcessorComboBox$servers$1.invoke(QueryProcessorComboBox.kt:147)
    at uk.co.reecedunn.intellij.plugin.core.async.ApplicationKt.executeOnPooledThread$lambda-0(Application.kt:23)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:295)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:668)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:665)
    at java.base/java.security.AccessController.doPrivileged(Native Method)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:665)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
    at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
    at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:412)
    at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:255)
    at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:237)
    at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.base/java.net.Socket.connect(Socket.java:609)
    at org.basex.api.client.ClientSession.<init>(ClientSession.java:96)
    at org.basex.api.client.ClientSession.<init>(ClientSession.java:76)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at uk.co.reecedunn.intellij.plugin.basex.query.session.binding.ClientSession.<init>(ClientSession.kt:35)
    ... 15 more

Other details: IntelliJ IDEA 2022.1.3 (Ultimate Edition) Build #IU-221.5921.22, built on June 21, 2022 uk.co.reecedunn.intellij.plugin.xquery (1.9.3-221) Kotlin: 221-1.7.10-release-333-IJ5591.52

Let me know if I can provide any other details to help debug or give better context. Thanks for your time!

CanOfBees commented 2 years ago

An observation - I've been using OpenJDK 11 as the main JVM on my different computers, and I do not get this error when I switch from 11 to 8 in the IDEA Project Structure > Project Settings > Project > SDK dropdown. I don't have all of the different versions of 11 that I'm using handy, but I'll see about pulling together a list of versions.

Thanks!

CanOfBees commented 2 years ago

So, this seems to happen with both OpenJDKs (8, and 11) set in the IDEA Project Structure > Project Settings > Project > SDK dropdown.

The one exception I've noticed is that, having a pre-existing 'Standalone' instance seems to work, in that you can update the 'JAR file: $path' in the Edit Query Processor Instance dialog window. It will still throw java.lang.ExceptionInInitializerError, but works fine after the fact.

CanOfBees commented 2 years ago

@rhdunn - apologies for what may amount to noise on this issue: I just updated IntelliJ (to 2022.2) and BaseX (to the latest build (10.1 beta, 2022-08-15)) and this doesn't seem to be an issue unless I try to create a new Run configuration with a BaseX version 9.7.2 or 9.7.3 (e.g. 9.7.1 works appropriately).

I had thought about asking on the BaseX mailing list if something had changed in the startup behavior for the BaseX.jar, but I couldn't come up with what felt like a well-phrased question. If you think that might be part of the problem, I'm happy to start a conversation there.

As far as this issue goes: I don't know if this is completely resolved, but it looks as though using the latest versions of IDEA, BaseX, and the plugin addresses the problem. (I.e., "works on my machines!" or something)

Thanks for your efforts!