samedi 4 avril 2015

Broadleaf - Issue with Custom Activity in Extended Workflow

I have implemented an extension to Order Workflow by adding a new Activity. I need this Activity to use a new Service (ExtInterfaceService) that I implemented in core.


The issue is I am able to Inject ExtInterfaceService into several other Controllers and other Services, but as soon as I add it to my new Activity, the server fails to start with the Exception:



Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'extInterfaceService' is defined.


I don't see how it is able to auto-wire other controllers/services and not Workflow activity. By the way, this is how I have defined my service.



@Service("extInterfaceService")
public class ExtInterfaceServiceImpl implements ExtInterfaceService


I even went to the extent of wiring it by hand by doing the following in both one of the controllers (using this service) as well as my extended activity to see the difference:



context.getBean("extInterfaceService",ExtInterfaceService.class);


I have noted that the context object is different in Controller and Activity. The bean is found in the context retrieved in Controller, but the context in Activity does not have this bean! How can that be possible?


If I create a new instance of the object manually, the application works fine. I am totally lost with the magic happening behind the scenes.


Aucun commentaire:

Enregistrer un commentaire