Activiti:MalformedByteSequenceException: 3 字节的 UTF-8 序列的字节 3 无效。
在win下开发,有时编译或运行项目会报3字节的UTF-8序列的字节3无效。
解决该问题的办法
1、将xml头文件改为GBK编码方式
,我这里不OK
- <?xml version="1.0" encoding="GBK"?>
2、使用Maven修改默认格式
,我这里不OK
<build>
<plugins>
<!-- resource插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
3、以上如果还不可行,那么在pom.xml里加入 ,我这里不OK
- <properties>
- <!-- 设置默认编码 -->
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
4、修改bpmn文件的编码格式为UTF-8,我这里OK
用记事本打开bpmn文件,另存为utf-8编码的文件,XML也是utf-8编码格式
pom.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>ActDemo</groupId>
<artifactId>Activiti</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<!-- 设置默认编码 -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>1.4.193</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>6.0.5</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- resource插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>
bpmn文件
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.activiti.org/test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" expressionLanguage="http://www.w3.org/1999/XPath" id="m1520825820812" name="" targetNamespace="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema">
<process id="process1" isClosed="false" isExecutable="true" processType="None">
<startEvent id="_2" name="StartEvent"/>
<endEvent id="_3" name="EndEvent"/>
<userTask activiti:exclusive="true" id="_4" name="软件开发一"/>
<userTask activiti:exclusive="true" id="_5" name="软件开发二"/>
<sequenceFlow id="_6" sourceRef="_2" targetRef="_4"/>
<sequenceFlow id="_7" sourceRef="_4" targetRef="_5"/>
<sequenceFlow id="_8" sourceRef="_5" targetRef="_3"/>
</process>
<bpmndi:BPMNDiagram documentation="background=#FFFFFF;count=1;horizontalcount=1;orientation=0;width=842.4;height=1195.2;imageableWidth=832.4;imageableHeight=1185.2;imageableX=5.0;imageableY=5.0" id="Diagram-_1" name="New Diagram">
<bpmndi:BPMNPlane bpmnElement="process1">
<bpmndi:BPMNShape bpmnElement="_2" id="Shape-_2">
<omgdc:Bounds height="32.0" width="32.0" x="60.0" y="160.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_3" id="Shape-_3">
<omgdc:Bounds height="32.0" width="32.0" x="805.0" y="180.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="32.0" width="32.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_4" id="Shape-_4">
<omgdc:Bounds height="55.0" width="85.0" x="275.0" y="190.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="_5" id="Shape-_5">
<omgdc:Bounds height="55.0" width="85.0" x="590.0" y="200.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="55.0" width="85.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="_6" id="BPMNEdge__6" sourceElement="_2" targetElement="_4">
<omgdi:waypoint x="92.0" y="176.0"/>
<omgdi:waypoint x="275.0" y="217.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_7" id="BPMNEdge__7" sourceElement="_4" targetElement="_5">
<omgdi:waypoint x="360.0" y="217.5"/>
<omgdi:waypoint x="590.0" y="227.5"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="_8" id="BPMNEdge__8" sourceElement="_5" targetElement="_3">
<omgdi:waypoint x="675.0" y="227.5"/>
<omgdi:waypoint x="805.0" y="196.0"/>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="0.0" width="0.0" x="0.0" y="0.0"/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
注意格式:为uft-8
Activiti:MalformedByteSequenceException: 3 字节的 UTF-8 序列的字节 3 无效。的更多相关文章
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 3 字节的 UTF-8 序列的字节 3 无效。
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document fro ...
- com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 3 字节的 UTF-8 序列的字节 x 无效
在启动Tomcat项目时,控制台报错:nested exception is com.sun.org.apache.xerces.internal.impl.io.MalformedByteSeque ...
- Maven 项目 启动时 解决3 字节的 UTF-8 序列的字节 3 无效
"org.activiti.bpmn.exceptions.XMLException: 3 字节的 UTF-8 序列的字节 3 无效." Maven 项目启动时,由于读XML配置文 ...
- tomcat 1字节的UTF-8序列的字节1无效
微信支付时, 命名返回支付成功, 但是成功后却返回如下的错误, 在测试环境都是没有任何问题, 到客户现场后, 可能客户现场使用的4G网络, 用微信支付时一直报这样的错误 错误现象: com.sun.o ...
- 报错:3 字节的 UTF-8 序列的字节 3 无效。
错误如下: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with n ...
- 异常: 2 字节的 UTF-8 序列的字节 2 无效。
具体异常: 十二月 08, 2015 7:16:55 下午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.servi ...
- java.lang.RuntimeException: org.dom4j.DocumentException: 1 字节的 UTF-8 序列的字节 1 无效。
向一个XML文件写入出现异常 解决办法:使用记事本打开该XML文件,另存为,编码选择UTF-8 java.lang.RuntimeException: org.dom4j.DocumentExcept ...
- 出现 关于UTF-8 序列的字节 2 无效的异常
学习mybatis中碰到了 Caused by: org.apache.ibatis.builder.BuilderException: Error creating document instanc ...
- XML文件存在中文注释报错问题( 3 字节的 UTF-8 序列的字节 3 无效)
今天在做mybatis项目的时候,给映射文件添加了中文注释后,程序就报错.把中文注释删除后,程序又可以正常执行.解决方法在下文提到. 我的xml映射文件如下: <?xml version=&qu ...
随机推荐
- nodejs异步调用async
犹豫nodejs是异步编程模型,有一些在同步编程中很容易做到的事情,现在却变得很麻烦,async的流程控制就是为了简化这些操作var async = require('async'); 1.serie ...
- Java Collection API
在 Java2中,有一套设计优良的接口和类组成了Java集合框架Collection,使程序员操作成批的数据或对象元素极为方便.这些接口和类有很多对抽象数据类型操作的API,而这是我们常用的且在数据结 ...
- accept= 'image/*'反映缓慢
input[type='file']的accept属性用来指定上传文件的MIME类型. 将其设为accept= 'image/*',顾名思义,过滤掉所有非图片文件, 但在实际操作中,发现有时会出现响应 ...
- Python 循环的综合应用
# 循环综合应用1. # str = "hello,world" 把字符串给反转显示 str = "hello,world" temp = "&quo ...
- 解决noSession问题
1.问题描述:对于根据id查询时,在dao通过load方式查询对象时,加载页面会报 noSession异常. 严重: Servlet.service() for servlet [springDisp ...
- 深入Spring:自定义注解加载和使用
前言 在工作中经常使用Spring的相关框架,免不了去看一下Spring的实现方法,了解一下Spring内部的处理逻辑.特别是开发Web应用时,我们会频繁的定义@Controller,@Service ...
- sqoop学习2(数据导入与导出)
最近学习了下这个导数据的工具,但是在export命令这里卡住了,暂时排不了错误.先记录学习的这一点吧 sqoop是什么 sqoop(sql-on-hadoop):是用来实现结构型数据(如关系型数据库) ...
- math.floor实现四舍五入
lua math.floor 实现四舍五入: lua 中的math.floor函数是向下取整函数. math.floor(5.123) -- 5 math.floor(5.523) -- 5 用此特 ...
- numpy里*与dot与multiply
一.* , dot() multiply() 1, 对于array来说,(* 和 dot()运算不同, * 和 multiply()运算相同) *和multiply() 是每个元素对应相乘 do ...
- Carrier-Grade Mirantis OpenStack (the Mirantis NFV Initiative), Part 1: Single Root I/O Virtualization (SR-IOV)
The Mirantis NFV initiative aims to create an NFV ecosystem for OpenStack, with validated hardware ...