Skip to Content
Dec 13, 2018 at 11:00 AM

getting org.springframework.beans.factory.BeanNotOfRequiredTypeException even though the imported workflowService is from correct package


Hi Experts,

We have a requirement where we need to create a workflow based on few values we receive from a web service call. In my Service class I wrote below piece of code to create the work flow from workflow template after referring a trail from hybris wiki.

if(productModel.getChannelIndicator().getCode().equalsIgnoreCase("OFFLINE")); {

        // start the dropcode workflow for the product
         final WorkflowTemplateModel workflowTemplate = this.workflowTemplateService

      final WorkflowModel workflow = workflowService.createWorkflow(workflowTemplate, productModel, userService.getAdminUser());
     for (final WorkflowActionModel action : workflow.getActions())



The build is successful in my local. But when I started my hybris server I am getting below exception:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultProductDropCodeWebService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'workflowService' is expected to be of type 'de.hybris.platform.workflow.WorkflowService' but was actually of type ''

In my service class I have added WorkflowService as a dependency along with other required services as shown below:

 private WorkflowService workflowService;
 private WorkflowTemplateService workflowTemplateService;
 private WorkflowProcessingService workflowProcessingService;
 private ModelService modelService;
 private UserService userService;

I have declared my Service Class in core-spring.xml as shown below:

 <bean id="defaultProductDropCodeWebService"

in my service class I have below import statement for WorkflowService:

import de.hybris.platform.workflow.WorkflowService;

Finally my build is failing even though I setup proper dependencies with proper imports.

Can you please check and suggest why this issue is coming. Your prompt reply on this would be truly appreciated.