在Glassfish4上部署Grails 2.5.1应用程序时出错

时间:2017-09-19 16:06:02

标签: spring grails glassfish

您正在尝试在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') }
 }

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

1 个答案:

答案 0 :(得分:0)

当我将groovy-all-xxx.jar添加到glassfish/domains/MYDOMAIN/lib/ext

时,错误消失了