Using Jmix 1.4.4 and getting errors on @Autowired annotation in my controllers

I have an original Jmix project (not using Flow UI but classic UI) and I have been seeing annotation @Autowired instead of @Inject whenever I inject a control into my controllers.

Although the code still runs, I am seeing where the @Autowired annotation appears in red with the following message:

Autowired members must be defined in valid Spring bean (@Component|@Service|...)

I also notice that whenever I change my code, the changes are not reflected unless I logout, restart or try alot of random changes. Debugging code also seems like my code is out of sync with what is running.

I am not sure what is going on.

Does anyone have any idea ?

Those are separate problems.

The first one is just an inspection from IntelliJ Ultimate and you can safely ignore it (or disable at all).

The second is probably about hot deploy. Check that you use the latest Studio, and remove build and .jmix/conf directories. Check also that when you change something in UI and the app is running, there are messages about hot deploy in the console.

3 Likes

Yes. Thank you! I (still rookie by now…) had the same problem, no idea for long. Glad I found this post.
How could we assume this solution?

Which one? With warnings or hot deploy?

Hi! I tried to understand and solve the @Autowired warning and had a not working simple ‘notification.create while null’ runtime error. Didn’t know (still unsure) when and why to delete the build folder.
(But maybe these are all beginner’s questions, because I had my mind set to Visual Basic for the last 20 years and just started the Java way at all… Thank you :wink: )