Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document usage example #4

Open
bzz opened this issue Jun 15, 2020 · 7 comments
Open

Document usage example #4

bzz opened this issue Jun 15, 2020 · 7 comments

Comments

@bzz
Copy link

bzz commented Jun 15, 2020

It is well-documented to how to install already built plugin and configure it:

But how does one trigger the run?
https://github.com/MagpieBridge/InferIDE#when-is-infer-running gives some idea, but it is still not immediately clear how to trigger it manually from IDE?

That becomes especially important when after installing the plugin and the serve, one can only see this exception in the logs (latest IDEA 2020.2 EAP)
Screenshot 2020-06-15 at 16 27 16 🤷

@linghuiluo
Copy link
Member

I can add more explanation about this to the readme later

@linghuiluo
Copy link
Member

linghuiluo commented Jun 15, 2020

Did you configured the infer.jar file as shown in the screenshot here https://github.com/MagpieBridge/IntelliJLSP. A web page should be opened in your browser once the server started. There you can have buttons and configurations you can choose. The manual triggering is not in IDE but in the web page MagpieBridge generates.

@bzz
Copy link
Author

bzz commented Jun 15, 2020

Did you configured the infer.jar file as shown in the screenshot

Yes, I did.

May be this has to do with the plugin not being loaded properly, as the logs have

Caused by: java.lang.ClassNotFoundException: com.intellij.openapi.compiler.CompilerMessage PluginClassLoader[PluginDescriptor(name=MagpieBridge LSP Support, id=magpiebridge.intellij

exception?

full stacktrace
java.lang.NoClassDefFoundError: com/intellij/openapi/compiler/CompilerMessage
	at magpiebridge.intellij.plugin.ServerLauncher.launch(ServerLauncher.java:68)
	at magpiebridge.intellij.plugin.ProjectLSPService.projectOpened(ProjectLSPService.java:26)
	at com.intellij.openapi.project.impl.ProjectManagerExImplKt$openProject$1$1$1.run(ProjectManagerExImpl.kt:269)
	at com.intellij.ide.startup.impl.StartupManagerImpl.runActivity(StartupManagerImpl.java:419)
	at com.intellij.openapi.project.impl.ProjectManagerExImplKt$openProject$1$1.invoke(ProjectManagerExImpl.kt:266)
	at com.intellij.openapi.project.impl.ProjectManagerExImplKt$openProject$1$1.invoke(ProjectManagerExImpl.kt)
	at com.intellij.serviceContainer.ContainerUtilKt.processProjectComponents(containerUtil.kt:31)
	at com.intellij.openapi.project.impl.ProjectManagerExImplKt$openProject$1.run(ProjectManagerExImpl.kt:265)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeAndWait$8(ApplicationImpl.java:475)
	at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:126)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:132)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
	at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:188)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:967)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:839)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:450)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:733)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:449)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:497)
	at com.intellij.ide.IdeEventQueue.pumpEventsForHierarchy(IdeEventQueue.java:1023)
	at com.intellij.openapi.progress.util.ProgressWindow.pumpEventsForHierarchy(ProgressWindow.java:225)
	at com.intellij.openapi.progress.util.ProgressWindow.lambda$startBlocking$4(ProgressWindow.java:214)
	at com.intellij.openapi.application.impl.ApplicationImpl.runUnlockingIntendedWrite(ApplicationImpl.java:828)
	at com.intellij.openapi.progress.util.ProgressWindow.startBlocking(ProgressWindow.java:213)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$legacyExec$6(ProgressRunner.java:304)
	at java.base/java.util.concurrent.CompletableFuture.uniAcceptNow(CompletableFuture.java:753)
	at java.base/java.util.concurrent.CompletableFuture.uniAcceptStage(CompletableFuture.java:731)
	at java.base/java.util.concurrent.CompletableFuture.thenAccept(CompletableFuture.java:2108)
	at com.intellij.openapi.progress.impl.ProgressRunner.legacyExec(ProgressRunner.java:302)
	at com.intellij.openapi.progress.impl.ProgressRunner.submit(ProgressRunner.java:250)
	at com.intellij.openapi.progress.impl.ProgressRunner.submitAndGet(ProgressRunner.java:171)
	at com.intellij.openapi.application.impl.ApplicationImpl.runProcessWithProgressSynchronously(ApplicationImpl.java:421)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:502)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:83)
	at com.intellij.openapi.project.impl.ProjectUiFrameAllocator$run$1.run(ProjectFrameAllocator.kt:105)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:201)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$invokeAndWait$8(ApplicationImpl.java:475)
	at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:126)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:84)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:132)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:47)
	at com.intellij.openapi.application.impl.FlushQueue$FlushNow.run(FlushQueue.java:188)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:967)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:839)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:450)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:744)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$9(IdeEventQueue.java:449)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:802)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:497)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.ClassNotFoundException: com.intellij.openapi.compiler.CompilerMessage PluginClassLoader[PluginDescriptor(name=MagpieBridge LSP Support, id=magpiebridge.intellij, path=~/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/202.5428.22/IntelliJ IDEA 2020.2 EAP.app.plugins/MagpieBridgeLSPSupport, version=1.0)] com.intellij.ide.plugins.cl.PluginClassLoader@f0f0349
	at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:95)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 74 more

@linghuiluo
Copy link
Member

linghuiluo commented Jun 15, 2020

The stack trace for me looks like an issue using java 9+ to execute java 8 code. Can java 8 be found under your PATH which you configured in the MagpieBridge LSP configuration wizard? Since MagpieBridge and lsp4j are written in java 8, so the infer server must be executed by java 8.

One thing I found was very annoying is that IntelliJ doesn't give me the PATH which has been set on my machine. That's why I left a configuration option for setting the PATH in the wizard (see here). The command line tool Infer has to be on the PATH too.
The class ServerLanucher is nothing fancy but starting a process which executes the command java -jar infer.jar..., see here

@linghuiluo
Copy link
Member

@bzz if the suggestion on PATH still doesn't solve your problem, please share me the version of IntelliJ you are using, I can try to reproduce the error.

@bzz
Copy link
Author

bzz commented Jun 17, 2020

Thank you for advice, but changing PATH did not help.

It seems to me that the plugin fails to load due to class-loader failing to find the class java.lang.NoClassDefFoundError: com/intellij/openapi/compiler/CompilerMessage that is part of the Platform SDK.

Do you think it may have to do with https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html#modules-available-in-all-products that mentions

All plugins should declare a dependency on com.intellij.modules.platform as an indication of dependence on shared functionality.

and that I can not find in plugin.xml?

I'm sorry for not beeing more helpfull, but without ability to build the project locally (that is handled under #3) it's very hard for me to experiment more.

I'm using the latest EAP version from https://www.jetbrains.com/idea/nextversion

@linghuiluo
Copy link
Member

@bzz oh, sorry to hear that.

We will try to make the plugin as you wish in #3 in the next few days and let you know.
Meanwhile, I will try if I can reproduce the error with version you provided.

We are not experts in writing IntelliJ plugin. This one was first implemented experimentally. Thank you for your advice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants