How to trace fault when project won't run

Answered

When I try to run my project I get the error message Error running 'Project': Calling invokeAndWait from read-action leads to possible deadlock. Unfortunately I can find nowhere that tells me where the offending code is. None of my code calls invokeAndWait() directly, so I guess there is a library call somewhere that does.

Can I get IntelliJ to tell me where the problem is or do I have to narrow the problem down by randomly commenting out random chunks of possibly offending code until it will run?

1
13 comments

Is it a plug-in development question?

0

No, it isn't a plug-in development question.

0

Please provide the logs: Help | Collect Logs and Diagnostic Data. You can upload the files at https://uploads.jetbrains.com.

Copy/paste the exact error that you see. Do you see it in the console?

What type of the run/debug configuration do you use? Attach the screenshot.

0

Upload ID: 2021_08_13_PfSB83vX7FHxKCCR

This project runs in IDEA 2021.1, but won't run in 2021.2

0

Thank you for the logs. What run/debug configuration type do you use? How can we reproduce this issue?

0

Do you use alternative JRE in the Run configuration? Does it help if you switch it back to the default one?

0

I have exactly the same problem with my projects that use swing.

I have the problems with idea 2021.2 (after update) and had to revert back to 2021.1. The projects are working fine in the 2021.1 version.

Projects are using zulu jdk 11.0.10. These are plugins for CLCWorkbench a biological application written using Swing that accepts plugins. The startup procedure is in the CLCWorkbench out of my control.

In the run configuration I start the JVM with a classpath that contains the CLCWorkbench jars and classes + binary libs. My plugin project jar is also in the classpath. The workbench loads my plugin.

This setup has worked for a number of years with different JDK s (the workbench requires different JDK versions over the years) until version 2021.2.

I do not think the problem is related to JDK version because this did not change. Only switching to the new IDEA 2021.2 produces the problem.

2021_08_23_MtqwA7SbQDWE6ori

0

The latest build has the same issue for me.

0

Your issues are different since the logs for Neil have the specific exception while Bruno logs don't.

Neil, please reply to my questions from several comments above.

0

Sorry, I missed the question about alternative JREs. I'm not sure what constitutes the default, but I was using JDK 14. Trying to change to a different Java version failed because the project uses Java 14 features but after changing back to Java 14 the project will now run.

0

Serge, I repeated the experiment using IntelliJ IDEA 2021.2.1 (Ultimate Edition)
Build #IU-212.5080.55 on a fresh install. I wanted to make sure to have the correct log files.

I still get the error message, on screen and also in the log files. I hope sincerely this information can help solve the problem.

I uploaded the log files of the new experiment Upload id: 2021_09_12_VYUtqLQ7HpF6Uu4v (file: idea-logs-20210912-115225.zip).

The exception is in the "idea.log" file

java.lang.IllegalStateException: Calling invokeAndWait from read-action leads to possible deadlock.
at com.intellij.openapi.application.impl.ApplicationImpl.invokeAndWait(ApplicationImpl.java:447)
at com.intellij.openapi.application.ex.ApplicationUtil.invokeAndWaitSomewhere(ApplicationUtil.java:145)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcessWithProgressSynchronously(CoreProgressManager.java:575)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.runProcessWithProgressSynchronously(ProgressManagerImpl.java:88)
at com.intellij.openapi.progress.impl.CoreProgressManager.run(CoreProgressManager.java:398)
at com.intellij.openapi.progress.Task.queue(Task.java:124)

 

 

0

See https://youtrack.jetbrains.com/issue/IDEA-269675. The fix is not released yet.

Change the JRE in the run configuration to a valid one to fix this issue.

0

Please sign in to leave a comment.