1. 程式人生 > >Web啟動錯誤Failed to obtain BeanInfo for class [freemarker.template.Configuration]; nested exception is

Web啟動錯誤Failed to obtain BeanInfo for class [freemarker.template.Configuration]; nested exception is

今天在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版本,最後驗證問題解決。