Activiti:MalformedByteSequenceException: 3 字节的 UTF-8 序列的字节 3 无效。

摘要:
我不好&lt&lt!插件>org.apache.maven.plugins<maven资源插件<配置>/插件>xsi=“http;modelVersion>/modelVersion&gt,slf4j api<版本>1.4.193<

在win下开发,有时编译或运行项目会报3字节的UTF-8序列的字节3无效。
解决该问题的办法
1、将xml头文件改为GBK编码方式 ,我这里不OK

  1. <?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

    1. <properties>  
    2.     <!-- 设置默认编码 -->  
    3.     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>  
    4. </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 无效。第1张

免责声明:文章转载自《Activiti:MalformedByteSequenceException: 3 字节的 UTF-8 序列的字节 3 无效。》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Gradle 项目启动配置centos安装chromium下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

html/js部分问题和小结

2015/9/8 1.js中不要试图去处理由[变量:变量]组成的map(不过可以通过DWR.addOptions添加),而是处理[bh:变量][xm:变量],然后通过data[i].bh,data[i].xm进行处理 2.html&&js:  2.1 document.getElementsByTagName("input")  2.2...

QWidget 的 close 与 Qt::WA_DeleteOnClose

【1】close 与 Qt::WA_DeleteOnClose简介 1.1 Qt源码 1 /*! 2 Closes this widget. Returns c true if the widget was closed; 3 otherwise returns c false. 4 5 First it sen...

实用的css3小实例---1、卡片效果

实用的css3小实例---1、卡片效果 一、总结 一句话总结: 卡片效果主要是使用box-shadow属性: box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19); 1、box-shadow属性的语法及实例? 语法:box-shadow: h-shadow...

vue组件之间的传值方式

vue是一个轻量级的渐进式框架,对于它的一些特性和优点在此不做阐述,本篇文章主要来学习一下Vue子父组件通信的问题。 gitHub地址:整个案例的Demo 首先先定义一下,相对本案例来说App.vue是父组件, Child.vue是子组件。 一、父组件向子组件传值  1、创建子组件,在src/components文件夹下新建一个Child.vue 2、C...

Visual Studio中你所不知道的智能感知

在Visual Studio中的智能感知,相信大家都用过。summary,param,returns这几个相信很多人都用过的吧。那么field,value等等这些呢。 首先在Visual Studio中支持的JavaScript智能感知有以下6种 summary 用于方法和主体内容 param 用于方法的参数 field 用于类的属性 va...

EF结合SqlBulkCopy实现高效的批量数据插入 |EF插件EntityFramework.Extended实现批量更新和删除

原文链接:http://blog.csdn.net/fanbin168/article/details/51485969   批量插入 (17597条数据批量插入耗时1.7秒)   using System;   using System.Collections.Generic;   using System.Linq;   usi...