我是Grails的新手,所以几天前我发布了一个关于如何查询其他数据源的问题: Grails - Getting data from a different datasource and saving it in my Grails database
上面的答案有效,但当我尝试查看或修改默认数据源中的任何内容时,我遇到了一个奇怪的错误。在这种情况下,我试图转到我的客户端控制器的索引视图,它使用一些基本的脚手架:
[http-bio-8080-exec-10] ERROR spring.ReloadAwareAutowireCapableBeanFactory - Bean couldn't be autowired using grails optimization: Error creating bean with name 'properties': Bean definition is abstract
[http-bio-8080-exec-10] ERROR spring.ReloadAwareAutowireCapableBeanFactory - Retrying using spring autowire
[http-bio-8080-exec-10] ERROR errors.GrailsExceptionResolver - BeanIsAbstractException occurred when processing request: [GET] /EmmaRestServer/client/index
Error creating bean with name 'properties': Bean definition is abstract. Stacktrace follows:
Message: Error creating bean with name 'properties': Bean definition is abstract
如果删除第二个数据源,则此问题消失。可能导致这个问题的原因是什么?
答案 0 :(得分:0)
我在resources.groovy中有一些额外的配置。我删除了它们,现在看起来像这样,它运行正常:
beans = {
dataSource_drupal(DataSource) { bean ->
bean.destroyMethod = 'close'
driverClassName = "com.mysql.jdbc.Driver"
username = "user"
password = "password"
url = "jdbc:databaseURL
}
}