java.lang.ClassFormatError: Truncated class file错误解决

1,132 阅读1分钟

java.lang.ClassFormatError: Truncated class file比较少遇到的问题,特此记录

早上上班坐下喝口水,想休息下,突然想到昨天的redis启动提示了一个错误,就是说缓存连接池不够了,想着懵了,redis的客户端连接数能够支持1W,现在才多少连接数,撑死了一千,又一想,不对,环境用的是window,版本也用的比较旧,算了把redisson的空闲连接数降低吧!

 Unable to init enough connections amount! Only 15 of 24 were initialized. Redis server: 192.168.1.103/192.168.1.103:6379

image.png image.png

一顿操作猛如虎,改代码,deploy,更新maven,启动,一键三联,搞定!!!,突然报错了提示类转换错误

ERROR [main] org.springframework.boot.SpringApplication 824 reportFailure - Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.ybsm.common.session.SecuritySimplerUserUtil': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.ybsm.common.session.SecuritySimplerUserUtil] from ClassLoader [jdk.internal.loader.ClassLoaders$AppClassLoader@27ddd392]

java.lang.ClassFormatError: Truncated class file错误解决
	

解决如下: 昨天还能正常启动 检查刚所改的代码,没有问题 刚去除了一个重复依赖 web容器使用的是undertow 嗯,有可能是重复依赖的缓存,支持clean去除所有编译,重新启动,搞定

顺手搜索了下,发现别人有遇到同样问题,相同原因,只不过是tomcat容器# Tomcat 启动异常: java.lang.ClassFormatError: Truncated class file错误解决