2016-10-05 124 views
0

我在grails 1.3.7中创建了一个简单的项目。现在我正在执行版本更改的任务。首先,我将1.3.7项目添加到2.4.4。它运行完美。 我已经在我的文件BuildConfig.groovy文件,urlMapping中,index.gsp中,applicationContext.xml中,application.pro perties取得Grails版本从2.4.4升级到2.5.3

 applicationContext.xml 

      <?xml version="1.0" encoding="UTF-8"?> 
      <beans xmlns="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> 

<bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean"> 
    <description>Grails application factory bean</description> 
    <property name="grailsDescriptor" value="/WEB-INF/grails.xml"/> 
    <!--<property name="grailsResourceLoader" ref="grailsResourceLoader" />--> 
</bean> 

<bean id="pluginManager" class="org.codehaus.groovy.grails.plugins.GrailsPluginManagerFactoryBean"> 
    <description>A bean that manages Grails plugins</description> 
    <property name="grailsDescriptor" value="/WEB-INF/grails.xml"/> 
    <property name="application" ref="grailsApplication"/> 
</bean> 

<bean id="grailsConfigurator" class="org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator"> 
    <constructor-arg> 
     <ref bean="grailsApplication"/> 
    </constructor-arg> 
    <property name="pluginManager" ref="pluginManager"/> 
</bean> 

<!--<bean id="grailsResourceLoader" class="org.codehaus.groovy.grails.commons.GrailsResourceLoaderFactoryBean">--> 
<!--<property name="grailsResourceHolder" ref="grailsResourceHolder" />--> 
<!--</bean>--> 

<!--<bean id="grailsResourceHolder" scope="prototype" class="org.codehaus.groovy.grails.commons.spring.GrailsResourceHolder">--> 
<!--<property name="resources">--> 
<!--<value>classpath*:**/grails-app/**/*.groovy</value>--> 
<!--</property>--> 
<!--</bean> --> 

<bean id="characterEncodingFilter" 
     class="org.springframework.web.filter.CharacterEncodingFilter"> 
    <property name="encoding"> 
     <value>utf-8</value> 
    </property> 
</bean> 
<bean id="conversionService"    
      class="org.springframework.context.support.ConversionServiceFactoryBean" /> 

urlMappings

class UrlMappings { 

    static mappings = { 
    "/$controller/$action?/$id?(.$format)?"{ 
     constraints { 
      // apply constraints here 
     } 
    } 

    "/"(view:"/index") 
    "500"(view:'/error') 
     } 
    } 

在指数的变化.gsp文件

 %{--<li>Groovy version:  

      ${org.codehaus.groovy.runtime.InvokerHelper.getVersion()} </li>--}% to 


     <li>Groovy version: ${GroovySystem.getVersion()}</li> 

现在我试图将它从2.4.4到2.5.3。但是出现了一个错误。

误差

[localhost-startStop-1] ERROR context.GrailsContextLoaderListener - Error 

initializing the application:Error creating bean with name 

'defaultGrailsintConverter': 

    Injection of autowired dependencies failed; nested exception is 

     org.springframework.beans.factory.BeanCreationException: 

Could not autowire field: private 

      org.springframework.web.servlet.LocaleResolver 

     org.grails.databinding.converters.web.LocaleAwareNumberConverter. 

localeResolver;   

请帮我this.Should我编译春季安全插件?

回答

0

您可能想要列出您在升级中执行的步骤。你改什么文件,你改变什么相关性等

此外,也有一些博客在那里大约升级。并非所有应用程序都使用相同的Grails块,因此并非所有升级都是相同的。这里有几个: http://totalprogus.blogspot.com/2015/03/upgrade-grails-244-to-250.html http://peedeebeesblog.blogspot.com/2015/06/moving-up-grails-243-to-250.html

最后,Grails的每转有什么可能会在升级过程中需要做提供指令发行说明。这里是2.5.0的注意事项: https://github.com/grails/grails-core/releases/tag/v2.5.0

你的错误看起来并不像Spring Security Plugin,只是Spring注入,虽然有点难以判断格式。

+0

不要把它放在评论中..把它添加到你的问题。 – billjamesdev

+1

当您提到您的初始项目时,1.3.7版本是一个“简单”项目,您可能会发现创建一个全新的Grails 2.5项目并将项目后的域/控制器/视图和任何src结束,这是一个不太麻烦的过程是安装和指定插件/依赖关系。这种方法为我提供了更平滑的升级途径。 – Dave