2014-10-17 77 views
0

問題無法從Grails的2.3.4升級到2.4.3 - 無法找到GrailsResourceLoaderFactoryBean

我想通過這個鏈接 以下說明從2.3.4一個Grails應用程序升級至2.4.3 http://grails.org/doc/2.4.3/guide/upgradingFrom23.html

我似乎無法完成它。我在編譯時找不到GrailsResourceLoaderFactoryBean初始化錯誤。據我所知,grails 2.4中不再存在,但它仍然需要它。我確信我的applicationContext.xml與全新項目中生成的完全一樣,並且錯誤仍然存​​在。

我曾嘗試

1/Grails的設置的grails-版本2.4.3這個更新的應用程序屬性

2 /然後加入下列到我BuildConfig

// plugins for the build system only 
    build ":tomcat:7.0.55" 

    // plugins for the compile step 
    compile ":scaffolding:2.1.2" 
    compile ':cache:1.1.7' 
    compile ":asset-pipeline:1.9.6" 
    compile ":mail:1.0.7"   
    compile ':spring-security-core:2.0-RC3' 
    compile ":spring-security-ldap:2.0-RC2" 
    compile ":spring-security-ui:1.0-RC2" 
    compile ":cache-headers:1.1.7" 

    // Uncomment these (or add new ones) to enable additional resources capabilities 
    runtime ':hibernate4:4.3.5.2' // or ':hibernate:3.6.10.14' 
    runtime ':database-migration:1.4.0' 
    runtime ':jquery:1.11.0.2' 
    runtime ':resources:1.2.13' 
    runtime ":zipped-resources:1.0" 
    runtime ":cached-resources:1.0" 

3 /我也從我的applicationContext.xml中刪除了這行代碼

<property name="grailsResourceLoader" ref="grailsResourceLoader" /> 

4 /我還刪除了userprofile.grails \ 2.4.3 \ projects下的項目,然後執行grails刷新依賴項,但仍然沒有運氣!

看看堆棧跟蹤:

enter image description here

回答

0

我想我找到了答案的問題。顯然,我忘了從applicationContext.xml中刪除以下聲明。但是,我應該知道更好,但官方升級文檔中缺少這一點。 「

<bean id="grailsResourceLoader" class="org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean" /> 
+1

」這在官方升級文檔中缺少。「 - 在官方升級文檔中提到。 http://grails.org/doc/latest/guide/upgradingFrom23.html中的註釋包括以下內容:「web-app/WEB-INF/applicationContext.xml文件包含grailsResourceLoader bean的bean定義,它是一個實例org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean。該bean定義需要從文件中刪除。「 – 2014-10-18 12:36:57

+0

看到https://github.com/grails/grails-doc/commit/9bfd17397b8572ea4ca021ebde67fe7c185ee238#diff-42e722eb2e80076bbbfab0562da2dc62R20 – 2014-10-18 12:43:27

+0

是的,你是對的,但既然你顯示了「grailsApplication」bean前後的屏幕截圖,我認爲它會有最好還是明確地添加一行xml以便隨着文本一起被刪除,當你閱讀時可能很快會很容易被忽視。再次,不用擔心,我應該從過去的Spring開發中瞭解更多,但有時在工作中發生的其他事情很容易被忽視。 – Viriato 2014-10-18 18:57:55

相關問題