当保存流程时,无法保存流程,提示:Unexpected error: could not save model
操作如下
图一 点击保存流程:
图二:确认保存流程
图三:保存失败,提示Unexpected error: could not save model
然后查询后台异常堆栈信息,报以下异常错误:
六月 07, 2018 11:55:12 上午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [dispatcher] in context with path [/activiti-explorer] threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: org/apache/batik/script/InterpreterPool] with root cause
java.lang.ClassNotFoundException: org.apache.batik.script.InterpreterPool
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
at org.apache.batik.bridge.BridgeContext.<clinit>(BridgeContext.java:276)
at org.apache.batik.transcoder.SVGAbstractTranscoder.createBridgeContext(SVGAbstractTranscoder.java:337)
at org.apache.batik.transcoder.SVGAbstractTranscoder.createBridgeContext(SVGAbstractTranscoder.java:313)
at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:194)
at org.apache.batik.transcoder.image.ImageTranscoder.transcode(ImageTranscoder.java:92)
at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(XMLAbstractTranscoder.java:142)
at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(SVGAbstractTranscoder.java:156)
at org.activiti.rest.editor.model.ModelSaveRestResource.saveModel(ModelSaveRestResource.java:82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133)
对应的截图:
经分析异常报错信息:怀疑是找不到 org.apache.batik.script.InterpreterPool 这个类,于是上网找到这个类所对应的jar包。
之后在activiti-explorer项目pom.xml文件中添加所需jar包依赖,如下所示
<!-- https://mvnrepository.com/artifact/batik/batik-script -->
<dependency>
<groupId>batik</groupId>
<artifactId>batik-script</artifactId>
<version>1.6</version>
</dependency>
对应的项目截图如下:
之后再重新对项目 mvc clean install,如下图所示:
执行完mvc clean install后 再重新运行项目:执行 mvc tomcat7:run,如下图所示
然后重新进入系统,在流程工作区设计新流程,保存流程成功!问题解决!