Error injecting Service into an @component

0

Set an example bean:

@Component
public class SimulationModelFactory {

and within the class I'm injecting my service example:

@Autowired
private SimulationFlowService simulationFlowService;

Service always gets null

    
asked by anonymous 09.03.2016 / 18:44

1 answer

0

The @Autowired annotation will try to inject some class that implements the interface SimulationFlowService (or the classes itself).

Note that your SimulationModelFactory class is neither. Try to write @Component to a class that implements the interface.

    
09.03.2016 / 18:47