Skip to content

Setup instructions, missing dependency? #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bmaupin opened this issue Apr 24, 2025 · 1 comment
Open

Setup instructions, missing dependency? #73

bmaupin opened this issue Apr 24, 2025 · 1 comment

Comments

@bmaupin
Copy link

bmaupin commented Apr 24, 2025

I went through the documentation but I didn't see anything about how to actually set up this plugin. I added

dependencies {
    implementation "org.grails.plugins:mail:4.0.1"
}

to build.gradle under dependencies. Some specific questions I have:

  1. Do I also need to add this? I see some other plugins have it but I don't know what purpose it serves:

    buildscript {
        dependencies { // Not Published to Gradle Plugin Portal
            classpath "org.grails.plugins:mail:4.0.1"
        }
    }
  2. When running a fresh Grails 6 app I get this error:

    2025-04-23 16:26:04.382  WARN --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mailMessageBuilderFactory' defined in grails.plugins.mail.MailConfiguration: Unsatisfied dependency expressed through method 'mailMessageBuilderFactory' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mailMessageContentRenderer' defined in grails.plugins.mail.MailConfiguration: Unsatisfied dependency expressed through method 'mailMessageContentRenderer' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'org.grails.gsp.GroovyPagesTemplateEngine' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
    2025-04-23 16:26:04.423  INFO --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
    2025-04-23 16:26:04.436  INFO --- [           main] ConditionEvaluationReportLoggingListener : 
    
    Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
    2025-04-23 16:26:04.445 ERROR --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 
    
    ***************************
    APPLICATION FAILED TO START
    ***************************
    
    Description:
    
    Parameter 0 of method mailMessageContentRenderer in grails.plugins.mail.MailConfiguration required a bean of type 'org.grails.gsp.GroovyPagesTemplateEngine' that could not be found.
    
    
    Action:
    
    Consider defining a bean of type 'org.grails.gsp.GroovyPagesTemplateEngine' in your configuration.
    

    I was able to fix it by adding this:

    dependencies {
        implementation "org.grails.plugins:gsp"
    }

I'm not sure if that's the proper fix as I'm not very familiar with Grails so rather than relying on trial and error I would much prefer to have documentation.

Assuming that is the proper fix and that this plugin depends on org.grails.plugins:gsp, is it possible to add a dependency on that package to prevent the error altogether?

Thanks!

@matrei
Copy link
Contributor

matrei commented Apr 30, 2025

Thank you @bmaupin! Good catch!
We need to add a runtime dependency on org.grails.plugins:gsp for the GroovyPagesTemplateEngine and GroovyPagesUriService beans to be registered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants