hongyangAndroid / wanandroid

玩Android网站 -- 努力做一个优质的Android站点
http://www.wanandroid.com/
Apache License 2.0
583 stars 55 forks source link

分享项目标题带有特殊字符“🔥🔥🔥”返回状态码500,提示无法插入数据库 #231

Closed wangjianxiandev closed 4 years ago

wangjianxiandev commented 4 years ago

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not insert: [com.zhy.xueandroid.bean.TmpUserProject]; uncategorized SQLException for SQL [insert into tb_tmp_user_project (author, _desc, innerLink, link, publish_time, reason, _status, title, user_id, user_name, visible) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xF0\x9F\x94\xA5\xF0\x9F...' for column 'title' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xF0\x9F\x94\xA5\xF0\x9F...' for column 'title' at row 1 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) javax.servlet.http.HttpServlet.service(HttpServlet.java:650) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) com.zhy.xueandroid.web.xss.XssFilter.doFilter(XssFilter.java:33) com.zhy.xueandroid.web.SystemContextFilter.doFilter(SystemContextFilter.java:23) org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) root cause

org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not insert: [com.zhy.xueandroid.bean.TmpUserProject];

hongyangAndroid commented 4 years ago

已修复~