Closed ttobsen closed 1 year ago
the documentation says the jar files are large, so they need to be downloaded seperated and put into the same folder as plantuml.jar file. So I'm thinking maybe you can download the jar files and mount them to the right folder.
The image has a size of over 400MB, I think the 3.7MB of the JLatexMath extension shouldn't be any problem.
I can't find any plantuml.jar in the Docker image, therefore I don't know where I should mount the JLatexMath files. Any ideas?
Sorry, I just read the instructions, don't know what to do with it. And in docker image, there is a plantuml.war file in tomcat folder, I guess this is the 'plantuml.jar' file.... But, no definitive information I can give you.
If I remeber correctly, I already tried this without success. :-(
I believe the instructions you are referring to are for a standalone setup. For docker setup it is packaged as war and deployed into jetty/tomcat. We can either add JLatex libs as dependencies to pom.xml or keeps them in WEB-INT/lib and build the docker image. Not sure if any other easy options available.
Hi @tphani, does this mean that extracting the JLatexMath files into /var/lib/jetty/lib
should be enough to get this working? If copying the JLatexMath to this place and restart the container, I get the same error message as before:
plantuml | java.lang.ClassNotFoundException: org.scilab.forge.jlatexmath.TeXFormula
plantuml | at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
plantuml | at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
plantuml | at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
plantuml | at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
plantuml | at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:555)
plantuml | at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
plantuml | at java.lang.Class.forName0(Native Method)
plantuml | at java.lang.Class.forName(Class.java:264)
plantuml | at net.sourceforge.plantuml.math.TeXIconBuilder.<init>(TeXIconBuilder.java:53)
plantuml | at net.sourceforge.plantuml.math.LatexBuilder.buildIcon(LatexBuilder.java:66)
plantuml | at net.sourceforge.plantuml.math.LatexBuilder.getImage(LatexBuilder.java:82)
plantuml | at net.sourceforge.plantuml.math.AsciiMath.getImage(AsciiMath.java:106)
plantuml | at net.sourceforge.plantuml.math.ScientificEquationSafe.getImage(ScientificEquationSafe.java:113)
plantuml | at net.sourceforge.plantuml.creole.AtomMath.drawU(AtomMath.java:102)
plantuml | at net.sourceforge.plantuml.creole.SheetBlock1.drawU(SheetBlock1.java:174)
plantuml | at net.sourceforge.plantuml.creole.SheetBlock2.drawU(SheetBlock2.java:82)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.vertical.FtileBox.drawU(FtileBox.java:251)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.UGraphicInterceptorUDrawable2.draw(UGraphicInterceptorUDrawable2.java:67)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.FtileAssemblySimple.drawU(FtileAssemblySimple.java:113)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.FtileWithConnection.drawU(FtileWithConnection.java:72)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.UGraphicInterceptorUDrawable2.draw(UGraphicInterceptorUDrawable2.java:67)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.FtileMargedVertically.drawU(FtileMargedVertically.java:58)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.UGraphicInterceptorUDrawable2.draw(UGraphicInterceptorUDrawable2.java:67)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.FtileAssemblySimple.drawU(FtileAssemblySimple.java:112)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.FtileWithConnection.drawU(FtileWithConnection.java:72)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.UGraphicInterceptorUDrawable2.draw(UGraphicInterceptorUDrawable2.java:67)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.FtileMargedVertically.drawU(FtileMargedVertically.java:58)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.UGraphicInterceptorUDrawable2.draw(UGraphicInterceptorUDrawable2.java:67)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.FtileAssemblySimple.drawU(FtileAssemblySimple.java:112)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.FtileWithConnection.drawU(FtileWithConnection.java:72)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.UGraphicInterceptorUDrawable2.draw(UGraphicInterceptorUDrawable2.java:67)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.FtileMargedVertically.drawU(FtileMargedVertically.java:58)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.UGraphicInterceptorUDrawable2.draw(UGraphicInterceptorUDrawable2.java:67)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.FtileAssemblySimple.drawU(FtileAssemblySimple.java:112)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.FtileWithConnection.drawU(FtileWithConnection.java:72)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.TextBlockInterceptorUDrawable.drawU(TextBlockInterceptorUDrawable.java:56)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ftile.SwimlanesA.drawU(SwimlanesA.java:198)
plantuml | at net.sourceforge.plantuml.ugraphic.comp.TextBlockCompressedOnXorY.drawU(TextBlockCompressedOnXorY.java:61)
plantuml | at net.sourceforge.plantuml.ugraphic.comp.TextBlockCompressedOnXorY.drawU(TextBlockCompressedOnXorY.java:61)
plantuml | at net.sourceforge.plantuml.graphic.TextBlockRecentred.drawU(TextBlockRecentred.java:56)
plantuml | at net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageInternal(ImageBuilder.java:259)
plantuml | at net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageTOBEMOVED(ImageBuilder.java:180)
plantuml | at net.sourceforge.plantuml.activitydiagram3.ActivityDiagram3.exportDiagramInternal(ActivityDiagram3.java:224)
plantuml | at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:201)
plantuml | at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:135)
plantuml | at net.sourceforge.plantuml.servlet.DiagramResponse.sendDiagram(DiagramResponse.java:112)
plantuml | at net.sourceforge.plantuml.servlet.UmlDiagramService.doDiagramResponse(UmlDiagramService.java:101)
plantuml | at net.sourceforge.plantuml.servlet.UmlDiagramService.doGet(UmlDiagramService.java:68)
plantuml | at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
plantuml | at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
plantuml | at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
plantuml | at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1623)
plantuml | at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:214)
plantuml | at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610)
plantuml | at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540)
plantuml | at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
plantuml | at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
plantuml | at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
plantuml | at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
plantuml | at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1700)
plantuml | at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
plantuml | at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345)
plantuml | at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
plantuml | at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480)
plantuml | at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1667)
plantuml | at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
plantuml | at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247)
plantuml | at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
plantuml | at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:220)
plantuml | at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:152)
plantuml | at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
plantuml | at org.eclipse.jetty.server.Server.handle(Server.java:505)
plantuml | at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:370)
plantuml | at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:267)
plantuml | at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
plantuml | at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
plantuml | at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:117)
plantuml | at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:698)
plantuml | at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:804)
plantuml | at java.lang.Thread.run(Thread.java:748)
plantuml | formula=I(x, y) = I(x, y) // 2^n
plantuml | Latex={I}{\left({x},{y}\right)}={I}{\left({x},{y}\right)}/{2}^{{n}}
So there must be another place for copying the files?
Sorry, if I was not clear. As plant uml is running inside Jetty as a webapp (war file), there is no way of copying the jars into it. We need to build the war with the dependent jars and for that the docker file needs to be modified accordingly. I will try to do this and share in couple of days.
Alright, thanks. I'm a total noob with this whole Jetty stuff. If you need any help for testing let me know. :smiley:
As we cannot add the libs directly to Jetty, I have added them as dependencies to pom.xml
as below in the dependencies section:
<dependency>
<groupId>org.scilab.forge</groupId>
<artifactId>jlatexmath</artifactId>
<version>1.0.7</version>
</dependency>
<dependency>
<groupId>org.scilab.forge</groupId>
<artifactId>jlatexmath-font-greek</artifactId>
<version>1.0.7</version>
</dependency>
<dependency>
<groupId>org.scilab.forge</groupId>
<artifactId>jlatexmath-font-cyrillic</artifactId>
<version>1.0.7</version>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>batik-all</artifactId>
<version>1.12</version>
</dependency>
Now build the docker image: docker build -t plantumlwithmath .
And run it: docker run --rm -d -p 8080:8080 --name pu plantumlwithmath
This works well for me, not sure if there is any simple way of doing it.
Thanks!
Hi @tphani, I just tested it, and it works perfectly. I will create a PR and hope that the changes are finding its way into the repo very soon.
I would love to have this feature. Any progress on merging this?
Sorry it took so long, but I managed to get the alternate way of copying the jar files into the container working fine. Till the changes make it to the official repo, we can do this:
docker run -p 8080:8080 --name puml plantuml/plantuml-server:tomcat
docker cp ~/downloads/jlatex/. puml:/usr/local/tomcat/webapps/ROOT/WEB-INF/lib
Where
~/downloads/jlatex - is the folder containing the jar files. Also note the "." at the end
puml - is the container namedocker container start puml
We will loose the changes if we remove the container, but we can run latest version of puml without building it.
And for the jetty image, use /var/lib/jetty/lib/ext
instead of /usr/local/tomcat/webapps/ROOT/WEB-INF/lib
:-)
The Jetty Docker image does not support JLatexMath and therefore the
Would it be possible to add JLatexMath support? I'm no Java expert, but I can help with the Dockerfile. I just have to know where the JAR files from the Zip archive needs to be placed.