Cannot open Flow UI designer in Studio

Hi Team,

My Studio can’t open visual designer for Flow UI. Please find below exception from idea.log:

2022-11-16 11:29:07,794 [  17944]   WARN - #c.h.j.f.s.d.FlowViewLayoutDesigner - Exception when activating designer
java.lang.IllegalArgumentException: Class loader is null
	at com.haulmont.jmixstudio.flowui.sd.designer.meta.FlowComponentMapper.createStudioComponent(FlowComponentMapper.kt:182)
	at com.haulmont.jmixstudio.flowui.sd.designer.meta.FlowComponentMapper.createSpecificComponent(FlowComponentMapper.kt:274)
	at com.haulmont.jmixstudio.flowui.sd.designer.meta.FlowComponentMapper.createComponentWithPostInitProperties(FlowComponentMapper.kt:135)
	at com.haulmont.jmixstudio.flowui.sd.designer.meta.FlowComponentMapper.createComponent(FlowComponentMapper.kt:111)
	at com.haulmont.jmixstudio.flowui.sd.designer.FlowViewLayoutDesigner.editModel(FlowViewLayoutDesigner.kt:67)
	at com.haulmont.jmixstudio.flowui.sd.designer.FlowViewLayoutDesigner.activate$lambda-1(FlowViewLayoutDesigner.kt:105)
	at com.haulmont.jmixstudio.flowui.util.FlowUiWrapper.run$lambda-1(FlowUiWrapper.kt:41)
	at com.haulmont.jmixstudio.flowui.util.FlowUiWrapper.compute(FlowUiWrapper.kt:48)
	at com.haulmont.jmixstudio.flowui.util.FlowUiWrapper.run(FlowUiWrapper.kt:40)
	at com.haulmont.jmixstudio.flowui.sd.designer.FlowViewLayoutDesigner.activate(FlowViewLayoutDesigner.kt:104)
	at com.haulmont.jmixstudio.flowui.sd.FlowViewDesignerEditor.activatePanel$lambda-2$lambda-1(FlowViewDesignerEditor.kt:134)
	at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:59)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:941)
	at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:68)
	at com.intellij.openapi.application.ReadAction.run(ReadAction.java:58)
	at com.haulmont.jmixstudio.flowui.sd.FlowViewDesignerEditor.activatePanel$lambda-2(FlowViewDesignerEditor.kt:116)
	at com.intellij.openapi.project.DumbServiceImpl.doUnsafeRunWhenSmart(DumbServiceImpl.java:259)
	at com.intellij.openapi.project.DumbServiceImpl.lambda$runWhenSmart$0(DumbServiceImpl.java:243)
	at com.intellij.ide.startup.impl.StartupManagerImpl.runAfterOpened(StartupManagerImpl.kt:482)
	at com.intellij.openapi.project.DumbServiceImpl.runWhenSmart(DumbServiceImpl.java:243)
	at com.haulmont.jmixstudio.flowui.sd.FlowViewDesignerEditor.activatePanel(FlowViewDesignerEditor.kt:115)
	at com.haulmont.jmixstudio.flowui.sd.FlowViewTextEditorWithPreview.activateViewDesigner(FlowViewTextEditorWithPreview.kt:438)
	at com.haulmont.jmixstudio.flowui.sd.designer.inspector.FlowComponentInspectorManager.N(FlowComponentInspectorManager.kt:50)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:209)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:21)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:191)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
	at com.intellij.openapi.application.impl.ApplicationImpl$3.run(ApplicationImpl.java:513)
	at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:75)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:118)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:42)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:779)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:730)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:724)
	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:749)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:918)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:766)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$6(IdeEventQueue.java:450)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:791)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$7(IdeEventQueue.java:449)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:105)
	at com.intellij.ide.IdeEventQueue.performActivity(IdeEventQueue.java:624)
	at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:447)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:881)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:493)
	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)

Jmix version: 1.4.0
Jmix Studio plugin version: 1.4.0-222
IntelliJ version: IntelliJ IDEA 2022.2.3 (Ultimate Edition)

Hi, Bryan
This is a very strange problem, because the classloader is initialized when the jetty server starts (on project opening).
Does this problem reproduce stably and on all flow-ui projects?
May you attach logs from the “{project}/.jmix/screen-designer/tmp/{actual-log-file}” folder please?

Thank you for reporting the problem,
Mikhail

Hi Mikhail,

I created a new Flow UI test project, the problem remains. It can reproduce stably on my mac.

The screen designer log only contains below 2 lines after the project gradle sync finished:

2022-11-17 08:17:47 LOG INFO: Running `pnpm install` to resolve and optionally download frontend dependencies. This may take a moment, please stand by...
2022-11-17 08:17:47 LOG INFO: using '--yes --quiet pnpm@5.18.10 --shamefully-hoist=true --ignore-scripts install' for frontend package installation

And, I got error notification in IDE:

Error when running `pnpm install`

java.io.IOException: Cannot run program "--yes" (in directory "/Users/bryan/developer/zh/flowuitest/.jmix/screen-designer"): error=2, No such file or directory
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1143)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1073)
	at com.haulmont.jmixstudio.flowui.devserver.frontend.TaskRunNpmInstall.runNpmCommand(TaskRunNpmInstall.java:487)
	at com.haulmont.jmixstudio.flowui.devserver.frontend.TaskRunNpmInstall.runNpmInstall(TaskRunNpmInstall.java:360)
	at com.haulmont.jmixstudio.flowui.devserver.frontend.TaskRunNpmInstall.execute(TaskRunNpmInstall.java:175)
	at com.haulmont.jmixstudio.flowui.devserver.frontend.NodeTasks.execute(NodeTasks.java:960)
	at com.haulmont.jmixstudio.flowui.devserver.startup.DevModeInitializer.runNodeTasks(DevModeInitializer.java:380)
	at com.haulmont.jmixstudio.flowui.devserver.startup.DevModeInitializer.lambda$initDevModeHandler$0(DevModeInitializer.java:305)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
Caused by: java.io.IOException: error=2, No such file or directory
	at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
	at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:314)
	at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:244)
	at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1110)
	... 14 more

Seems some configuration is incorrect, could you please help me figure out?

Do you have an pnpm package manager installed?
Also, is there a directory that is specified in the logs ("/Users/bryan/developer/zh/flowuitest/.jmix/screen-designer")?

Yes, I have installed pnpm and the dir exists:
image

please find attached full idea.log:
idea.log (159.8 KB)

This is very helpful, thank you.
This problem is due to the fact that npm (pnpm) cannot find the cache directory on your computer.
I have created issue here: https://youtrack.jmix.io/issue/JST-3435/Cannot-find-npm-pnpm-cache-directory-exception-when-open-flowui-project

1 Like

Hi Mikhail,

If you have this issue fixed and have the nightly build ready, please ping me in this post, I can test the nightly build on my machine.

1 Like

Just get another error:

2022-11-24 16:34:57,633 [  45225] SEVERE - #c.i.o.p.Task - Unable to start server
java.lang.RuntimeException: Unable to start server
	at com.haulmont.jmixstudio.flowui.server.FlowServerManager$initServer$1.onFailure(FlowServerManager.kt:128)
	at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$6.execute(ExternalSystemUtil.java:910)
	at com.intellij.openapi.externalSystem.util.ExternalSystemUtil$8.run(ExternalSystemUtil.java:944)
	at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:442)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:114)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$5(CoreProgressManager.java:493)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:252)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:188)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:175)
	at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:252)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:833)
2022-11-24 16:34:57,634 [  45226] SEVERE - #c.i.o.p.Task - IntelliJ IDEA 2022.2.3  Build #IU-222.4345.14
2022-11-24 16:34:57,634 [  45226] SEVERE - #c.i.o.p.Task - JDK: 17.0.4.1; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o.
2022-11-24 16:34:57,634 [  45226] SEVERE - #c.i.o.p.Task - OS: Mac OS X
2022-11-24 16:34:57,634 [  45226] SEVERE - #c.i.o.p.Task - Plugin to blame: Jmix version: 1.4.0-222

Hello, Bryan
This exception occurred when studio trying to perform a ‘compileKit’ gradle task and it failed for some reason. This task load some jar files to ‘.jmix/screen-designer/lib’ folder.
You can re-open your project or try to execute this task (‘compileKit’) by yourself (but, you still have to re-open your project).

OK, seems it is related with this:

1 Like