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就正常了