Hot Deploy doesn't work

Hello,
Recently I upgraded Cuba framework and Cuba plugin to the last versions (7.2.5) Unfortunately there is a big problem related to HOT DEPLOY. If I comment some line the comment is not taken, the program acts like before the comment. Even I restart, clean…doesn’t have any effect. The only solution is to insert new line, delete it…etc. It’s a nightmare.

Apart of this I have the next error in catalina.out
21:48:25.640 ERROR com.haulmont.cuba.web.gui.WebWindow - Can't find focus component:
Please advice.

-n

Hi! Could you turn on debug logs, reproduce the problem, and attach idea.log file. Also, could you say, what CUBA Platform version you have used before the update?

You can enable debug logs with CUBA -> Advanced -> Enable DEBUG Logging Level. You can find idea.log file with Help -> Show logs in ....

Also, you can try to press Ctrl+S to trigger file hot deploy.

Before the update I used Platform version: 7.1.4.
It worked well. I don’t know if it’s ok to downgrade…
idealog.txt (47.1 KB)
What means the ERROR: Can’t find focus component:?
It happens every time when I open a particular screen (Transaction Edit). Doesn’t have something special. However the main commands (save, cancel, update, etc) work well.
How can get rid of it?

Are you sure, it is full idea.log? Could you reproduce the problem again and then attach the log.

Please find attached the log.idealog.txt (51.9 KB)

Have you enabled debug logging level? I cannot find CUBA Studio logs in this file.

Usually the Cuba logs where present in deploy/tomcat/logs/app.log but I have only catalina.log and localhost. log now…

I mean not CUBA logs, but CUBA Studio logs. They appear in idea.log after enabling debug logging level with CUBA -> Advanced -> Enable DEBUG Logging Level.

What means the ERROR: Can’t find focus component:?
It happens every time when I open a particular screen (Transaction Edit). Doesn’t have something special. However the main commands (save, cancel, update, etc) work well.
How can get rid of it?

I’m not a 100% sure, but it could be that you’ve removed or renamed a component that the screen is trying to set the focus to when it first loads up. Have a look at the XML file for the screen. The window definition has an element called focusComponent. Is the component defined somewhere in the XML?

window xmlns="http://schemas.haulmont.com/cuba/screen/window.xsd"
        caption="msg://editorCaption"
        focusComponent="assignmentForm" <------ Whaddaboutdis?
        messagesPack="com.willowparkmedia.kipper.web.screens.assignment">
    

Chances are that you’ve renamed a form component, or removed it.

Hello Ray.

You are right. I made a lot of modifications in edit.xml (for instance I deleted the (initial) form). Now `focusComponent=" ". What should I put in the quotes?
However what focusCoponent does?

Thank you!
-n

Please find the file attached.idealog.txt (65.1 KB) . However why CUBA logs (app.log) are missing?

Hello Neutrino.

Yes, I do the same thing myself all the time!

focusComponent tells the page which element should have the input focus when your screen is loaded.

https://doc.cuba-platform.com/manual-latest/screen_descriptors.html

If you have a form component on your page, then you should set the focusComponent to the id of your form component. If you don’t have a form on the page, then you can probably remove the focusComponent attribute.

And one small bit of advice, if you don’t mind.

If you think you have two separate problems, then put them in two separate messages. If you do that, then folk can see the problem clearly in the title. They might not be able to help with one, but they may be able to help with the other. :slightly_smiling_face:

Hi Ray,

Thank you for your kindly advise. :+1: I thought that focusComponent ERROR was somehow connected to the problem with Hot Deploy.
However I don’t understand very well what focusComponent is.

What means to have input focus?The system doesn’t treat all components equally? Why is mandatory when it’s about form and otherwise is not?

Basically, it’s the component that will be affected by a user action after the page appears.

If you set it to the OK button, then if the user hits enter, the ok button will actioned. If you set it to a field, then the cursor will appear in that field so the user can start typing without having to click on the field, or tabbing over to it.

If you set it to a form, then I imagine that the app will select the first component in the form to have the input focus, though I haven’t actually tested this out.

I don’t think its mandatory, but it’s a good idea to set it so the user doesn’t have to click on a field before he starts typing. If you do include it, then you have to have a valid component on the page to point to.

If you fix it, does the Hot Deploy work? If it translate the page properly, then that might cause a problem with the deployment. I’d be surprised, but it’s possible I suppose.

Now it’s crystal clear.
The problem with Hot Deploy is that doesn’t start every time when I open/reopen/run/ the application. It’s very disturbing because when I make some change in the logic, doesn’t work (takes the old state).
However now I check a System.out.println(“blabla”) - or modify a notification, in order to be sure that HD is started. After the Hot Deploy starts the new changes seems to work.
Ctrl+S does nothing.

Thank you!!

Hi,
Please check that your project doesn’t define custom tomcat dir in the build.gradle script.
It will break hot deploy. You may safely delete custom tomcat dir definition.
See this ticket for more information: https://youtrack.cuba-platform.com/issue/STUDIO-8372

Hi,

Yes I have

  tomcat {
        dir = "$project.rootDir/deploy/tomcat"
    }

What should I delete more exactly?

You can delete the whole piece of code you have quoted.

It works even worse.
I put it back.

Not sure why it didn’t work for you, without additional information.
According to the debug logs you’ve presented previously, hot-deployed files are successfully compiled and copied to the appropriate location in the app_home:

2020-06-19 09:33:02,197 [5450207]  DEBUG - lij.hotdeploy.HotDeployService - Copied compiled files from /home/me/Work/myprojet/myprojet/modules/web/build/hotDeployClasses to /home/me/Work/myprojet/myprojet/deploy/app_home/myprojet/conf 

So as I can see, the other part of the hot deploy works as intended. You just should change tomcat directory, and probably execute undeploy / deploy build tasks and restart debug server.

I’ll just let other users know that with custom tomcat directory in the build.gradle like presented above - hot deploy won’t work. New projects created by Studio don’t have this setting specified.
If anyone encounters hot deploy problems, they should check for custom tomcat dir.