Hi Team, making good progress on upgrading our app...
# questions
n
Hi Team, making good progress on upgrading our app to Grails 7.0.0 today. Currently running into this exception with grails-mail. Has anyone experienced the following stacktrace using grails-mail:5.0.2? Error creating bean with name 'mailService' defined in class path resource [grails/plugins/mail/MailAutoConfiguration.class]: Unsatisfied dependency expressed through method 'mailService' parameter 1: Error creating bean with name 'mailMessageBuilderFactory' defined in class path resource [grails/plugins/mail/MailAutoConfiguration.class]: Unsatisfied dependency expressed through method 'mailMessageBuilderFactory' parameter 1: Error creating bean with name 'mailMessageContentRenderer' defined in class path resource [grails/plugins/mail/MailAutoConfiguration.class]: Unsatisfied dependency expressed through method 'mailMessageContentRenderer' parameter 0: Error creating bean with name 'groovyPagesTemplateEngine': Cannot resolve reference to bean 'gspTagLibraryLookup' while setting bean property 'tagLibraryLookup'
u
It seems likely that grails-mail:5.0.2 is not compatible with Grails 7.0.0, as all plugins must be updated for Grails 7 due to major changes like the javax → jakarta transition. The recommended version for Grails 7 is org.grails.pluginsgrails mail5.0.1, and using older or incompatible plugin versions can cause bean creation errors like the one you’re seeing. You should ensure you are using the correct plugin version and that all your plugins are updated for Grails 7. If a compatible version is not available, you may need to wait for an update or reach out to the plugin maintainer. See the discussion and guidance at Grails mail plugin issue and the general upgrade notes at Grails 7 upgrade guide. Would you like more detail on troubleshooting or plugin migration? Sources: - Grails mail plugin issue - Grails 7 upgrade guide 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
u
A message from kapa.ai
u
The stacktrace you’re encountering—specifically, the error with
mailMessageContentRenderer
and
groovyPagesTemplateEngine
failing to resolve `gspTagLibraryLookup`—is a known issue when upgrading to Grails 7 if you are using plugins that are not yet compatible with Grails 7. From the knowledge sources, similar errors have been reported when plugins such as
grails-web-console
or
formfields
are not updated for Grails 7 compatibility. The root cause is often that these plugins depend on internal APIs or beans (like GSP tag libraries or codec lookups) that have changed or moved in Grails 7, resulting in bean creation failures and
NoSuchFieldError
or
IllegalArgumentException
exceptions during application startup. For example, the
formfields
plugin and others have triggered nearly identical stacktraces when not updated for Grails 7, especially around GSP and codec beans[Github Issue: Grails 7 support](https://github.com/apache/grails-spring-security/issues/1156). grails-mail:5.0.2 is not listed among the plugins updated for Grails 7 in the official release notes. The Grails 7.0.0-M3 and M1 announcements list many plugins that have been updated, but
grails-mail
is not among them, suggesting that version 5.0.2 is not Grails 7 compatible at this time[Blog: Grails 7.0.0-M3 Release Announcement](https://grails.apache.org/blog/2025-03-05-grails-7-m3.html). What you can do: - Check if a Grails 7 compatible version of
grails-mail
has been released. If not, you may need to wait for an update or look for a maintained fork. - Remove or comment out the
grails-mail
dependency to confirm that the application starts without it, verifying that the incompatibility is isolated to this plugin. - Review all other plugins for Grails 7 compatibility, as any outdated plugin can cause similar bean creation issues. Summary: The error is due to
grails-mail:5.0.2
not being compatible with Grails 7. You will need to wait for an updated version of the plugin or seek alternatives. All plugins must be Grails 7 compatible to avoid these bean creation errors[Github Issue: Grails 7 support](https://github.com/apache/grails-spring-security/issues/1156). If you need to proceed urgently, consider downgrading to a supported Grails version or removing the mail functionality until a compatible plugin is available.
u
An alternative approach to resolve the issue with
grails-mail:5.0.2
in Grails 7.0.0 is to consider using dependency management to override conflicting dependencies or explore alternative email solutions. According to [Grails mail plugin issue](https://github.com/apache/grails-core/issues/15059), the recommended version for Grails 7 is
org.grails.plugins:grails-mail:5.0.1
. However, if you need to use
grails-mail:5.0.2
, you can try excluding conflicting dependencies or forcing specific versions of dependencies that align with Grails 7. For example, you can use Gradle's
dependencyManagement
block to ensure compatibility:
Copy code
groovy dependencyManagement {     dependencies {         dependency 'javax.mail:mail:1.6.2'     } }
Alternatively, you could consider using a different email solution altogether, such as Spring's
JavaMailSender
directly, which might provide more flexibility and avoid plugin-specific issues. This approach would require additional configuration but could be a more stable solution if plugin compatibility remains problematic. If you would like to explore these options further, let me know, and I can provide more detailed guidance. Sources: - [Grails mail plugin issue](https://github.com/apache/grails-core/issues/15059)
l
@ngraff - At the risk of disputing the LLMs that seem to now be frequenting this place -- I have found the "org.grails.pluginsgrails mail5.0.2" version of the email plugin to work fine with grails 7.0.0
Have you included "org.apache.grails:grails-gsp"?
t
A 5.0.3 version was released yesterday using the final Grails 7.0.0 version. The project contains an example project maybe diff that with your project to see if any config is missing: testapp1 If you still have issues you can open an issue
n
Thank you Thomas! I will take a look when I get a chance