Cannot @autowire in components JMix v2

I can’t inject JMix infrastructure Beans into my @Component bean in my v2 project. When I use the Inject menu to insert DataManager it insert this code;

@Component(“someclass”)
public class someclass
private final DataManager dataManager;

 public someclass(DataManager dataManager) (
       this.dataManager = dataManager;
. . .

If I hand code;
@Autowire
Private DataManager dataManager

On init the dataManager is NULL.

Your code looks correctly. It is correct using of “constructor injection”.

Please could you send us with your project in zip archive or on gitHub if problem is reproducing.

Problem is not reproducing.
image

Thanks.

Hello,

It should be lowercase “private” or was that a typo?

@Autowire
private DataManager dataManager

Kind regards,
Mladen

In case of using default constructor for injection the @Autowired annotation is not necessary.
https://docs.spring.io/spring-framework/reference/core/beans/dependencies/factory-collaborators.html#beans-constructor-injection

Yes, “Private” was a typo it is “private”.
I ran some tests. So I seem to have an environmental issue with IntelliJ. Even if I create a new Jmix v1 or v2 project I have this issue. I even have this issue opening an existing Jmix project that was fine. I even have 2 laptops I work off of and they both have this issue. So I assume the configuration change happened via a Git update for one laptop to another or unless JMix update jacked something up.

I tried creating a zip of an empty Jmix project that shows it this issue. But the zip file was 8M but your upload is limited to 4M.

BTW I agree the non @Autowired approach is providing instance.

Here is my Github account: GitHub - FredZim/Test. It is an simply Jmix with 2 Beans in it.