也遇到了同樣的問題。我們實際上有兩種方法來指定grails.configuration.locations,使用System/Env變量或-Dconfig.file =定義。使用環境變量負載,這會導致的
classpath:the-config-file.properties
線如果指定了-Dconfig.file,它使用基於文件的評估:
file:/full-path/the-config.file.properties
當使用系統/ env的方法,所述配置加載正常!只要我們轉向使用'文件'查找,Tomcat無法啓動。
它看起來創建internalConfigurationAnnotationProcessor豆後是剛剛失敗:
2012-04-22 22:35:53,514 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext] - <Bean factory for org.co[email protected]17bcd4: org.codehaus.gro[email protected]752144: defining beans [org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,....<--- (left out the big list of others)
2012-04-22 22:35:53,538 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'>
2012-04-22 22:35:53,538 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'>
2012-04-22 22:35:53,547 (main) DEBUG [org.springframework.beans.factory.support.DefaultListableBeanFactory] - <Returning cached instance of singleton bean 'grailsApplication'>
2012-04-22 22:35:53,547 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Eagerly caching bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor' to allow for resolving potential circular references>
2012-04-22 22:35:53,548 (main) DEBUG [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Finished creating instance of bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'>
2012-04-22 22:35:53,667 (main) INFO [org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory] - <Destroying singletons in org.codehaus.gro[email protected]752144
22/04/2012 10:35:53 PM org.apache.catalina.core.StandardContext start
SEVERE: Error listenerStart
最奇怪的部分是剛剛從classpath:<>
定義更改爲file:<>
引起此問題。我已將調試語句放入grails Config.groovy
文件中,並且文件的內容已被讀取正常。
我假設'/ home/user/application_homes/app_home/app-config.properties'存在於tomcat服務器上,並且可以被運行tomcat進程的uid讀取? – 2012-04-10 09:40:09
是的,即使有相關訪問權限。而且,我在Config.groovy中控制這個: – kuceram 2012-04-10 11:45:18