Skip to content

NoUniqueBeanDefinitionException with service extending PdfRenderingService in Grails 3 #34

@timbonicus

Description

@timbonicus

I have a project where we needed to override the pdfRenderingService behavior slightly, so we added a Grails service extending PdfRenderingService named "FixedPdfRenderingService". This causes an error on startup:

NoUniqueBeanDefinitionException: No qualifying bean of type 'grails.plugins.rendering.pdf.PdfRenderingService' available: expected single matching bean but found 2: renderingPdfRenderingService,fixedPdfRenderingService

It seems that in Grails 3.2.4, plugin service beans get prefixed by the plugin name, so "pdfRenderingService" from the rendering plugin becomes "renderingPdfRenderingService". I'm not sure if this is causing problems with @Autowire directly, or whether having two beans with this type causes a non-unique exception.

Should RenderingTrait specify rendering*Service instead? Is there a different way we should be overriding PdfRenderingService behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions