xml文件中如果有中文注释的解决方式
报错信息:nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring-service.xml]; nested exception is com.sun.org
报错信息:
nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring-service.xml]; nested exception is com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 2 字节的 UTF-8 序列的字节 2 无效。
有两种做法:
1.在每一个xml配置文件中,都把这个encoding改了,但是很明显效率不高。
2.在IDEA中的设置中修改encoding设置
推荐使用第二种。这样就不需要每个xml文件都进行改动。
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)