嗨,当我尝试在grails 2.5.1上部署glassfish 4应用程序时,发生以下错误,而在运行应用程序时却无法显示此错误

java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationFailureListener': Cannot resolve reference to bean 'loginAttemptsService' while setting bean property 'loginAttemptsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'loginAttemptsService': Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: groovy/lang/GroovyObject
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)

这是它的抱怨:
class AuthenticationFailureListener implements ApplicationListener<AuthenticationFailureBadCredentialsEvent > {
def loginAttemptsService

@Override
public void onApplicationEvent(AuthenticationFailureBadCredentialsEvent e) {
    loginAttemptsService.failLogin(e.authentication.name)
}

}

如果发现我在resources.groovy中评论了以下内容时,便能够成功进行部署。
beans = {

authenticationFailureListener(AuthenticationFailureListener) { loginAttemptsService = ref('loginAttemptsService') }
authenticationSuccessEventListener(AuthenticationSuccessEventListener) { loginAttemptsService = ref('loginAttemptsService') }
 }

我看不到任何错误,任何建议

最佳答案

当我将groovy-all-xxx.jar添加到glassfish/domains/MYDOMAIN/lib/ext时,错误消失了

关于spring - 在Glassfish4上部署Grails 2.5.1应用程序时出错,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/46305066/

10-14 05:33