首先,我已经开始通过这些 URL 将 spring-security-ui 安装到我的 grails 应用程序中。
和 ...
我已经安装了 spring-security-core 并在我的应用程序上工作。我能够为 gsp 元素以及控制器操作创建所有访问控制。就这样完成了。现在,我的要求是提供一个 UI 来管理用户、角色和访问权限,以便一些管理员可以轻松使用它。
注意:在集成 spring-security-core 时,我选择了域类 SecureUser、SecureRole 和 Requestmap 作为要生成的域(而不是默认的 User、Role 和 Requestmap)。但是,是的,这是完美的。
我遵循的步骤:
添加插件依赖compile ":spring-security-ui:0.2"
Ran 命令:grails install-plugin spring-security-ui
这将返回一条成功消息,并警告说install-plugin命令已被废弃并将在未来的版本中被替换......我现在不需要担心。
我做了一个grails run-app,我看到一个巨大的堆栈跟踪(我会在问题的末尾粘贴)。
所以,我的问题是:
安装插件后看到成功消息后,我应该在应用程序中看到什么?它不会创建任何控制器或域或视图来提供 UI 吗?
有没有我遗漏的步骤?直到第 4 步?我认为这应该给我一个基本的界面/UI 来管理用户(除非我想像上面给出的 objectpartners URL 那样进行自定义)。
另外,我在运行应用程序时看到的错误是:
| Loading Grails 2.2.1
| Configuring classpath
| Configuring classpath.
| Environment set to development
| Environment set to development.
| Environment set to development..
| Environment set to development...
| Environment set to development....
| Environment set to development.....
| Packaging Grails application
| Packaging Grails application.
| Packaging Grails application..
| Packaging Grails application...
| Packaging Grails application....
| Compiling 1 source files
| Compiling 1 source files.
| Compiling 1 source files..
| Compiling 1 source files...
| Compiling 1 source files....
| Compiling 1 source files.....
| Compiling 1 source files.....
2013-05-21 15:34:27,535 [main] WARN webxml.WebxmlGrailsPlugin - Did not find application config file: WebXmlConfig
2013-05-21 15:34:28,130 [main] WARN webxml.WebxmlGrailsPlugin - Did not find application config file: WebXmlConfig
| Running Grails application
Configuring Spring Security UI ...
... finished configuring Spring Security UI
2013-05-21 15:34:32,508 [localhost-startStop-1] WARN util.GrailsUtil - [DEPRECATED] Method ConfigurationHolder.getConfig() is deprecated and will be removed in a future version of Grails.
Configuring Spring Security Core ...
... finished configuring Spring Security Core
2013-05-21 15:34:34,080 [localhost-startStop-1] WARN config.ConfigurationFactory - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Users/ramarajuv/.grails/ivy-cache/net.sf.ehcache/ehcache-core/jars/ehcache-core-2.4.6.jar!/ehcache-failsafe.xml
2013-05-21 15:34:35,633 [localhost-startStop-1] WARN util.GrailsUtil - [DEPRECATED] Method ApplicationHolder.getApplication() is deprecated and will be removed in a future version of Grails.
2013-05-21 15:34:37,391 [localhost-startStop-1] WARN servlet.DefaultGrailsApplicationAttributes - ApplicationContext not found in org.codehaus.groovy.grails.APPLICATION_CONTEXT attribute of servlet context.
2013-05-21 15:34:38,402 [localhost-startStop-1] WARN module.ModuleDeclarationsFactory - 'grails.resources.modules' in config does not define any modules
2013-05-21 15:34:38,571 [localhost-startStop-1] ERROR StackTrace - Full Stack Trace:
java.lang.NullPointerException: Cannot get property 'name' on null object
at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:56)
at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:169)
at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227)
at org.grails.plugin.resource.ResourceProcessor$_updateDependencyOrder_closure4.doCall(ResourceProcessor.groovy:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:64)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.grails.plugin.resource.ResourceProcessor$_updateDependencyOrder_closure4.doCall(ResourceProcessor.groovy:124)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:272)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.call(PogoMetaMethodSite.java:64)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.grails.plugin.resource.ResourceProcessor.updateDependencyOrder(ResourceProcessor.groovy:131)
at org.grails.plugin.resource.ResourceProcessor.loadModules(ResourceProcessor.groovy:804)
at org.grails.plugin.resource.ResourceProcessor.this$2$loadModules(ResourceProcessor.groovy)
at org.grails.plugin.resource.ResourceProcessor$this$2$loadModules.callCurrent(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
at org.grails.plugin.resource.ResourceProcessor.reloadAll(ResourceProcessor.groovy:1075)
at org.grails.plugin.resource.ResourceProcessor$reloadAll.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at ResourcesGrailsPlugin$_closure3.doCall(ResourcesGrailsPlugin.groovy:172)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1082)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1106)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)
at groovy.lang.Closure.call(Closure.java:412)
at ResourcesGrailsPlugin$_closure3.call(ResourcesGrailsPlugin.groovy)
at org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin.doWithDynamicMethods(DefaultGrailsPlugin.java:703)
at org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager.doDynamicMethods(DefaultGrailsPluginManager.java:741)
at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:174)
at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:127)
at org.codehaus.groovy.grails.web.context.GrailsConfigUtils.configureWebApplicationContext(GrailsConfigUtils.java:121)
at org.codehaus.groovy.grails.web.context.GrailsContextLoader.initWebApplicationContext(GrailsContextLoader.java:107)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4791)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5285)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
2013-05-21 15:34:38,575 [localhost-startStop-1] ERROR StackTrace - Full Stack Trace:
java.lang.NullPointerException: Cannot get property 'name' on null object
at org.grails.plugin.resource.ResourceProcessor$_updateDependencyOrder_closure4.doCall(ResourceProcessor.groovy:117)
at org.grails.plugin.resource.ResourceProcessor$_updateDependencyOrder_closure4.doCall(ResourceProcessor.groovy:124)
at org.grails.plugin.resource.ResourceProcessor.updateDependencyOrder(ResourceProcessor.groovy:131)
at org.grails.plugin.resource.ResourceProcessor.loadModules(ResourceProcessor.groovy:804)
at org.grails.plugin.resource.ResourceProcessor.reloadAll(ResourceProcessor.groovy:1075)
at ResourcesGrailsPlugin$_closure3.doCall(ResourcesGrailsPlugin.groovy:172)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
2013-05-21 15:34:38,576 [localhost-startStop-1] ERROR resource.ResourceProcessor - Unable to load resources
java.lang.NullPointerException: Cannot get property 'name' on null object
at org.grails.plugin.resource.ResourceProcessor$_updateDependencyOrder_closure4.doCall(ResourceProcessor.groovy:117)
at org.grails.plugin.resource.ResourceProcessor$_updateDependencyOrder_closure4.doCall(ResourceProcessor.groovy:124)
at org.grails.plugin.resource.ResourceProcessor.updateDependencyOrder(ResourceProcessor.groovy:131)
at org.grails.plugin.resource.ResourceProcessor.loadModules(ResourceProcessor.groovy:804)
at org.grails.plugin.resource.ResourceProcessor.reloadAll(ResourceProcessor.groovy:1075)
at ResourcesGrailsPlugin$_closure3.doCall(ResourcesGrailsPlugin.groovy:172)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
2013-05-21 15:34:40,084 [localhost-startStop-1] WARN util.GrailsUtil - [DEPRECATED] Method ConfigurationHolder.getConfig() is deprecated and will be removed in a future version of Grails.
2013-05-21 15:34:40,092 [localhost-startStop-1] WARN util.GrailsUtil - [DEPRECATED] Method ApplicationHolder.getApplication() is deprecated and will be removed in a future version of Grails.
2013-05-21 15:34:40,103 [localhost-startStop-1] WARN util.GrailsUtil - [DEPRECATED] Method ApplicationHolder.getApplication() is deprecated and will be removed in a future version of Grails.
2013-05-21 15:34:40,186 [localhost-startStop-1] WARN util.GrailsUtil - [DEPRECATED] Method ConfigurationHolder.getConfig() is deprecated and will be removed in a future version of Grails.
2013-05-21 15:34:40,191 [Thread-10] ERROR plugins.DefaultGrailsPlugin - Cannot generate controller logic for scaffolded class true. It is not a domain class!
2013-05-21 15:34:40,670 [localhost-startStop-1] ERROR StackTrace - Full Stack Trace:
java.lang.NullPointerException: Cannot get property 'name' on null object
at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:56)
at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:169)
at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:44)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227)
at org.grails.plugin.resource.ResourceProcessor$_updateDependencyOrder_closure4.doCall(ResourceProcessor.groovy:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
...
...
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
2013-05-21 15:34:40,847 [Thread-10] ERROR StackTrace - Full Stack Trace:
org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'instanceControllersApi': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:212)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.autowireBeanInAutowireByName(ReloadAwareAutowireCapableBeanFactory.java:201)
at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.populateBeanInAutowireByName(ReloadAwareAutowireCapableBeanFactory.java:193)
at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.autowireBeanProperties(ReloadAwareAutowireCapableBeanFactory.java:181)
at org.springframework.beans.factory.config.AutowireCapableBeanFactory$autowireBeanProperties.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.springframework.beans.factory.config.AutowireCapableBeanFactory$autowireBeanProperties.call(Unknown Source)
at org.codehaus.groovy.grails.plugins.scaffolding.ScaffoldingGrailsPlugin.configureScaffoldingController(ScaffoldingGrailsPlugin.groovy:116)
at org.codehaus.groovy.grails.plugins.scaffolding.ScaffoldingGrailsPlugin$configureScaffoldingController.callStatic(Unknown Source)
at org.codehaus.groovy.grails.plugins.scaffolding.ScaffoldingGrailsPlugin.configureScaffolding(ScaffoldingGrailsPlugin.groovy:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1082)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1106)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1027)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1106)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:727)
at groovy.lang.GroovyObjectSupport.invokeMethod(GroovyObjectSupport.java:44)
at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:1147)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1041)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1106)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
at org.codehaus.groovy.grails.plugins.scaffolding.ScaffoldingGrailsPlugin$_closure2_closure10.doCall(ScaffoldingGrailsPlugin.groovy:77)
at org.codehaus.groovy.grails.plugins.scaffolding.ScaffoldingGrailsPlugin$_closure2_closure10.doCall(ScaffoldingGrailsPlugin.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1082)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1106)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)
at groovy.lang.Closure.call(Closure.java:412)
at groovy.lang.Closure.call(Closure.java:406)
at groovy.lang.Closure.run(Closure.java:490)
at java.lang.Thread.run(Thread.java:722)
2013-05-21 15:34:40,849 [Thread-10] ERROR StackTrace - Full Stack Trace:
org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'instanceControllersApi': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
at java.lang.Thread.run(Thread.java:722)
2013-05-21 15:34:40,849 [Thread-10] ERROR plugins.DefaultGrailsPlugin - Error configuration scaffolding: Error creating bean with name 'instanceControllersApi': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
org.springframework.beans.factory.BeanCreationNotAllowedException: Error creating bean with name 'instanceControllersApi': Singleton bean creation not allowed while the singletons of this factory are in destruction (Do not request a bean from a BeanFactory in a destroy method implementation!)
at java.lang.Thread.run(Thread.java:722)