Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

class not found when generating pdf #341

Closed
Ognian opened this issue Jun 19, 2020 · 7 comments
Closed

class not found when generating pdf #341

Ognian opened this issue Jun 19, 2020 · 7 comments

Comments

@Ognian
Copy link

Ognian commented Jun 19, 2020

using plantuml 1.2020.13 installed with brew install plantuml

 plantuml -v
(0.000 - 258 Mo) 252 Mo - SecurityProfile LEGACY
(0.011 - 258 Mo) 252 Mo - PlantUML Version 1.2020.13
(0.011 - 258 Mo) 252 Mo - GraphicsEnvironment.isHeadless() true
(0.011 - 258 Mo) 252 Mo - Forcing -Djava.awt.headless=true
(0.011 - 258 Mo) 252 Mo - java.awt.headless set as true
(0.011 - 258 Mo) 252 Mo - Forcing resource load on OpenJdk
2020-06-19 12:04:59.281 java[87974:6000665] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-06-19 12:04:59.282 java[87974:6000665] CoreText note: Set a breakpoint on CTFontLogSystemFontNameRequest to debug.
2020-06-19 12:04:59.283 java[87974:6000665] CoreText note: Client requested name ".SFNS-Bold", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-06-19 12:04:59.283 java[87974:6000665] CoreText note: Client requested name ".SFNSMono-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-06-19 12:04:59.287 java[87974:6000665] CoreText note: Client requested name ".SFNSMono-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-06-19 12:04:59.287 java[87974:6000665] CoreText note: Client requested name ".SFNSMono-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-06-19 12:04:59.290 java[87974:6000665] CoreText note: Client requested name ".SFNS-Regular", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
2020-06-19 12:04:59.290 java[87974:6000665] CoreText note: Client requested name ".SFNS-Bold", it will get Times-Roman rather than the intended font. All system UI font access should be through proper APIs such as CTFontCreateUIFontForLanguage() or +[NSFont systemFontOfSize:].
(0.564 - 258 Mo) 251 Mo - Found 0 files
No diagram found

The above core text notes are related to #305 so that's ok

If I use the following simple class diagram, wich renders in SVG perfectly

@startuml
skinparam class {
BackgroundColor white
}
title SSS
class "yyy" << (S,white) >>
{
}
@enduml

and try to generate PDF plantuml -tpdf xxx.puml I get the following error:

java.lang.ClassNotFoundException: org.apache.batik.apps.rasterizer.SVGConverter
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:602)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:333)
        at net.sourceforge.plantuml.pdf.PdfConverter.convert(PdfConverter.java:58)
        at net.sourceforge.plantuml.UmlDiagram.exportDiagramInternalPdf(UmlDiagram.java:345)
        at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:197)
        at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:140)
        at net.sourceforge.plantuml.PSystemUtils.exportDiagramsCuca(PSystemUtils.java:233)
        at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(PSystemUtils.java:89)
        at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(SourceFileReaderAbstract.java:160)
        at net.sourceforge.plantuml.Run.manageFileInternal(Run.java:530)
        at net.sourceforge.plantuml.Run.processArgs(Run.java:414)
        at net.sourceforge.plantuml.Run.manageAllFiles(Run.java:381)
        at net.sourceforge.plantuml.Run.main(Run.java:192)
Exception in thread "main" java.lang.UnsupportedOperationException
        at net.sourceforge.plantuml.pdf.PdfConverter.convert(PdfConverter.java:77)
        at net.sourceforge.plantuml.UmlDiagram.exportDiagramInternalPdf(UmlDiagram.java:345)
        at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:197)
        at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:140)
        at net.sourceforge.plantuml.PSystemUtils.exportDiagramsCuca(PSystemUtils.java:233)
        at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(PSystemUtils.java:89)
        at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(SourceFileReaderAbstract.java:160)
        at net.sourceforge.plantuml.Run.manageFileInternal(Run.java:530)
        at net.sourceforge.plantuml.Run.processArgs(Run.java:414)
        at net.sourceforge.plantuml.Run.manageAllFiles(Run.java:381)
        at net.sourceforge.plantuml.Run.main(Run.java:192)

any Idea?
Thanks
Ognian

@andrew-hm
Copy link

you have to download the extra pdfs from their website and put them in same directory as the plantuml.jar

@stamilselvan
Copy link

I have the same problem.
Downloaded all the dependencies and placed them in the same folder as plantUml.jar

  • With plantuml-1.2021.14.jar -> ClassNotFoundException
  • With plantuml-1.2021.01.jar (old jar) -> Pdf is generated.

I assume that the feature is broken in some release?

@arnaudroques
Copy link
Contributor

Indeed, the building process has changed.
This should be fixed now. Could you check last snapshot and tell us?
Thanks!

@stamilselvan
Copy link

I confirm that the pdf generation works in the Snapshot taken on 2021-11-18 at 15:33:32 (UTC).
Can this issue be closed after checking the behavior in the upcoming release?

@The-Lum
Copy link
Collaborator

The-Lum commented Jan 16, 2023

Hi all,

[This is an Issue Review]
This is now fixed.

Regards.

@The-Lum The-Lum closed this as completed Jan 16, 2023
@philCryoport
Copy link

philCryoport commented Feb 5, 2024

Hi @The-Lum @stamilselvan @arnaudroques @andrew-hm @Ognian please re-open this? I'm having difficulty with MacOS downloaded PlantUML v1.2023.13:

Bash commands and responses
➜ pwd
/opt/homebrew/Cellar/plantuml/1.2023.13/libexec

➜ ls -ll
total 32984
-rw-r--r--@ 1 pschlesinger  CRYOPORT\Domain Users     60725 Feb  5 14:17 avalon-framework-impl-4.2.0.jar
-rw-r--r--@ 1 pschlesinger  CRYOPORT\Domain Users   4256004 Feb  5 14:18 batik-all-1.9.jar
-rw-r--r--@ 1 pschlesinger  CRYOPORT\Domain Users     83613 Feb  5 14:15 commons-io-1.3.1.jar
-rw-r--r--@ 1 pschlesinger  CRYOPORT\Domain Users     38015 Feb  5 14:16 commons-logging-1.0.4.jar
-rw-r--r--@ 1 pschlesinger  CRYOPORT\Domain Users      2174 Aug 14 06:10 fop-2.9.jar
-rw-r--r--@ 1 pschlesinger  CRYOPORT\Domain Users  11776336 Dec 11 10:43 plantuml.jar
-rw-r--r--@ 1 pschlesinger  CRYOPORT\Domain Users     85686 Aug 14 05:48 xml-apis-ext-1.3.04.jar
-rw-r--r--@ 1 pschlesinger  CRYOPORT\Domain Users    569113 Feb  5 14:19 xmlgraphics-commons-1.4.jar

# Using Java Temurin 21.0.2
➜ java -DPLANTUML_LIMIT_SIZE=30000 -jar plantuml.jar -tpdf foo.puml
2024-02-05 14:33:20.705 java[69493:706342] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:.
java.lang.ClassNotFoundException: org.apache.batik.apps.rasterizer.SVGConverter
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:421)
	at java.base/java.lang.Class.forName(Class.java:412)
	at net.sourceforge.plantuml.pdf.PdfConverter.convert(PdfConverter.java:61)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramInternalPdf(UmlDiagram.java:264)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:134)
	at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:207)
	at net.sourceforge.plantuml.PSystemUtils.exportDiagramsSequence(PSystemUtils.java:153)
	at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(PSystemUtils.java:89)
	at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(SourceFileReaderAbstract.java:190)
	at net.sourceforge.plantuml.Run.manageFileInternal(Run.java:510)
	at net.sourceforge.plantuml.Run.processArgs(Run.java:404)
	at net.sourceforge.plantuml.Run.manageAllFiles(Run.java:371)
	at net.sourceforge.plantuml.Run.main(Run.java:206)
Exception in thread "main" java.lang.UnsupportedOperationException
	at net.sourceforge.plantuml.pdf.PdfConverter.convert(PdfConverter.java:80)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramInternalPdf(UmlDiagram.java:264)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:134)
	at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:207)
	at net.sourceforge.plantuml.PSystemUtils.exportDiagramsSequence(PSystemUtils.java:153)
	at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(PSystemUtils.java:89)
	at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(SourceFileReaderAbstract.java:190)
	at net.sourceforge.plantuml.Run.manageFileInternal(Run.java:510)
	at net.sourceforge.plantuml.Run.processArgs(Run.java:404)
	at net.sourceforge.plantuml.Run.manageAllFiles(Run.java:371)
	at net.sourceforge.plantuml.Run.main(Run.java:206)

# Using Java Temurin 17.0.7
➜ java -DPLANTUML_LIMIT_SIZE=30000 -jar plantuml.jar -tpdf foo.puml
java.lang.ClassNotFoundException: org.apache.batik.apps.rasterizer.SVGConverter
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:375)
	at net.sourceforge.plantuml.pdf.PdfConverter.convert(PdfConverter.java:61)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramInternalPdf(UmlDiagram.java:264)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:134)
	at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:207)
	at net.sourceforge.plantuml.PSystemUtils.exportDiagramsSequence(PSystemUtils.java:153)
	at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(PSystemUtils.java:89)
	at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(SourceFileReaderAbstract.java:190)
	at net.sourceforge.plantuml.Run.manageFileInternal(Run.java:510)
	at net.sourceforge.plantuml.Run.processArgs(Run.java:404)
	at net.sourceforge.plantuml.Run.manageAllFiles(Run.java:371)
	at net.sourceforge.plantuml.Run.main(Run.java:206)
Exception in thread "main" java.lang.UnsupportedOperationException
	at net.sourceforge.plantuml.pdf.PdfConverter.convert(PdfConverter.java:80)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramInternalPdf(UmlDiagram.java:264)
	at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:134)
	at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:207)
	at net.sourceforge.plantuml.PSystemUtils.exportDiagramsSequence(PSystemUtils.java:153)
	at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(PSystemUtils.java:89)
	at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(SourceFileReaderAbstract.java:190)
	at net.sourceforge.plantuml.Run.manageFileInternal(Run.java:510)
	at net.sourceforge.plantuml.Run.processArgs(Run.java:404)
	at net.sourceforge.plantuml.Run.manageAllFiles(Run.java:371)
	at net.sourceforge.plantuml.Run.main(Run.java:206)

Also it looks like there is a pending PR to add native building of PDFs

@philCryoport
Copy link

Hi @The-Lum @stamilselvan @arnaudroques @andrew-hm @Ognian please re-open this? I'm having difficulty with MacOS downloaded PlantUML v1.2023.13:
Bash commands and responses

Also it looks like there is a pending PR to add native building of PDFs

Never mind. @The-Lum tipped me off that there's a PDF-enabled JAR in the current 1.2024.1 release...and I'm guessing in a bunch of prior releases as well.

  1. Go to the releases page
  2. If the PDF-enabled JAR file isn't listed, click the "Show all XX assets" link:
    image
  3. Now look for the PDF-enabled JAR in that release.

Thank you @The-Lum !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants