cancel
Showing results for 
Search instead for 
Did you mean: 

CAP Java: No qualifying bean of type 'com.sap.cds.services.draft.DraftService' available

09-08-2025 7:11 AM
DinhNguyen1 Associate
1007 views 1 comments
0 Likes
SAP Managed Tags
Subscribe

Hi,
I enable odata.draft.enabled in my 2 services: 

[srv.invoice.archive.InvoiceArchiveConfigService, srv.invoice.form.CreateInvoiceUIService]
 
But when I start the service I failed due to error
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'queryExecutorImpl' defined in URL: Unsatisfied dependency expressed through constructor parameter 1: No qualifying bean of type 'com.sap.cds.services.draft.DraftService' available: more than one 'primary' bean found among candidates: [srv.invoice.archive.InvoiceArchiveConfigService, srv.invoice.form.CreateInvoiceUIService]

How to fix the conflict DraftService bean?
0 Likes

Accepted Solutions (0)

Answers (1)

Answers (1)

Steve36
Explorer
0 Likes

This means the service srv.invoice.archive.InvoiceArchiveConfigService and srv.invoice.form.CreateInvoiceUIService has @odata.draft.enabled annotation. The problem here is the database couldn't understand which draft is used for which. To solve this issue, specify the draft service with @Qualifier annotation and the parameter be the service's name.

@Autowired
@Qualifier("InvoiceArchiveConfigService")
private DraftService invoiceArchiveDraftService;