carymrobbins/intellij-haskforce

issue on IDE

Closed this issue · 17 comments

com.intellij.diagnostic.PluginException: com.intellij.compiler.server.CompileServerPlugin [Plugin: com.haskforce]
at com.intellij.serviceContainer.ComponentManagerImplKt.createPluginExceptionIfNeeded(ComponentManagerImpl.kt:956)
at com.intellij.serviceContainer.ComponentManagerImplKt.access$createPluginExceptionIfNeeded(ComponentManagerImpl.kt:1)
at com.intellij.serviceContainer.ComponentManagerImpl.createError(ComponentManagerImpl.kt:733)
at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.createInstance(ExtensionComponentAdapter.java:39)
at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.createInstance(XmlExtensionAdapter.java:69)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapter(ExtensionPointImpl.java:480)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapters(ExtensionPointImpl.java:421)
at com.intellij.openapi.extensions.impl.ExtensionPointImpl.getExtensions(ExtensionPointImpl.java:263)
at com.intellij.openapi.extensions.ExtensionPointName.getExtensions(ExtensionPointName.java:38)
at com.intellij.compiler.server.impl.BuildProcessClasspathManager.computeCompileServerPluginsClasspath(BuildProcessClasspathManager.java:62)
at com.intellij.compiler.server.impl.BuildProcessClasspathManager.getStaticClasspath(BuildProcessClasspathManager.java:54)
at com.intellij.compiler.server.impl.BuildProcessClasspathManager.getBuildProcessPluginsClasspath(BuildProcessClasspathManager.java:39)
at com.intellij.compiler.server.BuildManager.launchBuildProcess(BuildManager.java:1248)
at com.intellij.compiler.server.BuildManager.lambda$scheduleBuild$10(BuildManager.java:809)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:215)
at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:26)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.execute(BoundedTaskExecutor.java:194)
at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:207)
at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:183)
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:834)
Caused by: java.lang.ClassNotFoundException: com.intellij.compiler.server.CompileServerPlugin
at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:357)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:398)
at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.getImplementationClass(ExtensionComponentAdapter.java:74)
at com.intellij.openapi.extensions.impl.ExtensionComponentAdapter.createInstance(ExtensionComponentAdapter.java:36)
... 24 more

Do you know how this manifested in the IDE? Seems related to the external builder.

@grguthrie I think this has to do with upgrading to IDEA 2020.2. I've uploaded a pre-release which provides support for it -

https://github.com/carymrobbins/intellij-haskforce/releases/tag/v0.3.45-SNAPSHOT-bd3be731

Download the zip archive there and manually install that version of the plugin and I think things should work for you. I will be cutting a release for this soon.

@grguthrie I think this has to do with upgrading to IDEA 2020.2. I've uploaded a pre-release which provides support for it -

https://github.com/carymrobbins/intellij-haskforce/releases/tag/v0.3.45-SNAPSHOT-bd3be731

Download the zip archive there and manually install that version of the plugin and I think things should work for you. I will be cutting a release for this soon.

Thanks, with this Version my IDEA 202.2. is not broken anymore and I can use your Plugin. Finally :-)

Yes, it should be compatible. IDEA 2020.3 requires Java 11 now, so maybe you are somehow running it with Java 8?

Since you are getting errors about JPS classes, it sounds like maybe this is happening in the external builder. Possibly the external builder process is using Java 8 and the IDE process is using Java 11?

I believe IntelliJ should be running with its custom JRE (Java runtime) which is why I assume thr IDE works for you, but when you try to build with Cabal you get that exception, correct?

Regarding the Internal error (java.lang.UnsupportedClassVersionError): com/haskforce/jps/model/JpsHaskellModelSerializerExtension has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 54.0

The exception indeed comes from the build process (JPS). While the IDE uses java 11 runtime, the minimal supported runtime for JPS remains java 8, so any plugin class which is supposed to be loaded in a JPS process, must be compiled to be compatible with java 8.
This particular exception seems to be thrown from java 10 (class version 54.0), which was used to run JPS process.
The com/haskforce/jps/model/JpsHaskellModelSerializerExtension class seems to have been compiled against java 11 and for java 11 (class version 55).

So the correct fix to the problem will be recompiling the com/haskforce/jps/model/JpsHaskellModelSerializerExtension class to be compatible with java 8.

Thank you.
I just cleaned out all the old Java installs, and installed SDK 15. Somewhat odd that Oracle lists 1.8 as current version, but under SDK indicates 15 available and most current. (And their removal tool did not remove all old versions!)
I think after all the cleanup & Update it works - sorting through the Haskell setup now.

Thank you @eugenezh! I may need to start building with JDK 8 but running the tests with JRE 11. Tricky.

@grguthrie Good to hear! I'll go ahead and close this issue for now, please open another if you encounter more issues.