cancel
Showing results for 
Search instead for 
Did you mean: 

Autowired not working with custom service bean for activiti custom REST API application.

justinwazhang
Champ in-the-making
Champ in-the-making

Hello, I am new to activiti, and is in the process of trying to develop a Activiti custom REST application, but I get the famous "No qualifying bean of type 'com.activiti.extension.service.TranslationService' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}" .  when I am issuing the rest call through Postman after I deployed the jar under the web-inf/lib folder for activiti-app in tomcat and restart the activiti-app.  It is very simple Spring app as follows:

1: Introduce a @RestController class, inside it has

@RestController
public class
TranslationStatusController {
    private static Logger logger = (Logger) LoggerFactory.getLogger(TranslationStatusController.class);

    @Autowired
    TranslationService translationService;

.....

2:  The TranslationService is in package com.activiti.extension.service.TranslationService, and is annotated with @Service, it is just a regular spring service class

3: There is a spring boot app

@SpringBootApplication
@EnableAutoConfiguration
public class App {

....

 

Very simple spring boot application, the problem is why 

 com.activiti.extension.service.TranslationService is not automatically picked up? 

Thank you in advance.

 



1 REPLY 1

paiyyavj13
Star Contributor
Star Contributor

Make sure the Java class you have written is inside the package: "com.activiti.extension.bean"

The injections are automatically picked by Activiti if the class is within this package.

Regards.