Noam-Dori / ros-integrate

Extends IntelliJ-Based IDEs with ROS specific development tools
Apache License 2.0
22 stars 3 forks source link

startup error when using with JetBrains remote development #78

Closed rursprung closed 1 year ago

rursprung commented 1 year ago

Describe the bug this happens when using the plugin in CLion with the WSL2 integration (which allows using the usual convenience features of CLion in the windows desktop environment while actually working with ROS noetic on Ubuntu 20.04 (the only platform it supports)).

after installing the plugin & re-starting the IDE the error listed below is shown by JetBrains.

To Reproduce

  1. set up an Ubuntu-20.04 WSL2 instance
  2. install ROS in the WSL2 instance
  3. create a catkin workspace in the WSL2 instance and ensure that the setup.bash files are sourced in ~/.profile so that the env. variables will be visible to the IDE
  4. clone or create some small ROS project in the WSL2 instance (in your catkin workspace)
  5. start CLion (on Windows)
  6. use "Remote Development > WSL" to connect to your WSL2 instance and select the previously created project folder (on first startup it'll ask you which remote IDE you want to install, i just picked latest)
  7. install this plugin in the remote development IDE and restart the IDE

note: to just test the plugin behaviour on startup steps 2-4 can probably be skipped and you can just start the IDE with an empty folder, so you don't need to install ROS first (i presume the exception happens long before anything ROS-related is done, this seems to be at the very beginning of the startup).

Expected behavior the plugin can now be used in the remote development IDE

Environment Information:

Stack Trace

java.lang.Throwable: `include` is supported only on a root level ([row,col,system-id]: [406,5,"C:\Users\[..]\AppData\Roaming\JetBrains\JetBrainsClient231.8109.4\plugins\ros-integrate\lib\ros-integrate-0.1.6.jar"])
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:202)
    at com.intellij.ide.plugins.XmlReader.checkXInclude(XmlReader.kt:499)
    at com.intellij.ide.plugins.XmlReader.access$checkXInclude(XmlReader.kt:1)
    at com.intellij.ide.plugins.XmlReader.readExtensions(XmlReader.kt:408)
    at com.intellij.ide.plugins.XmlReader.readRootElementChild(XmlReader.kt:264)
    at com.intellij.ide.plugins.XmlReader.access$readRootElementChild(XmlReader.kt:1)
    at com.intellij.ide.plugins.XmlReader.readModuleDescriptor(XmlReader.kt:99)
    at com.intellij.ide.plugins.XmlReader.readModuleDescriptor(XmlReader.kt:52)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadDescriptorFromJar(PluginDescriptorLoader.kt:142)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadFromPluginDir(PluginDescriptorLoader.kt:236)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadDescriptorFromFileOrDir(PluginDescriptorLoader.kt:194)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadDescriptorFromFileOrDir$default(PluginDescriptorLoader.kt:181)
    at com.intellij.ide.plugins.PluginDescriptorLoader$loadDescriptorsFromDir$1$1$1.invokeSuspend(PluginDescriptorLoader.kt:839)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

Following exceptions happened soon after this one, most probably they are induced.

2023-03-12T11:31:52.818
java.lang.Throwable: `include` is supported only on a root level ([row,col,system-id]: [407,5,"C:\Users\[..]\AppData\Roaming\JetBrains\JetBrainsClient231.8109.4\plugins\ros-integrate\lib\ros-integrate-0.1.6.jar"])
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:202)
    at com.intellij.ide.plugins.XmlReader.checkXInclude(XmlReader.kt:499)
    at com.intellij.ide.plugins.XmlReader.access$checkXInclude(XmlReader.kt:1)
    at com.intellij.ide.plugins.XmlReader.readExtensions(XmlReader.kt:408)
    at com.intellij.ide.plugins.XmlReader.readRootElementChild(XmlReader.kt:264)
    at com.intellij.ide.plugins.XmlReader.access$readRootElementChild(XmlReader.kt:1)
    at com.intellij.ide.plugins.XmlReader.readModuleDescriptor(XmlReader.kt:99)
    at com.intellij.ide.plugins.XmlReader.readModuleDescriptor(XmlReader.kt:52)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadDescriptorFromJar(PluginDescriptorLoader.kt:142)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadFromPluginDir(PluginDescriptorLoader.kt:236)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadDescriptorFromFileOrDir(PluginDescriptorLoader.kt:194)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadDescriptorFromFileOrDir$default(PluginDescriptorLoader.kt:181)
    at com.intellij.ide.plugins.PluginDescriptorLoader$loadDescriptorsFromDir$1$1$1.invokeSuspend(PluginDescriptorLoader.kt:839)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

2023-03-12T11:31:52.820
java.lang.Throwable: `include` is supported only on a root level ([row,col,system-id]: [409,5,"C:\Users\[..]\AppData\Roaming\JetBrains\JetBrainsClient231.8109.4\plugins\ros-integrate\lib\ros-integrate-0.1.6.jar"])
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:202)
    at com.intellij.ide.plugins.XmlReader.checkXInclude(XmlReader.kt:499)
    at com.intellij.ide.plugins.XmlReader.access$checkXInclude(XmlReader.kt:1)
    at com.intellij.ide.plugins.XmlReader.readExtensions(XmlReader.kt:408)
    at com.intellij.ide.plugins.XmlReader.readRootElementChild(XmlReader.kt:264)
    at com.intellij.ide.plugins.XmlReader.access$readRootElementChild(XmlReader.kt:1)
    at com.intellij.ide.plugins.XmlReader.readModuleDescriptor(XmlReader.kt:99)
    at com.intellij.ide.plugins.XmlReader.readModuleDescriptor(XmlReader.kt:52)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadDescriptorFromJar(PluginDescriptorLoader.kt:142)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadFromPluginDir(PluginDescriptorLoader.kt:236)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadDescriptorFromFileOrDir(PluginDescriptorLoader.kt:194)
    at com.intellij.ide.plugins.PluginDescriptorLoader.loadDescriptorFromFileOrDir$default(PluginDescriptorLoader.kt:181)
    at com.intellij.ide.plugins.PluginDescriptorLoader$loadDescriptorsFromDir$1$1$1.invokeSuspend(PluginDescriptorLoader.kt:839)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:42)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

2023-03-12T11:31:46.809
com.intellij.diagnostic.PluginException: Cannot create extension (class=com.intellij.warmup.ProjectCachesWarmup) [Plugin: com.intellij]
    at com.intellij.serviceContainer.ComponentManagerImpl.createError(ComponentManagerImpl.kt:1096)
    at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.doCreateInstance(XmlExtensionAdapter.kt:70)
    at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.createInstance(XmlExtensionAdapter.kt:31)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl.processAdapter(ExtensionPointImpl.java:445)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl.access$200(ExtensionPointImpl.java:32)
    at com.intellij.openapi.extensions.impl.ExtensionPointImpl$1.next(ExtensionPointImpl.java:353)
    at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:170)
    at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
    at com.intellij.idea.ApplicationLoader.findStarter(ApplicationLoader.kt:490)
    at com.intellij.idea.ApplicationLoader.createAppStarterAsync(ApplicationLoader.kt:306)
    at com.intellij.idea.ApplicationLoader.access$createAppStarterAsync(ApplicationLoader.kt:1)
    at com.intellij.idea.ApplicationLoader$doInitApplication$4$3.invokeSuspend(ApplicationLoader.kt:134)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Caused by: java.lang.ClassNotFoundException: com.intellij.warmup.ProjectCachesWarmup
    at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:224)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
    at com.intellij.serviceContainer.ComponentManagerImplKt.doLoadClass(ComponentManagerImpl.kt:1632)
    at com.intellij.serviceContainer.ComponentManagerImplKt.access$doLoadClass(ComponentManagerImpl.kt:1)
    at com.intellij.serviceContainer.ComponentManagerImpl.loadClass(ComponentManagerImpl.kt:984)
    at com.intellij.openapi.extensions.impl.InterfaceExtensionImplementationClassResolver.resolveImplementationClass(InterfaceExtensionImplementationClassResolver.kt:24)
    at com.intellij.openapi.extensions.impl.XmlExtensionAdapter.doCreateInstance(XmlExtensionAdapter.kt:49)
    ... 16 more

At runtime the following error is also shown repeatedly in the notifications:

The plugin ros-integrate failed to save settings and has been disabled. Please restart JetBrains Client

Screenshots n/a

Additional context n/a

Noam-Dori commented 1 year ago

While the stack trace seems very different, the main error seems to be the same as in issue #68 From what I said when that issue was fixed:

... all plugin services (save for few plugin components) were not loaded by the plugin.xml. This was caused by an improper use of XInclude in the plugin.xml. XInclude, which allows importing tags from other documents, should be used at the root on the including document, and not deeper within the tree (which I did). Fixing this problem allowed the components to load.

The fix should be available for the next release, 0.1.7, and is already available here.

Fix was tested on IntelliJ Community 2022.3.2 and CLion 2022.3.2 on Windows 10.

If you are up for it, you can install the plugin from source to apply the fix right now, which will fix the bug. Let me know if the plugin still crashes

Noam-Dori commented 1 year ago

Closing due to inactivity