sbt-idea-plugin
sbt-idea-plugin copied to clipboard
Trouble referencing custom parser from ToolWindow
Upon running my code in IDEA (a separate instance with its own set of windows is created), I am running into an error linking to an object that is verified to exist in my SBT classpath.
The line of code that fails is here, around the object TopLevelParser: https://github.com/ossuminc/riddl-idea-plugin/blob/RIP4_build_window/src/main/scala/com/ossuminc/riddl/plugins/utils/utils.scala
The failing function is called from here, inside my ToolWindow https://github.com/ossuminc/riddl-idea-plugin/blob/RIP4_build_window/src/main/scala/com/ossuminc/riddl/plugins/idea/ui/RiddlToolWindowFactory.scala
The relevant error from the run console output is where it says:
Caused by: java.lang.NoClassDefFoundError: com/ossuminc/riddl/language/parsing/TopLevelParser$
This is odd since the object is definitely in the SBT classpath as previously stated. There are no compilation errors, and IDEA has no red import lines.
/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/jbr/Contents/Home/bin/java -Djava.system.class.loader=com.intellij.util.lang.PathClassLoader -cp /Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/app.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/util_rt.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/product.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/product-client.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/lib-client.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/testFramework.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/groovy.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/annotations.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/idea_rt.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/bouncy-castle.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/platform-loader.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/junit4.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/trove.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/protobuf.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/intellij-coverage-agent-1.0.744.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/nio-fs.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/external-system-rt.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/rd.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/grpc.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/intellij-test-discovery.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/lib.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/modules.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/jps-model.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/app-client.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/stats.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/opentelemetry.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/jsch-agent.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/util-8.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/forms_rt.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/externalProcess-rt.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/util.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/async-profiler.jar:/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/ant/lib/ant.jar -Dsun.io.useCanonCaches=false -Dsun.io.useCanonPrefixCache=false -ea -Djava.net.preferIPv4Stack=true -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Dawt.useSystemAAFontSettings=lcd -Dsun.java2d.renderer=sun.java2d.marlin.MarlinRenderingEngine -Dsun.tools.attach.tmp.only=true -Dide.no.platform.update=true -Dkotlinx.coroutines.debug=off -Djdk.attach.allowAttachSelf=true -XX:MaxJavaStackTraceDepth=10000 -Didea.debug.mode=true -Dapple.laf.useScreenMenuBar=true -Duse.linux.keychain=false -Didea.initially.ask.config=true -Djdk.module.illegalAccess.silent=true -XX:+IgnoreUnrecognizedVMOptions -XX:CompileCommand=exclude,com/intellij/openapi/vfs/impl/FilePartNodeRoot,trieDescend --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/jdk.internal.vm=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.nio.fs=ALL-UNNAMED --add-opens=java.base/sun.security.ssl=ALL-UNNAMED --add-opens=java.base/sun.security.util=ALL-UNNAMED --add-opens=java.desktop/com.apple.eawt=ALL-UNNAMED --add-opens=java.desktop/com.apple.eawt.event=ALL-UNNAMED --add-opens=java.desktop/com.apple.laf=ALL-UNNAMED --add-opens=java.desktop/com.sun.java.swing.plaf.gtk=ALL-UNNAMED --add-opens=java.desktop/java.awt=ALL-UNNAMED --add-opens=java.desktop/java.awt.dnd.peer=ALL-UNNAMED --add-opens=java.desktop/java.awt.event=ALL-UNNAMED --add-opens=java.desktop/java.awt.image=ALL-UNNAMED --add-opens=java.desktop/java.awt.peer=ALL-UNNAMED --add-opens=java.desktop/javax.swing=ALL-UNNAMED --add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED --add-opens=java.desktop/sun.awt.X11=ALL-UNNAMED --add-opens=java.desktop/sun.awt.datatransfer=ALL-UNNAMED --add-opens=java.desktop/sun.awt.image=ALL-UNNAMED --add-opens=java.desktop/sun.awt.windows=ALL-UNNAMED --add-opens=java.desktop/sun.awt=ALL-UNNAMED --add-opens=java.desktop/sun.font=ALL-UNNAMED --add-opens=java.desktop/sun.java2d=ALL-UNNAMED --add-opens=java.desktop/sun.lwawt=ALL-UNNAMED --add-opens=java.desktop/sun.lwawt.macosx=ALL-UNNAMED --add-opens=java.desktop/sun.swing=ALL-UNNAMED --add-opens=jdk.attach/sun.tools.attach=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-opens=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED --add-opens=jdk.jdi/com.sun.tools.jdi=ALL-UNNAMED -Dpty4j.preferred.native.folder=/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/pty4j -Djna.boot.library.path=/Users/alexweinstein/.RIDDL4IDEAPluginIU/sdk/241.15989.150/lib/jna/aarch64 -Djna.nounpack=true -Djna.nosys=true -Xms128m -Xmx2048m -XX:ReservedCodeCacheSize=512m -XX:SoftRefLRUPolicyMSPerMB=50 -XX:+UseG1GC -XX:CICompilerCount=2 -Didea.system.path=/Users/alexweinstein/.RIDDL4IDEAPluginIU/system -Didea.config.path=/Users/alexweinstein/.RIDDL4IDEAPluginIU/config -Dplugin.path=/Users/alexweinstein/Documents/ossum/riddl-idea-plugin/target/plugin/RIDDL4IDEA -Didea.is.internal=true -javaagent:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar=53075:/Applications/IntelliJ IDEA.app/Contents/bin -Dfile.encoding=UTF-8 @/private/var/folders/px/2979l8xj2r7gf9bn8qnb1zzm0000gn/T/idea_arg_file1342062063 com.intellij.idea.Main
CompileCommand: exclude com/intellij/openapi/vfs/impl/FilePartNodeRoot.trieDescend bool exclude = true
WARNING: package sun.awt.windows not in java.desktop
WARNING: package sun.awt.X11 not in java.desktop
WARNING: package com.sun.java.swing.plaf.gtk not in java.desktop
2024-05-07 13:54:02,993 [ 163] WARN - #c.i.i.p.PluginManager - Problems found loading plugins:
The JetBrains AI Assistant (id=com.intellij.ml.llm, path=~/.RIDDL4IDEAPluginIU/config/plugins/ml-llm, version=241.14494.320) plugin Plugin 'JetBrains AI Assistant' (version '241.14494.320') is not compatible with the current version of the IDE, because it requires build 241.14494.* or older but the current build is IU-241.15989.150
2024-05-07 13:54:03,000 [ 170] WARN - #c.i.u.s.SvgCacheManager - Icon cache is corrupted (PersistentEnumerator storage corrupted /Users/alexweinstein/.RIDDL4IDEAPluginIU/system/icon-cache/icon.db)
2024-05-07 13:54:03,414 [ 584] WARN - #c.i.o.a.Application - No URL bundle (CFBundleURLTypes) is defined in the main bundle.
To be able to open external links, specify protocols in the app layout section of the build file.
Example: args.urlSchemes = ["your-protocol"] will handle following links: your-protocol://open?file=file&line=line
2024-05-07 13:54:03,617 [ 787] WARN - #c.i.i.u.l.LafManagerImpl - VersionControl.Log.Commit.rowHeight = null in LookAndFeelThemeAdapter; it may lead to performance degradation
2024-05-07 13:54:04,490 [ 1660] WARN - #c.i.s.ComponentManagerImpl - com.intellij.uast.UastMetaLanguage$Holder <clinit> requests com.intellij.openapi.application.Experiments instance. Class initialization must not depend on services. Consider using instance of the service on-demand instead.
2024-05-07 13:54:05,618 [ 2788] SEVERE - #c.i.o.w.i.ToolWindowManagerImpl - Cannot init toolwindow com.ossuminc.riddl.plugins.idea.ui.RiddlToolWindowFactory@1e97d3be [Plugin: com.ossuminc.riddl.plugins.idea]
com.intellij.diagnostic.PluginException: Cannot init toolwindow com.ossuminc.riddl.plugins.idea.ui.RiddlToolWindowFactory@1e97d3be [Plugin: com.ossuminc.riddl.plugins.idea]
at com.intellij.toolWindow.ToolWindowSetInitializerKt.registerToolWindows(ToolWindowSetInitializer.kt:232)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.access$registerToolWindows(ToolWindowSetInitializer.kt:1)
at com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1$1.invokeSuspend(ToolWindowSetInitializer.kt:139)
at com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1$1.invoke(ToolWindowSetInitializer.kt)
at com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1$1.invoke(ToolWindowSetInitializer.kt)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source)
at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span(tracer.kt:56)
at com.intellij.platform.diagnostic.telemetry.impl.TracerKt.span$default(tracer.kt:49)
at com.intellij.toolWindow.ToolWindowSetInitializer$createAndLayoutToolWindows$entries$1.invokeSuspend(ToolWindowSetInitializer.kt:136)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:194)
at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:204)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:419)
at com.intellij.openapi.application.impl.RwLockHolder.runWithEnabledImplicitRead(RwLockHolder.kt:138)
at com.intellij.openapi.application.impl.RwLockHolder.runWithImplicitRead(RwLockHolder.kt:129)
at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1152)
at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:81)
at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:123)
at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:792)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:739)
at java.desktop/java.awt.EventQueue$3.run(EventQueue.java:733)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:761)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:699)
at com.intellij.ide.IdeEventQueue._dispatchEvent$lambda$12(IdeEventQueue.kt:593)
at com.intellij.openapi.application.impl.RwLockHolder.runWithoutImplicitRead(RwLockHolder.kt:105)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:593)
at com.intellij.ide.IdeEventQueue.access$_dispatchEvent(IdeEventQueue.kt:77)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:362)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1$1.compute(IdeEventQueue.kt:361)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:843)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:361)
at com.intellij.ide.IdeEventQueue$dispatchEvent$processEventRunnable$1$1.invoke(IdeEventQueue.kt:356)
at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$1(IdeEventQueue.kt:1022)
at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1022)
at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$7(IdeEventQueue.kt:356)
at com.intellij.openapi.application.impl.RwLockHolder.runIntendedWriteActionOnCurrentThread(RwLockHolder.kt:209)
at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:830)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:398)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
Caused by: java.lang.NoClassDefFoundError: com/ossuminc/riddl/language/parsing/TopLevelParser$
at com.ossuminc.riddl.plugins.utils.package$.parseASTFromSource(utils.scala:11)
at com.ossuminc.riddl.plugins.idea.ui.RiddlToolWindowFactory$RiddlToolWindowContent.setWindowOutput(RiddlToolWindowFactory.scala:52)
at com.ossuminc.riddl.plugins.idea.ui.RiddlToolWindowFactory$RiddlToolWindowContent.createRiddlProjectOutputPanel(RiddlToolWindowFactory.scala:44)
at com.ossuminc.riddl.plugins.idea.ui.RiddlToolWindowFactory$RiddlToolWindowContent.<init>(RiddlToolWindowFactory.scala:36)
at com.ossuminc.riddl.plugins.idea.ui.RiddlToolWindowFactory.createToolWindowContent(RiddlToolWindowFactory.scala:21)
at com.intellij.openapi.wm.impl.ToolWindowImpl.createContentIfNeeded(ToolWindowImpl.kt:596)
at com.intellij.openapi.wm.impl.ToolWindowImpl.scheduleContentInitializationIfNeeded$intellij_platform_ide_impl(ToolWindowImpl.kt:575)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.doShowWindow(ToolWindowManagerImpl.kt:1036)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.showToolWindowImpl(ToolWindowManagerImpl.kt:970)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.showToolWindowImpl$default(ToolWindowManagerImpl.kt:953)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl$registerToolWindow$postTask$1.invoke(ToolWindowManagerImpl.kt:1169)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl$registerToolWindow$postTask$1.invoke(ToolWindowManagerImpl.kt:1168)
at com.intellij.openapi.wm.impl.ToolWindowManagerImpl.registerToolWindow$intellij_platform_ide_impl(ToolWindowManagerImpl.kt:1182)
at com.intellij.toolWindow.ToolWindowSetInitializerKt.registerToolWindows(ToolWindowSetInitializer.kt:222)
... 52 more
Caused by: java.lang.ClassNotFoundException: com.ossuminc.riddl.language.parsing.TopLevelParser$ PluginClassLoader(plugin=PluginDescriptor(name=RIDDL4IDEA, id=com.ossuminc.riddl.plugins.idea, descriptorPath=plugin.xml, path=~/Documents/ossum/riddl-idea-plugin/target/plugin/RIDDL4IDEA, version=0.0.1, package=null, isBundled=false), packagePrefix=null, state=active)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.kt:156)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 66 more
2024-05-07 13:54:05,634 [ 2804] SEVERE - #c.i.o.w.i.ToolWindowManagerImpl - IntelliJ IDEA 2024.1.1 Build #IU-241.15989.150
2024-05-07 13:54:05,634 [ 2804] SEVERE - #c.i.o.w.i.ToolWindowManagerImpl - JDK: 17.0.10; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2024-05-07 13:54:05,634 [ 2804] SEVERE - #c.i.o.w.i.ToolWindowManagerImpl - OS: Mac OS X
2024-05-07 13:54:05,634 [ 2804] SEVERE - #c.i.o.w.i.ToolWindowManagerImpl - Plugin to blame: RIDDL4IDEA version: 0.0.1
2024-05-07 13:54:05,634 [ 2804] SEVERE - #c.i.o.w.i.ToolWindowManagerImpl - Last Action:
2024-05-07 13:54:05,639 [ 2809] WARN - #c.i.o.w.i.ToolWindowImpl - ToolWindow icons should be 13x13, but got: 16x16. Please fix ToolWindow (ID: Language Servers) or icon RasterizedImageDataLoader(classLoader=com.intellij.util.lang.PathClassLoader@7cf10a6f, path=webreferences/server.svg)
2024-05-07 13:54:07,344 [ 4514] WARN - #c.i.u.x.Binding - No accessors for org.jetbrains.security.package.Package. This means that state class cannot be serialized properly. Please see https://jb.gg/ij-psoc
2024-05-07 13:54:07,744 [ 4914] WARN - #c.i.o.a.ExperimentalFeatureImpl - Feature 'typescript.compiler.evaluation' is disabled in Release. Set 'percentOfUsers' to 100% to enable in Release.
2024-05-07 13:54:07,745 [ 4915] WARN - #c.i.o.a.ExperimentalFeatureImpl - Feature 'typescript.compiler.evaluation' is disabled in Release. Set 'percentOfUsers' to 100% to enable in Release.
2024-05-07 13:54:08,746 [ 5916] WARN - #c.i.o.w.i.ToolWindowImpl - ToolWindow icons should be 13x13, but got: 16x16. Please fix ToolWindow (ID: Language Servers) or icon RasterizedImageDataLoader(classLoader=com.intellij.util.lang.PathClassLoader@7cf10a6f, path=webreferences/server.svg)
2024-05-07 13:54:15,525 [ 12695] WARN - #o.j.k.i.s.r.KotlinCompilerReferenceIndexStorage - kotlin-data-container is not found
2024-05-07 13:54:18,569 [ 15739] WARN - #o.j.k.i.s.r.KotlinCompilerReferenceIndexStorage - kotlin-data-container is not found
2024-05-07 13:55:03,302 [ 60472] WARN - #c.i.u.x.Binding - No accessors for com.intellij.platform.feedback.impl.state.DontShowAgainFeedbackState. This means that state class cannot be serialized properly. Please see https://jb.gg/ij-psoc
2024-05-07 13:55:03,302 [ 60472] WARN - #c.i.u.x.Binding - No accessors for com.intellij.platform.feedback.impl.state.CommonFeedbackSurveysState. This means that state class cannot be serialized properly. Please see https://jb.gg/ij-psoc
2024-05-07 13:55:03,304 [ 60474] WARN - #c.i.u.x.Binding - No accessors for com.intellij.ide.util.TipsUsageManager$State. This means that state class cannot be serialized properly. Please see https://jb.gg/ij-psoc
2024-05-07 14:04:03,307 [ 600477] WARN - #c.i.u.x.Binding - No accessors for com.intellij.toolWindow.ToolWindowLayoutStorageManagerState. This means that state class cannot be serialized properly. Please see https://jb.gg/ij-psoc
Note that the root cause is a java.lang.ClassNotFoundException
for a class (TopLevelParser$
) whose jar file is definitely in the runtime and test classpath (we looked). Note that the exception reports the "PluginClassLoader" doing the class loading:
PluginClassLoader(plugin=PluginDescriptor(name=RIDDL4IDEA, id=com.ossuminc.riddl.plugins.idea, descriptorPath=plugin.xml, path=~/Documents/ossum/riddl-idea-plugin/target/plugin/RIDDL4IDEA, version=0.0.1, package=null, isBundled=false), packagePrefix=null, state=active)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.kt:156)
Is there some configuration of this PluginClassLoader needed to get it to use the full application class path?
It's probably unrelated to the issue, but please note that you shouldn't use Scala 3.4.1 for plugin development. Scala Plugin uses Scala 3.3.3, and in case you install both plugins, you will have runtime errors. You should also use Scala 3.3.3. See https://github.com/JetBrains/intellij-scala/blob/idea241.x/project/dependencies.scala#L8
Unfortunately, AFAIU the current sbt-idea-plugin doesn't warn you about it and the knowledge about Scala 3.3.3 is not transparent.
Related: https://github.com/JetBrains/sbt-idea-plugin/pull/111#issuecomment-1708504077
whose jar file is definitely in the runtime and test classpath (we looked)
The riddl-language.jar
(in which TopLevelParser
is defined) is indeed in compile class path and test classpath.
However, production IntelliJ IDEA instance class loading is quite complicated compared to tests.
It doesn't simply use IntelliJ module class path.
If you open Run Configuration "riddl-idea-plugin" you will see that in its VM options it defines the classpath manually (see -cp
option).
And that classpath doesn't include riddl-language.jar
.
Also, in SBT output I see the warning:
[warn] Failed to extract dependency jar for org.scala-lang:scala3-library_2.13:3.4.1[]
[warn] Failed to extract dependency jar for org.scalactic:scalactic_2.13:3.2.18[]
[warn] Failed to extract dependency jar for org.scalatest:scalatest_2.13:3.2.18[]
[warn] Failed to extract dependency jar for org.scalacheck:scalacheck_2.13:1.17.0[]
[warn] Failed to extract dependency jar for com.ossuminc:riddl-analyses_2.13:0.46.0[]
[warn] Failed to extract dependency jar for com.ossuminc:riddl-language_2.13:0.46.0[]
[warn] Failed to extract dependency jar for com.ossuminc:riddl-utils_2.13:0.46.0[]
[warn] Failed to extract dependency jar for com.ossuminc:riddl-passes_2.13:0.46.0[]
(notice how it reports _2.13
suffix instead of _3
)
I debugged it a little and found the root cause. I will try to fix it this week.
Related https://github.com/JetBrains/sbt-idea-plugin/pull/111
It should be fixed in version 3.26.0. Could you please try it?
Thank you for this diagnosis @unkarjedy! I was off on vacation for a week and got sick on the way back, so I am only just getting around to this. I will try it out soon
@unkarjedy I have run into a persistent issue now on both my personal laptop and work laptop. I have now spent almost a week trying to figure out why it is even happening.
[error] java.lang.RuntimeException: unable to locate a valid GitHub token from Environment(GITHUB_TOKEN)
[error] at scala.sys.package$.error(package.scala:30)
[error] at sbtghpackages.GitHubPackagesPlugin$.$anonfun$authenticationSettings$2(GitHubPackagesPlugin.scala:53)
I am not using gihtub-packages-plugin so must assume that the error comes from sbt-idea-plugin.
Once this is resolved I can try out the advice you gave 3 weeks ago
@unkarjedy in particular I am wondering which package this might be related to. I am having issues getting a PAT into my keychain, but still don't understand why it's necessary. I suspect my PAT will need access to whatever repo is being downloaded via sbt-idea-plugin, if indeed that is what's going on, and not sure how I can make that happen even if I knew where this is coming from
@unkarjedy got past the PAT issue, now onto the following. Currntly trying to solve, lmk if you recognize it
Cannot invoke "com.intellij.openapi.application.Application.getService(java.lang.Class)" because the return value of "com.intellij.openapi.application.ApplicationManager.getApplication()" is null
The relevant test file can be seen here: https://github.com/ossuminc/riddl-idea-plugin/blob/RIP4_build_window/src/main/test/com/ossuminc/riddl/plugins/idea/RiddlToolWindowFactorySpec.scala
Did you end up figuring out what it was? We're seeing it in the intellij-elixir plugin when upgrading to 2024.1.
@joshuataylor I still have the test file around but have not used it in since I made that last comment. Not sure if the test works because I switched to runIDE
sbt command & using run configurations.