Freemaker的java.beans.IntrospectionException: type mismatch between read and write methods

原创 2017年07月12日 09:46:47

引言:freemaker在特定的spring以及jdk下的问题解决路径。

环境描述

spring 3.1.1, jdk1.8u80, freemake 2.3.19

错误信息描述:

严重: Exception sending context initialized event to listener instance of class org.jeecgframework.web.system.listener.OnlineListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘freemarker’ defined in file [D:\OpenSource\jeewx\jeewx\target\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
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:385)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.startup.Embedded.start(Embedded.java:825)
at org.codehaus.mojo.tomcat.AbstractRunMojo.startContainer(AbstractRunMojo.java:558)
at org.codehaus.mojo.tomcat.AbstractRunMojo.execute(AbstractRunMojo.java:255)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: 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
at org.springframework.beans.CachedIntrospectionResults.(CachedIntrospectionResults.java:262)
at org.springframework.beans.CachedIntrospectionResults.forClass(CachedIntrospectionResults.java:149)
at org.springframework.beans.BeanWrapperImpl.getCachedIntrospectionResults(BeanWrapperImpl.java:324)
at org.springframework.beans.BeanWrapperImpl.getPropertyDescriptors(BeanWrapperImpl.java:331)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.filterPropertyDescriptorsForDependencyCheck(AbstractAutowireCapableBeanFactory.java:1242)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1101)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
… 42 more
Caused by: java.beans.IntrospectionException: type mismatch between read and write methods
at java.beans.PropertyDescriptor.findPropertyType(PropertyDescriptor.java:661)
at java.beans.PropertyDescriptor.setReadMethod(PropertyDescriptor.java:257)
at org.springframework.beans.ExtendedBeanInfo.addOrUpdatePropertyDescriptor(ExtendedBeanInfo.java:282)
at org.springframework.beans.ExtendedBeanInfo.addOrUpdatePropertyDescriptor(ExtendedBeanInfo.java:180)
at org.springframework.beans.ExtendedBeanInfo.(ExtendedBeanInfo.java:100)
at org.springframework.beans.CachedIntrospectionResults.(CachedIntrospectionResults.java:224)
… 48 more

错误的核心关键词是java.beans.IntrospectionException: type mismatch between read and write method。
直观来分析就是javaBean中的方法调用问题,之前的版本和运行都是正确的,所以锁定jdk或者spring版本的问题。

解决方法

经过一番的查找和验证,解决的思路有以下两个:

  • downgrade至JDK 1.7

  • 升级至spring 4.1.2+

参考资料

【异常】Error creating bean with name 'xxx' defined in file.type mismatch between read and write methods

1、导入项目,运行,出现如下错误org.springframework.beans.factory.BeanCreationException: Error creating bean with n...
  • u013420865
  • u013420865
  • 2017年02月27日 15:16
  • 416

IntrospectionException: type mismatch between read and write methods

[INFO][2014-09-03 22:13:16,760][com.alibaba.druid.pool.DruidDataSource]{dataSource-1} closed [ERROR...
  • gjswxhb
  • gjswxhb
  • 2014年09月06日 12:08
  • 9923

编程是一个严谨的活:修改一个bug,引入了新的bug

 1,需求中要求,将一个varchar类型字段:比如 acid,加(算术加)上一个数字,其结果作为一个新的ID:v_cardNo varchar(12)。 逻辑代码如下: ......v_cardNo...
  • gjswxhb
  • gjswxhb
  • 2010年11月06日 19:47
  • 1027

Error was Port already in use: 40001

[WARN][2014-09-03 21:38:28,130][net.sf.ehcache.distribution.RMICacheManagerPeerListener]Explicitly s...
  • gjswxhb
  • gjswxhb
  • 2014年09月06日 12:13
  • 9378

Centos 下换jdk

对于.tar.gz格式的文件,linux对其进行安装、解压使用 tar -zxvf 命令 对于.bin格式的文件,linux对其进行安装、解压使用 ./ 命令 对于linux中的可执行文件,如果我...
  • gjswxhb
  • gjswxhb
  • 2014年09月03日 23:58
  • 2428

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.Conte...
  • yidragon88xx
  • yidragon88xx
  • 2015年04月01日 17:26
  • 3671

write and read

int my_write(int fd,void *buffer,int length) { int bytes_left; int written_bytes; char *ptr; ...
  • wenyue043
  • wenyue043
  • 2013年05月31日 11:51
  • 373

Exception in thread "main" java.beans.IntrospectionException: Method not found: isWBLDINST

今天做java的项目时 想通过反射为sql查询出的数据进行封装,结果一直报错 Exception in thread "main" java.beans.IntrospectionExceptio...
  • Raynaing
  • Raynaing
  • 2016年06月08日 17:38
  • 2427

Numpy多维数组保存文档时,解决报错TypeError: Mismatch 的方法

TypeError: Mismatch between array dtype (‘float64’) and format specifier (‘%.18e %.18e’)
  • circle2015
  • circle2015
  • 2017年04月08日 20:56
  • 2963

PB报错,Mismatch between retrieve columns and fetch columns

新建PB的PBL,可以正常连接数据库,但是用以前的程序运行报“Mismatch between retrieve columns and fetch columns”错误, 错误原因是版本之间DLL...
  • HyEidolon
  • HyEidolon
  • 2015年09月08日 15:55
  • 2573
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Freemaker的java.beans.IntrospectionException: type mismatch between read and write methods
举报原因:
原因补充:

(最多只允许输入30个字)