Could not parse svg error while using image rest call

250 views
Skip to first unread message

Carlos C. Salazar

unread,
Jun 2, 2016, 10:33:01 AM6/2/16
to jBPM Usage
Hi:

I am using jbpm 6.4 and I am trying to use the ...../jbpm-console/rest/runtime/{deploymentid}/process/{processiddef}/image/{procid} rest call and I get the error:

.......java.lang.RuntimeException: Could not parse svg...... 

this error is throw by jbpm-process-svg at the point org.jbpm.process.svg.SVGImageProcessor line 67

I also tested with jbpm 6.3 (upgrading the jbpm-console-ng-rest.... jar) and I get the same error.

I did all the preparing steps (like changing <storesvgonsave enabled="false"/> to true and saving again the process). I am sure that the svg is being generated in the kjar because when I call ...../jbpm-console/rest/runtime/{deploymentid}/process/{processiddef}/image (without the procid) I get the image for the process. 

I started my process and while it's waiting a human task response I've made the rest call before getting the error.

What I am doing wrong?

Regards,

Maciej Swiderski

unread,
Jun 3, 2016, 5:20:52 AM6/3/16
to Carlos C. Salazar, jBPM Usage
could you share complete stack trace? That way we could see what is happening and what might be the source of the issues.

Maciej
--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-usage/d817c2fc-40ad-41bf-a336-9ee92e5a7cfd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carlos C. Salazar

unread,
Jun 3, 2016, 8:48:41 AM6/3/16
to jBPM Usage
H Maciej thank you for your answer. Here it goes the stack trace:

2016-06-03 08:42:58,240 ERROR [io.undertow.request] (default task-44) UT005023: Exception handling request to /jbpm-console/rest/runtime/bo.com.Lafuente:operaciones-Lafuente:1.0/process/operaciones-Lafuente.aprobacion-operaciones/image/5: org.jboss.resteasy.spi.UnhandledException: java.lang.RuntimeException: Could not parse svg
at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:76) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:212) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:149) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:372) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:179) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:220) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:56) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:51) [resteasy-jaxrs-3.0.10.Final.jar:]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final.jar:1.0.0.Final]
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:86) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:130) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at org.kie.remote.services.rest.jaxb.DynamicJaxbContextFilter.doFilter(DynamicJaxbContextFilter.java:67) [kie-remote-services-6.4.0.Final.jar:6.4.0.Final]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at org.uberfire.ext.security.server.BasicAuthSecurityFilter.doFilter(BasicAuthSecurityFilter.java:78) [uberfire-servlet-security-0.8.0.Final.jar:0.8.0.Final]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at org.uberfire.ext.security.server.SecureHeadersFilter.doFilter(SecureHeadersFilter.java:69) [uberfire-servlet-security-0.8.0.Final.jar:0.8.0.Final]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at org.uberfire.ext.security.server.SecurityIntegrationFilter.doFilter(SecurityIntegrationFilter.java:61) [uberfire-servlet-security-0.8.0.Final.jar:0.8.0.Final]
at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:60) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:132) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:85) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.security.handlers.AuthenticationConstraintHandler.handleRequest(AuthenticationConstraintHandler.java:51) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.security.ServletSecurityConstraintHandler.handleRequest(ServletSecurityConstraintHandler.java:56) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:248) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:77) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:167) [undertow-servlet-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:761) [undertow-core-1.1.8.Final.jar:1.1.8.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_101]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_101]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_101]
Caused by: java.lang.RuntimeException: Could not parse svg
at org.jbpm.process.svg.SVGImageProcessor.<init>(SVGImageProcessor.java:62) [jbpm-process-svg-6.4.0.Final.jar:6.4.0.Final]
at org.jbpm.process.svg.SVGImageProcessor.<init>(SVGImageProcessor.java:50) [jbpm-process-svg-6.4.0.Final.jar:6.4.0.Final]
at org.jbpm.process.svg.SVGImageProcessor.transform(SVGImageProcessor.java:67) [jbpm-process-svg-6.4.0.Final.jar:6.4.0.Final]
at org.jbpm.console.ng.rest.ProcessImageResourceImpl.getActiveProcessImage(ProcessImageResourceImpl.java:166) [jbpm-console-ng-rest-6.4.0-20160418.230309-885.jar:6.4.0-SNAPSHOT]
at org.jbpm.console.ng.rest.ProcessImageResourceImpl$Proxy$_$$_WeldClientProxy.getActiveProcessImage(Unknown Source) [jbpm-console-ng-rest-6.4.0-20160418.230309-885.jar:6.4.0-SNAPSHOT]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_101]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_101]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_101]
at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_101]
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:137) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:296) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:250) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:237) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356) [resteasy-jaxrs-3.0.10.Final.jar:]
... 47 more
Caused by: java.io.IOException: The content of elements must consist of well-formed character data or markup.
at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source) [batik-dom-1.6.1-1.jar:]
at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source) [batik-dom-1.6.1-1.jar:]
at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown Source) [batik-svg-dom-1.6.1-1.jar:]
at org.jbpm.process.svg.SVGImageProcessor.<init>(SVGImageProcessor.java:59) [jbpm-process-svg-6.4.0.Final.jar:6.4.0.Final]
... 60 more

Kris Verlaenen

unread,
Jun 3, 2016, 8:49:39 PM6/3/16
to Carlos C. Salazar, jBPM Usage
Could you also provide the contents of the svg file (that is stored next to the process)?  It's complaining the content isn't well-formed but not clear why.

Kris

--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.

Carlos C. Salazar

unread,
Jun 3, 2016, 9:27:28 PM6/3/16
to jBPM Usage
Hi Kris, of course I could provide the svg file, however as I told you when only using ..../image  (without procID), it works perfectly so in theory the svg image should be well formed. 

Attached the svg file.

Regards,

On Thursday, June 2, 2016 at 10:33:01 AM UTC-4, Carlos C. Salazar wrote:
operaciones-Lafuente.aprobacion-operaciones-svg.svg

Carlos C. Salazar

unread,
Jun 8, 2016, 11:16:50 PM6/8/16
to jBPM Usage
Any hope with what's wrong with this rest call. What could I do?

Regards,

On Thursday, June 2, 2016 at 10:33:01 AM UTC-4, Carlos C. Salazar wrote:

Carlos C. Salazar

unread,
Jul 8, 2016, 10:24:45 PM7/8/16
to jBPM Usage
Finally I found the problem. When saving the *-svg.svg image in the kjar it does not translate characters like < o > to &lt; or &gt; inside BPMN object labels. I had a couple of them in my business process. I removed the > and < characters (less than, greater than) from the labels and now the rest return the correct image.

Question is how to avoid this? which program should be corrected. I have all the git programs for 6.4.x branch so I could post a fix. It would be easier if someone has the name of the java program that saves the svg file.

By the way, I pulled the last change made for the jbpm-console-ng-rest module. I seems that the rest path was changed. But it gives an error when you try to use the rest for starting a process. It's not found since the path for jbpm-console-ng-rest have the same signature. Going back to original library remedies the problem.

Hope this will help someone.


On Thursday, June 2, 2016 at 10:33:01 AM UTC-4, Carlos C. Salazar wrote:

Maciej Swiderski

unread,
Jul 9, 2016, 9:14:13 AM7/9/16
to Carlos C. Salazar, jBPM Usage
I believe it should be fixed in designer that saves svg. Could you please drop jira for it?

Maciej
--
You received this message because you are subscribed to the Google Groups "jBPM Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-usage+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages