使用异步邮件插件运行或配置grails应用程序时出错会抛出异常

时间:2014-06-26 06:54:38

标签: spring email grails asynchronous grails-2.3

我想将grails 异步邮件:1.0 插件集成到我的应用程序中,因为我已将以下内容添加到我的构建配置中 编译“:异步邮件:1.0”

之后,因为我试图通过以下例外运行应用程序失败

| Error 2014-06-26 11:49:55,958 [localhost-startStop-1] ERROR context.GrailsContextLoader  - Error initializing the application: Error creating bean with name 'nonAsynchronousMailService': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'grailsApplication' of bean class [grails.plugin.mail.MailService]: Bean property 'grailsApplication' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Message: Error creating bean with name 'nonAsynchronousMailService': Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'grailsApplication' of bean class [grails.plugin.mail.MailService]: Bean property 'grailsApplication' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
Line | Method
->>  262 | run       in java.util.concurrent.FutureTask

|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    745 | run       in java.lang.Thread
Caused by NotWritablePropertyException: Invalid property 'grailsApplication' of bean class [grails.plugin.mail.MailService]: Bean property 'grailsApplication' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
->>  262 | run       in java.util.concurrent.FutureTask

|   1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Worker
^    745 | run       in java.lang.Thread
| Error Forked Grails VM exited with error

如果我删除 编译“:异步邮件:1.0” 来自build-config.groovy 应用运行良好 grails版本2.3.9或异步邮件插件有什么问题

异步邮件插件中的功能似乎真的很好并且想要使用它

我正在使用以下插件,但它们工作正常

    build ":tomcat:7.0.53"
    // plugins for the compile step
    compile ":scaffolding:2.0.3"
    compile ':cache:1.1.2'         
    runtime ":hibernate:3.6.10.15" // or ":hibernate4:4.3.5.2"
    runtime ":database-migration:1.4.0"
    runtime ":jquery:1.8.3"
    runtime ":resources:1.2.8"     

    compile ':cache:1.0.1'
    compile ':spring-security-core:2.0-RC2'
    runtime ":email-confirmation:2.0.8"

    provided ":codenarc:0.21"

    compile (":postgresql-extensions:0.9.0") {
        excludes "hibernate"
    }

    compile ":browser-detection:0.4.3"

任何遇到此问题的人都请帮忙 提前谢谢

3 个答案:

答案 0 :(得分:0)

您使用的是JDK上的哪个版本?

尝试升级您的石英,邮件和放大器spring security core plugin。

compile ":quartz:1.0.2"
compile ":mail:1.0.5", {
    excludes 'spring-test'
}
compile ':spring-security-core:2.0-RC3'

清理后重新启动grails插件。

答案 1 :(得分:0)

plugin docs说它已迁移到石英插件。它还取决于休眠,石英和邮件插件。停止服务器,包括剩余的依赖项,然后从IDE刷新依赖项,然后尝试通过grails clean。

暂时请删除电子邮件确认,刷新,清理,然后尝试单独配置这些插件。首先使异步邮件工作,然后转到电子邮件确认。 即异步后重新排序电子邮件确认。

答案 2 :(得分:0)

您可以排除电子邮件确认的邮件和石英的依赖关系

runtime ":email-confirmation:2.0.8" {
    excludes 'mail', 'quartz'
}

尝试使用最新的候选发布版:asynchronous-mail:1.1-RC1