[spring]异常 Illegal UTF8 string in constant pool in class file com/mchange/lang/PotentiallySecondaryException

严重: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.ClassFormatError: Illegal UTF8 string in constant pool in class file com/mchange/lang/PotentiallySecondaryException

网上有的说是数据库编码的问题,还有的说是从windows向linux传输文件的格式问题,要用二进制传输。

我也认为是数据库编码的问题因为错误出现在创建'sessionFactory' 时,而我的mysql默认utf-8,示例程序要求gbk。

将示例程序的数据库重新按gbk导入,不行。

最后问题解决了,是因为建立C3P0数据源的c3p0-0.9.0.4.jar包里的文件是坏的,更换为/auction_Eclipse/WebRoot/WEB-INF/lib/c3p0-0.9.0.4.jar

posted @ 2012-08-31 08:15  wanpp590  阅读(3436)  评论(0编辑  收藏  举报