grails run-war 错误

发布于 2024-12-12 00:53:56 字数 1823 浏览 0 评论 0 原文

我有 grails 应用程序,并且在执行 run-app 时 - 一切正常!但是之后: grails run-war ,我收到以下错误:

 
Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'd1LdapServer': Invocation of init method failed; nested exception is groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.io.File#.

Cannot resolve which method to invoke for [null, class java.lang.String] due to overlapping prototypes between:

    [class java.io.File, class java.lang.String]

    [class java.lang.String, class java.lang.String]

    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

    at java.util.concurrent.FutureTask.run(FutureTask.java:138)

    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

    at java.lang.Thread.run(Thread.java:662)

Caused by: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.io.File#.

Cannot resolve which method to invoke for [null, class java.lang.String] due to overlapping prototypes between:

    [class java.io.File, class java.lang.String]

    [class java.lang.String, class java.lang.String]

    at grails.ldap.server.TransientGrailsLdapServer.getWorkDir(TransientGrailsLdapServer.groovy:265)

    at grails.ldap.server.TransientGrailsLdapServer.startDirectoryService(TransientGrailsLdapServer.groovy:208)

    at grails.ldap.server.TransientGrailsLdapServer.start(TransientGrailsLdapServer.groovy:79)

    at grails.ldap.server.TransientGrailsLdapServer.afterPropertiesSet(TransientGrailsLdapServer.groovy:67)

感谢任何帮助。谢谢!

I have grails application and when doing run-app - all ok! But after: grails run-war, i get following a errors:

 
Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'd1LdapServer': Invocation of init method failed; nested exception is groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.io.File#.

Cannot resolve which method to invoke for [null, class java.lang.String] due to overlapping prototypes between:

    [class java.io.File, class java.lang.String]

    [class java.lang.String, class java.lang.String]

    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

    at java.util.concurrent.FutureTask.run(FutureTask.java:138)

    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

    at java.lang.Thread.run(Thread.java:662)

Caused by: groovy.lang.GroovyRuntimeException: Ambiguous method overloading for method java.io.File#.

Cannot resolve which method to invoke for [null, class java.lang.String] due to overlapping prototypes between:

    [class java.io.File, class java.lang.String]

    [class java.lang.String, class java.lang.String]

    at grails.ldap.server.TransientGrailsLdapServer.getWorkDir(TransientGrailsLdapServer.groovy:265)

    at grails.ldap.server.TransientGrailsLdapServer.startDirectoryService(TransientGrailsLdapServer.groovy:208)

    at grails.ldap.server.TransientGrailsLdapServer.start(TransientGrailsLdapServer.groovy:79)

    at grails.ldap.server.TransientGrailsLdapServer.afterPropertiesSet(TransientGrailsLdapServer.groovy:67)

Any help is appreciated. Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

王权女流氓 2024-12-19 00:53:56

在 tomcat 上部署时,“ldap-server”插件也有同样的问题。
对我来说,修复方法是通过 ApplicationHolder 提供 servletContext

ServletContextHolder.servletContext

使用:

ApplicationHolder.application.parentContext.servletContext

TransientGrailsLdapServer.getWorkDir() 的完整源代码:

import org.codehaus.groovy.grails.commons.ApplicationHolder

private getWorkDir() {      
    def base = ApplicationHolder.application.parentContext.servletContext ? WebUtils.getTempDir(ApplicationHolder.application.parentContext.servletContext) : new File(BuildSettingsHolder.settings?.projectWorkDir, beanName)
    new File(base, "ldap-servers/$beanName")
}

Had the same problem with the "ldap-server" plugin when deploying on a tomcat.
For me the fix was to provide the servletContext via the ApplicationHolder

instead:

ServletContextHolder.servletContext

use:

ApplicationHolder.application.parentContext.servletContext

full source for the TransientGrailsLdapServer.getWorkDir():

import org.codehaus.groovy.grails.commons.ApplicationHolder

private getWorkDir() {      
    def base = ApplicationHolder.application.parentContext.servletContext ? WebUtils.getTempDir(ApplicationHolder.application.parentContext.servletContext) : new File(BuildSettingsHolder.settings?.projectWorkDir, beanName)
    new File(base, "ldap-servers/$beanName")
}
巷雨优美回忆 2024-12-19 00:53:56

行中的基本参数为 null 引起的

new File(base, "ldap-servers/$beanName")

该问题是由grails.ldap.server.TransientGrailsLdapServer.getWorkDir() 中的

,这表明配置问题,也许存在一些问题您的环境之间的差异导致基本参数为空?

The problem is caused by the base argument being null in the line

new File(base, "ldap-servers/$beanName")

in grails.ldap.server.TransientGrailsLdapServer.getWorkDir()

This points to a configuration issue, perhaps there is some difference between your environments that is causing the base argument to be null?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文