Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#807928: [plantuml] plantuml does not render to PDF

502 views
Skip to first unread message

Daniel Hornung

unread,
Dec 14, 2015, 9:50:04 AM12/14/15
to
Package: plantuml
Version: 8024-2
Severity: normal

--- Please enter the report below this line. ---

When trying to render to pdf (svg and png work fine), these are the Java
exceptions:

$ plantuml -tpdf test_uml.pu

java.lang.ClassNotFoundException:
org.apache.batik.apps.rasterizer.SVGConverter
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at net.sourceforge.plantuml.pdf.PdfConverter.convert(Unknown Source)
at
net.sourceforge.plantuml.UmlDiagram.exportDiagramInternalPdf(Unknown Source)
at net.sourceforge.plantuml.UmlDiagram.exportDiagram(Unknown Source)
at net.sourceforge.plantuml.PSystemUtils.exportDiagramsCuca(Unknown
Source)
at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(Unknown
Source)
at
net.sourceforge.plantuml.SourceFileReader.getGeneratedImages(Unknown Source)
at net.sourceforge.plantuml.Run.manageFileInternal(Unknown Source)
at net.sourceforge.plantuml.Run.processArgs(Unknown Source)
at net.sourceforge.plantuml.Run.manageAllFiles(Unknown Source)
at net.sourceforge.plantuml.Run.main(Unknown Source)
Exception in thread "main" java.lang.UnsupportedOperationException
at net.sourceforge.plantuml.pdf.PdfConverter.convert(Unknown Source)
at
net.sourceforge.plantuml.UmlDiagram.exportDiagramInternalPdf(Unknown Source)
at net.sourceforge.plantuml.UmlDiagram.exportDiagram(Unknown Source)
at net.sourceforge.plantuml.PSystemUtils.exportDiagramsCuca(Unknown
Source)
at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(Unknown
Source)
at
net.sourceforge.plantuml.SourceFileReader.getGeneratedImages(Unknown Source)
at net.sourceforge.plantuml.Run.manageFileInternal(Unknown Source)
at net.sourceforge.plantuml.Run.processArgs(Unknown Source)
at net.sourceforge.plantuml.Run.manageAllFiles(Unknown Source)
at net.sourceforge.plantuml.Run.main(Unknown Source)

org.apache.batik.apps.rasterizer.SVGConverter exists though in
/usr/share/java/batik-rasterizer.jar, which exists here and is provided by
libbatik-java (maybe this should become a dependency, by the way?). So maybe
this should be added to the class path at compile time? Sorry, I don't know
enough about java compilation for proper suggestions.


--- System information. ---
Architecture: amd64
Kernel: Linux 4.2.0-1-amd64

Debian Release: stretch/sid
500 testing www.deb-multimedia.org
500 testing snapshot.debian.org
500 testing security.debian.org
500 testing ftp5.gwdg.de
500 stretch neurodebian.ovgu.de
500 data neurodebian.ovgu.de

--- Package information. ---
Package's Depends field is empty.

Package's Recommends field is empty.

Package's Suggests field is empty.
--
Max-Planck-Institute for Dynamics and Self-Organization
Research Group Biomedical Physics

Am Fassberg 17
D-37077 Goettingen
(+49) 551 5176 373

You can obtain my public key 0xF197B128 from all keyservers, e.g. pgp.mit.edu
Fingerprint: 9698 BDD4 71CC 1274 B7E2 2049 1EDD 012D F197 B128
signature.asc

Daniel Hornung

unread,
Dec 14, 2015, 10:40:02 AM12/14/15
to
On Monday 14 December 2015 16:11:28 you wrote:
> Hello,
>
> About PDF generations, you have to install several supplementary jar files:
> avalon-framework-4.2.0.jar
> batik-all-1.7.jar
> commons-io-1.3.1.jar
> commons-logging-1.0.4.jar
> fop.jar
> xml-apis-ext-1.3.04.jar
> xmlgraphics-commons-1.4.jar
>
> You will find some details on http://plantuml.com/pdf.html
>
> Tell us if it's working for you.
>
> Regards,
>
> Arnaud Roques

Hi,

it's the same whether I explicitly set the classpath to the local location
(shouldn't that be found automatically?) or a folder with the jars from your
site.

System jars:

$ java -jar /usr/share/plantuml/plantuml.jar -cp /usr/share/java/ -tpdf
data_model.plant_uml.pu
Exception in thread "main" java.lang.UnsupportedOperationException: PDF
at
net.sourceforge.plantuml.ugraphic.ImageBuilder.createUGraphic(Unknown Source)
at
net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageTOBEMOVED(Unknown
Source)
at
net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageTOBEMOVED(Unknown
Source)
at net.sourceforge.plantuml.PSystemError.exportDiagram(Unknown Source)
at net.sourceforge.plantuml.PSystemUtils.exportDiagramsDefault(Unknown
Source)
at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(Unknown
Source)
at
net.sourceforge.plantuml.SourceFileReader.getGeneratedImages(Unknown Source)
at net.sourceforge.plantuml.Run.manageFileInternal(Unknown Source)
at net.sourceforge.plantuml.Run.processArgs(Unknown Source)
at net.sourceforge.plantuml.Run.manageAllFiles(Unknown Source)
at net.sourceforge.plantuml.Run.main(Unknown Source)

Local jars, from the zip file:

$ java -jar /usr/share/plantuml/plantuml.jar -cp ./jars/ -tpdf
data_model.plant_uml.pu
Exception in thread "main" java.lang.UnsupportedOperationException: PDF
at
net.sourceforge.plantuml.ugraphic.ImageBuilder.createUGraphic(Unknown Source)
at
net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageTOBEMOVED(Unknown
Source)
at
net.sourceforge.plantuml.ugraphic.ImageBuilder.writeImageTOBEMOVED(Unknown
Source)
at net.sourceforge.plantuml.PSystemError.exportDiagram(Unknown Source)
at net.sourceforge.plantuml.PSystemUtils.exportDiagramsDefault(Unknown
Source)
at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(Unknown
Source)
at
net.sourceforge.plantuml.SourceFileReader.getGeneratedImages(Unknown Source)
at net.sourceforge.plantuml.Run.manageFileInternal(Unknown Source)
at net.sourceforge.plantuml.Run.processArgs(Unknown Source)
at net.sourceforge.plantuml.Run.manageAllFiles(Unknown Source)
at net.sourceforge.plantuml.Run.main(Unknown Source)

The problem that the library can not be found goes away in both cases, but the
second exception remains.
signature.asc

Daniel Hornung

unread,
Dec 15, 2015, 6:30:03 AM12/15/15
to
I found one way to fix this manually:

In the plantuml.jar, add to the manifest (META-INF/MANIFEST.MF) the following
line:

Class-Path: /usr/share/java/batik-rasterizer.jar /usr/share/java/batik-
transcoder.jar /usr/share/java/fop.jar

With this line, export to pdf works for me without specifying the classpath
manually.

For the Debian build script, this should probably be included, either manually
or somewhere in the Ant building specifications.

Additionally, maybe the packages providing these jars should be added as
recommended dependencies:

libfop-java (provides /usr/share/java/fop.jar)
libbatik-java (provides batik-rasterizer.jar and batik-transcoder.jar, but is
already a dependency for libfop-java, so the former should be enough)
signature.asc

Andrew Shadura

unread,
Jan 12, 2016, 6:20:02 AM1/12/16
to
On 15 December 2015 at 12:17, Daniel Hornung <daniel....@ds.mpg.de> wrote:
> In the plantuml.jar, add to the manifest (META-INF/MANIFEST.MF) the following
> line:
>
> Class-Path: /usr/share/java/batik-rasterizer.jar /usr/share/java/batik-
> transcoder.jar /usr/share/java/fop.jar
>
> With this line, export to pdf works for me without specifying the classpath
> manually.
>
> For the Debian build script, this should probably be included, either manually
> or somewhere in the Ant building specifications.
>
> Additionally, maybe the packages providing these jars should be added as
> recommended dependencies:
>
> libfop-java (provides /usr/share/java/fop.jar)
> libbatik-java (provides batik-rasterizer.jar and batik-transcoder.jar, but is
> already a dependency for libfop-java, so the former should be enough)

Daniel, thanks for your investigations.

I will have a look at this when I find time. This certainly is a thing
we should have enabled in PlantUML in Debian.

--
Cheers,
Andrew
0 new messages