Studio Hot deploy fails to compile

On studio 13.2.191 on hot deploy of a ServiceBean i get the error:

Hot deploy compilation errors:
C:\Users\acgie\IdeaProjects\mgweb\modules\core\src\org\mg\mgweb\service\RematesServiceBean.java:3: error: package com.haulmont.cuba.core does not exist
import com.haulmont.cuba.core.Persistence;

if i rerun the application from Studio everything is ok.

Hi,

Thank you for reporting the problem. But we could not reproduce it locally.

Can you please do the following to give us debug information to identify the cause of the issue?
Turn on CUBA debug logs (CUBA -> Advanced -> Enable DEBUG Logging level), reproduce the problem, and attach idea.log (Help -> Show Logs in ...)

Thanks.

Hi,

I ran into the exact same problem.

Whenever I change something (e.g. screen controller) and it’s trying to hot deploy, it runs into errors.
When I re-build the project, it works with no errors.

The compining error comes from my middleware ServiceBean.
It starts with this one:

Hot deploy compilation errors: .../modules/core/src/com/.../service/CurrencyServiceBean.java:3: error: package com.haulmont.cuba.core does not exist import com.haulmont.cuba.core.Persistence;

The same for:

error: package com.haulmont.cuba.core does not exist import com.haulmont.cuba.core.Query
error: package com.haulmont.cuba.core does not existimport com.haulmont.cuba.core.Transaction;

and of course also for the declarations:

error: cannot find symbol private Persistence persistence;
error: cannot find symbol private Transaction tx = persistence.createTransaction(“VT”);
error: cannot find symbol private Query q = persistence.getEntityManager(“VT”).createNativeQuery(…

There are no syntax errors in IntelliJ and once re-built the ServiceBean works as expected.
It’s the first ServiceBean that i made for this project (and the first one since Version 6 and since using IntelliJ)

CUBA Studio 2019.2 (IntelliJ Edition)
Build #CS-192.7142.133, built on May 18, 2020
Runtime version: 11.0.4+10-b304.77 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 16
Registry:
Non-Bundled Plugins: CUBA

OK, never mind, I updated to the latest Studio and it works now.

CUBA Studio 2020.2 (IntelliJ Edition)
Build #CS-202.7660.151, built on December 9, 2020
Runtime version: 11.0.8+10-b944.34 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1979M
Cores: 16
Non-Bundled Plugins: org.jetbrains.kotlin