今天在Ubantu服务器上部署一本地项目,产生如下错误:
[ERROR][2014-09-03 22:13:16,764][org.springframework.web.context.ContextLoader]Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'templetContext': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'freemarker' defined in file [/usr/local/tomcat/webapps/jeewx/WEB-INF/classes/spring-mvc-cgform.xml]: Initialization of bean failed; nested exception is org.springframework.beans.FatalBeanException: Failed to obtain BeanInfo for class [freemarker.template.Configuration]; nested exception is java.beans.IntrospectionException: type mismatch between read and write methods
问题分析:在开发环境没有这个问题,通过问题查找发现是服务器使用的JDK版本为8+,而项目使用的JDK为1.6,尝试着在服务器上更换JDK版本,最后验证问题解决。