org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'robustaWorkerServiceImpl':

hello,
i defined new service on ADMIN-UI. when i want to run app, i get error about dependencies. How can i define dependencies between different package ? how can i fix this problem ?

package org.flowable.ui.admin.service;

import org.flowable.idm.api.RobustaWorkerDefinitionService;
import org.springframework.beans.factory.annotation.Autowired;

/**

  • @author Egemen ALAN
    */
    public class RobustaAbstractWorkerService {

    @Autowired
    protected RobustaWorkerDefinitionService robustaWorkerDefinitionService ;


package org.flowable.idm.api;

import java.util.List;
public interface RobustaWorkerDefinitionService {

package org.flowable.ui.admin.service;

@Service
@Transactional
public class RobustaWorkerServiceImpl extends RobustaAbstractWorkerService implements RobustaWorkerService {

2019-03-19 16:25:19.310 WARN 15556 — [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘robustaWorkerServiceImpl’: Unsatisfied dependency expressed through field ‘robustaWorkerDefinitionService’; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type ‘org.flowable.idm.api.RobustaWorkerDefinitionService’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
2019-03-19 16:25:19.343 INFO 15556 — [ restartedMain] o.a.c.c.StandardService : Stopping service [Tomcat]
2019-03-19 16:25:19.372 INFO 15556 — [ restartedMain] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ enabled.
2019-03-19 16:25:20.779 ERROR 15556 — [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

Field robustaWorkerDefinitionService in org.flowable.ui.admin.service.RobustaWorkerServiceImpl required a bean of type ‘org.flowable.idm.api.RobustaWorkerDefinitionService’ that could not be found.

The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)

Action:

Consider defining a bean of type ‘org.flowable.idm.api.RobustaWorkerDefinitionService’ in your configuration.

Hi Egemen,

It looks like your trying to autowire a bean which isn’t available on the context when creating the @service.
It needs to be in package that is part of a component scan or the bean needs to be created explicitly.

It’s cool to see that you’re working with the Flowable codebase. But it seems that the problems you encounter aren’t really Flowable (API) specific but more generic Java / Spring.
Is there someone that can help you with this?

Regards,

Yvo

Hi yvo, How are you?
yes you sure. problems about Spring. I compare my code with IDM user services. Everything is same. Just i didnt understand where is my wrong :worried: Like a,

  • @author Joram Barrez
    */
    public class AbstractIdmService {

    @Autowired
    protected IdmIdentityService identityService;

}

Hi Egemen,

I suggest you start by reading some intro into Spring and Spring Boot documentation.
It will be nearly impossible to implement feature in Flowable Admin without some basic knowledge about concepts used in Spring.
Spring’s own documentation is very good. But there are also lots of other resources available.

Regarding this issue;
https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-spring-beans-and-dependency-injection.html

Have fun.

Regards,

Yvo

Thank you for all information.
I need just 1 important information. Before i already asked you. I have to define new panel like IDM-Users (create-update-delete-list) page. My module will do create new Robot definitions, List robots list, delete robots definitions etc… it will work like a schedule jobs .

My question, is ADMIN-UI right place for this (architectural) ? How can i manage dependencies between Admin and IDM if i define on ADMIN-UI?

thank you