springboot整合activiti5.22在线流程设计器模型出错

2021-02-21_132657.png
angular.min.js:85 TypeError: Cannot read property 'split' of undefined
    at Object.ORYX.Core.StencilSet.stencilSet (oryx.debug.js:8859)
    at oryx.debug.js:8837
    at prototype-1.5.1.js:458
    at Array._each (prototype-1.5.1.js:684)
    at Array.each (prototype-1.5.1.js:457)
    at Object.ORYX.Core.StencilSet.stencilSets (oryx.debug.js:8836)
    at classDef.getStencilSets (oryx.debug.js:12022)
    at classDef._createCanvas (oryx.debug.js:11503)
    at classDef.construct (oryx.debug.js:11219)
    at new classDef (oryx.debug.js:1805)

分析

查看http://localhost:8090/modeler/editor/stencilset?version=1613884245370请求,响应内容
"{\r\n  \"title\": \"流程编辑器\",\r\n  \"namespace\": \"http://b3mn.org/stencilset/bpmn2.0#\",\r\n  \"description\": \"BPMN流程编辑器\",\r\n  \"propertyPackages\": 。。。
发现返回的是字符串,实际需要返回的是json字符串,继续看后台,发现使用了MappingJackson2HttpMessageConverter
     //定义时间格式转换器
     @Bean
     public MappingJackson2HttpMessageConverter jackson2HttpMessageConverter() {
         MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
         ObjectMapper mapper = new ObjectMapper();
         mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
         mapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"));
         converter.setObjectMapper(mapper);
         return converter;
     }

       //添加转换器
     @Override
     protected void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
       super.configureMessageConverters(converters);
       //将我们定义的时间格式转换器添加到转换器列表中,
         //这样jackson格式化时候但凡遇到Date类型就会转换成我们定义的格式
         converters.add(jackson2HttpMessageConverter());
     }

将代码注释掉,不要使用MappingJackson2HttpMessageConverter就正常了

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容