【发布时间】:2013-05-25 13:22:36
【问题描述】:
我正在使用spring 3.0.5 并尝试从jboss 5.1 to 7.1. 迁移我的应用程序
我在初始化引用消息源的 bean 时遇到问题。
我收到以下部署错误。
错误 [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/riks-restaurant]] (MSC服务线程1-12)异常发送上下文初始化事件 监听类的实例 org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanCreationException:错误 创建 ServletContext 资源中定义的名称为“mybean”的 bean [/WEB-INF/applicationContext.xml]:bean初始化失败; 嵌套异常是 org.springframework.beans.ConversionNotSupportedException:失败 转换类型的属性值 'org.springframework.context.support.ResourceBundleMessageSource' 到 所需类型 'org.springframework.context.support.ResourceBundleMessageSource' 对于 属性'resourceBundleMessageSource';嵌套异常是 java.lang.IllegalStateException:无法转换类型的值 [org.springframework.context.support.ResourceBundleMessageSource] 到 所需类型 [org.springframework.context.support.ResourceBundleMessageSource] 对于 属性“resourceBundleMessageSource”:没有匹配的编辑器或 转化策略见于 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:526) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895) [spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425) [spring-context-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276) [spring-web-3.0.5.RELEASE.jar:3.0.5.RELEASE] 在 org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197) [spring-web-3.0.5.RELEASE.jar:3.0.5.RELEASE] 在 org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) [spring-web-3.0.5.RELEASE.jar:3.0.5.RELEASE] 在 org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:] 在 org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:] 在 org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] 在 org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) 在 org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21] 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21] 在 java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21] 原因: org.springframework.beans.ConversionNotSupportedException:失败 转换类型的属性值 'org.springframework.context.support.ResourceBundleMessageSource' 到 所需类型 'org.springframework.context.support.ResourceBundleMessageSource' 对于 属性'resourceBundleMessageSource';嵌套异常是 java.lang.IllegalStateException:无法转换类型的值 [org.springframework.context.support.ResourceBundleMessageSource] 到 所需类型 [org.springframework.context.support.ResourceBundleMessageSource] 对于 属性“resourceBundleMessageSource”:没有匹配的编辑器或 转化策略见于 org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:481) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:518) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:512) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1373) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1332) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1085) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:516) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] ... 19 更多原因: java.lang.IllegalStateException:无法转换类型的值 [org.springframework.context.support.ResourceBundleMessageSource] 到 所需类型 [org.springframework.context.support.ResourceBundleMessageSource] 对于 属性“resourceBundleMessageSource”:没有匹配的编辑器或 转化策略见于 org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:236) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] 在 org.springframework.beans.BeanWrapperImpl.convertIfNecessary(BeanWrapperImpl.java:466) [spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] ... 25 更多
【问题讨论】: