ralasafe元数据中displayname属性中文异常解决方案

定制metadata.xml时,displayName为中文时,上传metadata.xml会出现异常信息
HTTP Status 500 - 

--------------------------------------------------------------------------------

type Exception report

message 

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

exception 

java.lang.RuntimeException: org.xml.sax.SAXParseException: Invalid byte 2 of 2-byte UTF-8 sequence.
	org.ralasafe.metadata.user.UserMetadataParser.parse(UserMetadataParser.java:57)
	org.ralasafe.servlet.UserTypeInstallAction.extractValues(UserTypeInstallAction.java:154)
	org.ralasafe.servlet.UserTypeInstallAction.doGet(UserTypeInstallAction.java:58)
	org.ralasafe.servlet.UserTypeInstallAction.doPost(UserTypeInstallAction.java:170)
	org.ralasafe.servlet.RalasafeController.doPost(RalasafeController.java:152)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:729)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.


在<xml>标签中加入encoding属性,将值设为GBK,如下所示:
<?xml version="1.0" encoding="GBK"?>


你可能感兴趣的:(ralasafe元数据中displayname属性中文异常解决方案)