Unable to find an instance of type 'class XxxService' named 'xxxService' for instance of 'XxxScreen'

Hi
This screen used to work, no changes have been done nor on screen, nor on the service.
This service also works when called from uit tests/other services.
Relevant stack trace

	at io.jmix.ui.sys.UiControllerDependencyInjector.doInjection(UiControllerDependencyInjector.java:487)
	at io.jmix.ui.sys.UiControllerDependencyInjector.injectValues(UiControllerDependencyInjector.java:259)
	at io.jmix.ui.sys.UiControllerDependencyInjector.inject(UiControllerDependencyInjector.java:96)
	at io.jmix.ui.sys.UiControllerDependencyManager.inject(UiControllerDependencyManager.java:61)
	at io.jmix.ui.sys.ScreensImpl.createScreen(ScreensImpl.java:212)
	at io.jmix.ui.sys.ScreensImpl.create(ScreensImpl.java:145)
	at io.jmix.ui.menu.MenuItemCommands$ScreenCommand.createScreen(MenuItemCommands.java:230)
	at io.jmix.ui.menu.MenuItemCommands$ScreenCommand.run(MenuItemCommands.java:169)
	at io.jmix.ui.menu.SideMenuBuilder$MenuCommandExecutor.accept(SideMenuBuilder.java:272)
	at io.jmix.ui.menu.SideMenuBuilder$MenuCommandExecutor.accept(SideMenuBuilder.java:257)
	at io.jmix.ui.component.mainwindow.impl.SideMenuImpl$MenuItemImpl.menuSelected(SideMenuImpl.java:587)

The service is defined like this

@Component("HAD_TransactionService")
public class TransactionService {

and the screen reference is generated by the Inject feature of the IDE and looks like this

    @Autowired
    private TransactionService transactionService;

This happens for the 2 services used I have in my project. The other JMIX injected classes work fine like the BPMN, the TimeSource and so on.

No notable changes (that I could see) except upgrade from 1.4.1 to 1.4.4. But rollback to 1.4.1 did not changed anything.

What am I missing here? Why is JMIX trying to do the injection instead of Spring?

I must have changed somthing, but I fail to see what.
Any help is more than welcome :wink:
Thanks

Thierry

Hi Thierry,

Try to remove .jmix/conf and build folders in your project. The error like this is usually caused by leftovers of a previous hot deploy. Check also that you have “Clean Hot Deploy Conf Directory” task in your run/debug configuration.

Screen controllers and UI components are not Spring beans, so the wiring is done by Jmix.

Regards,
Konstantin

1 Like

Hi @krivopustov

Thanks a lot, that indeed solved th issue.

Wouldn’t it make sense to add this cleanup of the folder part of the gradle clean task?
When something odd happens, this is one of the first thing I do to return to a “clean” state.
Shout it also delete the “out” folder?

Thanks!
Thierry