Unable to Autowire in Service Task java class

cancel
Showing results for 
Search instead for 
Did you mean: 
sachinhavinal
Member II

Unable to Autowire in Service Task java class

Hi,

I am using spring boot with activiti. I have created a simple workflow which is having a single service task ans assigned a java class to this service class. I have one JpaRepository which I am autowiring it in this delegate class. When I start the process, then I am getting NullPointerException on this repository. I think, its not able to get initialized in JavaDelegate class. But I did the same thing in my other service classes and controller classes too and its getting initialized properly. So, is there any way to solve this issue?

4 Replies
jearles
Established Member II

Re: Unable to Autowire in Service Task java class

Sachin,

Could you provide more detailed code snippets? or a unit test that shows this problem?
It's a fairly common thing to not have injections/autowiring fail for some configuration oddity, but that all depends on the configuration.

-JEarles

sachinhavinal
Member II

Re: Unable to Autowire in Service Task java class

It's working. Thanks for the help.

kgastaldo
Senior Member

Re: Unable to Autowire in Service Task java class

Hey ‌ - Can you tell us how you resolved? 

sachinhavinal
Member II

Re: Unable to Autowire in Service Task java class

Hey, I have created a service wrapper around the repository class and autowired the wrapper class in delegate class.