首页 文章

在使用ResourceBundleMessageSource的jboss 7中无法初始化Spring 3 bean

提问于
浏览
0

我正在使用 spring 3.0.5 并尝试从 jboss 5.1 to 7.1. 迁移我的应用程序

我在初始化引用messagesource的bean时遇到了问题 .

我正在进行以下部署 error .

ERROR [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资源[/WEB-INF/applicationContext.xml]中定义名称为'mybean'的bean时出错:bean的初始化失败;嵌套异常是org.springframework.beans.ConversionNotSupportedException:无法将类型'org.springframework.context.support.ResourceBundleMessageSource'的属性值转换为属性'resourceBundleMessageSource'所需的类型'org.springframework.context.support.ResourceBundleMessageSource';嵌套异常是java.lang.IllegalStateException:无法将类型[org.springframework.context.support.ResourceBundleMessageSource]的值转换为属性“resourceBundleMessageSource”所需的类型[org.springframework.context.support.ResourceBundleMessageSource]:没有匹配的编辑器或转换在org.springframework.beans.factory上的org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:526)[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE]中找到的策略.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] at 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] at 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] at 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.s pringframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)[spring-web-3.0.5.RELEASE.jar:3.0.5.RELEASE] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener . java:47)[spring-web-3.0.5.RELEASE.jar:3.0.5.RELEASE] at 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:] at 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)at org java.util的java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[rt.jar:1.7.0_21]中的.jboss.msc.service.ServiceControllerImpl $ StartTask.run(ServiceControllerImpl.java:1746) . concurrent.ThreadPoolExecutor $ Worker.run(TH readPoolExecutor.java:615)[rt.jar:1.7.0_21] at java.lang.Thread.run(Thread.java:722)[rt.jar:1.7.0_21]引起:org.springframework.beans.ConversionNotSupportedException:无法将'org.springframework.context.support.ResourceBundleMessageSource'类型的属性值转换为属性'resourceBundleMessageSource'所需的类型'org.springframework.context.support.ResourceBundleMessageSource';嵌套异常是java.lang.IllegalStateException:无法将类型[org.springframework.context.support.ResourceBundleMessageSource]的值转换为属性“resourceBundleMessageSource”所需的类型[org.springframework.context.support.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)org中的[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] . springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyProperty org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1085)中的值(AbstractAutowireCapableBeanFactory.java:1332)[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] [spring -beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:516)[chring-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.convertI fNecessary(BeanWrapperImpl.java:466)[spring-beans-3.0.7.RELEASE.jar:3.0.7.RELEASE] ... 25更多

1 回答

  • 0

    看起来你用不同版本的spring编译代码而不是JBoss容器上加载的代码 . 如果你设置了一些依赖项,请仔细检查它们是否都是相同的spring版本

相关问题