Grails Spring安全核心插件和mongoDB GORM插件

时间:2013-11-30 18:46:31

标签: mongodb spring-security gorm grails-2.0

有谁知道Spring Security Core Plugin是否与mongoDB GORM插件兼容?我有三个域类“User,Role和UserRole”,我将静态mapWith ='mongo'添加到“'User和Role”,以便从mongoDB而不是Hibernate / MySQL中读取Spring Security Core Plugin,但我得到了在Exception之后,我知道Spring Security Core Plugin正在尝试使用Hibernate来连接和映射这些表中的数据,我想知道我是否可以拦截它并使其重定向到MongoDB而不是Hibernate:

|运行Grails应用程序 配置Spring Security Core ...... ...完成配置Spring Security Core

Error | 
2013-11-30 13:22:56,976 [localhost-startStop-1] ERROR context.GrailsContextLoader  - Error initializing the application: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: An association from the table user_role refers to an unmapped class: com.myProject.Role 
Message: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.MappingException: An association from the table user_role refers to an unmapped class: com.myProject.Role 
    Line | Method 
->>  104 | postProcessBeanFactory in org.grails.datastore.gorm.plugin.support.PersistenceContextInterceptorAggregator 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    262 | run                    in java.util.concurrent.FutureTask 
|   1145 | runWorker . . . . . .  in java.util.concurrent.ThreadPoolExecutor 
|    615 | run                    in java.util.concurrent.ThreadPoolExecutor$Worker 
^    744 | run . . . . . . . . .  in java.lang.Thread 
Caused by MappingException: An association from the table user_role refers to an unmapped class: com.myProject.Role 
->>  104 | postProcessBeanFactory in org.grails.datastore.gorm.plugin.support.PersistenceContextInterceptorAggregator 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    262 | run                    in java.util.concurrent.FutureTask 
|   1145 | runWorker . . . . . .  in java.util.concurrent.ThreadPoolExecutor 
|    615 | run                    in java.util.concurrent.ThreadPoolExecutor$Worker 
^    744 | run . . . . . . . . .  in java.lang.Thread 
Error | 
Forked Grails VM exited with error

0 个答案:

没有答案