在 Glassfish4 上部署 Grails 2.5.1 应用程序时出错
Error while deploying Grails 2.5.1 application on Glassfish4
嗨,当我尝试在 glassfish 4
上部署 grails 2.5.1
应用程序时,出现了以下错误,而我无法在 运行 应用程序
上出现此错误
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.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.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.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.access00(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
时错误消失了
嗨,当我尝试在 glassfish 4
上部署 grails 2.5.1
应用程序时,出现了以下错误,而我无法在 运行 应用程序
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.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.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.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.access00(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