0
Set an example bean:
@Component
public class SimulationModelFactory {
and within the class I am injecting my service example:
@Autowired
private SimulationFlowService simulationFlowService;
Service always stays null
0
Set an example bean:
@Component
public class SimulationModelFactory {
and within the class I am injecting my service example:
@Autowired
private SimulationFlowService simulationFlowService;
Service always stays null
0
The annotation @Autowired
will try to inject some class that implements the interface SimulationFlowService
(or the classes themselves).
Note that your class SimulationModelFactory
is neither. Try to write down @Component
in a class that implements the interface.
Browser other questions tagged java spring
You are not signed in. Login or sign up in order to post.
Simulationflowservice is not an interface is a service.
– Jose Vieira Neto
Right, but he’s different from
SimulationModelFactory
. Write him down with@Component
.– josivan
It worked! thank you very much but I still don’t understand very well why it didn’t work with @service.
– Jose Vieira Neto
@Josevieiraneto, if it was noted with
@Service
should work smoothly. If you’re sure it was just this change, I can’t explain it to you =).– josivan
that’s all I’ve changed :|
– Jose Vieira Neto
Check your configuration. No stackoverflow.with in English has a similar problem to your.
– josivan