我在WEB模块下新建了一个自己类并给SPRING托管,我想注入GUI包中的Notifications,但是Spring无法找到这个类,求助
1、建立类如下:
import com.haulmont.cuba.core.global.Messages;
import com.haulmont.cuba.gui.Notifications;
import org.springframework.stereotype.Component;
import javax.inject.Inject;
@Component(NotificationUtil.NAME)
public class NotificationUtil {
public static final String NAME = “lims_NotificationUtil”;
@Inject
private Notifications notifications;
@Inject
private Messages messages;
}
2、启动的时候报错如下:
Error creating bean with name ‘lims_NotificationUtil’: Unsatisfied dependency expressed through field ‘notifications’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘com.haulmont.cuba.gui.Notifications’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@javax.inject.Inject()}
3、类里注入的Message是没问题的,注入Notifications就报错了
请问这该怎么解决?