项目整理之一:

问题描述:

严重: Servlet.service() for servlet jsp threw exception
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Unknown column 'docinfo0_.content_type' in 'field list'

解决方案:

这是因为在PO的映射文件里,column的名称与对应数据库表中的列名不一致造成的。

这里的错误是

<hibernate-mapping package="com.online.doc.domain">
<class name="DocInfo" table="doc_info" dynamic-update="true" lazy="true" >

      <property name="contentType" column="content" type="string" /> 

</class>
</hibernate-mapping>

原文地址:https://www.cnblogs.com/Null2051/p/3097220.html