AnsweredAssumed Answered

Injecting UserService and UserCache yields NullPointerException

Question asked by miniscem on Feb 21, 2017
Latest reply on Feb 22, 2017 by miniscem

Hello, 

 

What is the proper way to inject the UserService and UserCache spring beans via spring annotations? This question: Injecting UserService yields Null  addresses it using xml configuration, but how does this translate to annotations? 

 

Are there contexts I cannot inject the UserService and UserCache objects into my code? Are there best practices? I'm experiencing some inconsistency with injecting the activiti provided beans. I am able to inject the bean into a class that implements BootstrapConfigurer (as a private autowired instance member variable) but not in a class that lies within the com.actviti.extension.bean class (attempting to inject as as an autowired, protected member variable). The class is annotated with @Service but does not extend or implement any classes. 

 

Any help would be appreciated. 

Outcomes