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

NoClassDefFoundError java/awt/image/ComponentColorModel for generating PlantUML diagram #1606

Closed
DerkSchooltink opened this issue Aug 1, 2023 · 2 comments · Fixed by #1615

Comments

@DerkSchooltink
Copy link

When running the Docker image locally on my M2 MacBook Pro using the following command:

docker run -p8000:8000 -e KROKI_COMMAND_TIMEOUT=1m -d yuzutech/kroki

And using the following payload in the HTTP request:

!include <archimate/Archimate.puml>
!include <awslib/AWSCommon>
!include <awslib/Groups/all.puml>
!include <tupadr3/common>

left to right direction

AWSAccountGroup(externalAccount, "AWS account external") {
        
}

I receive the following error:

An error has occured: java.lang.NoClassDefFoundError: java/awt/image/ComponentColorModel

Diagram size: 35112 lines / 2106549 characters.
PlantUML (1.2023.7) cannot parse result from dot/GraphViz.
Please go to https://plantuml.com/graphviz-dot to check your GraphViz version.

Java Runtime: null
JVM: Substrate VM
Default Encoding: UTF-8
Language: null
Country: null

PLANTUML_LIMIT_SIZE: 4096

This may be caused by :

  • a bug in PlantUML
  • a problem in GraphViz

You should send this diagram and this image to [email protected] or post to https://plantuml.com/qa to solve this issue.
You can try to turn around this issue by simplifing your diagram.

java.lang.NoClassDefFoundError: java/awt/image/ComponentColorModel
org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.functions.JNIFunctions.FindClass(JNIFunctions.java:343)
[email protected]/sun.awt.image.ImagingLib.transformBI(ImagingLib.java)
[email protected]/sun.awt.image.ImagingLib.filter(ImagingLib.java:252)
[email protected]/java.awt.image.AffineTransformOp.filter(AffineTransformOp.java:286)
net.atmp.PixelImage.getImage(PixelImage.java:82)
net.sourceforge.plantuml.klimt.shape.UImage.getWidth(UImage.java:87)
net.sourceforge.plantuml.klimt.drawing.LimitFinder.drawImage(LimitFinder.java:189)
net.sourceforge.plantuml.klimt.drawing.LimitFinder.draw(LimitFinder.java:120)
net.sourceforge.plantuml.klimt.drawing.AbstractUGraphicHorizontalLine.draw(AbstractUGraphicHorizontalLine.java:77)
net.sourceforge.plantuml.klimt.creole.atom.AtomImg.drawU(AtomImg.java:207)
net.sourceforge.plantuml.klimt.creole.SheetBlock1.drawU(SheetBlock1.java:199)
net.sourceforge.plantuml.klimt.creole.SheetBlock2.drawU(SheetBlock2.java:104)
net.sourceforge.plantuml.decoration.symbol.USymbolRectangle$2.drawU(USymbolRectangle.java:131)
net.sourceforge.plantuml.svek.ClusterDecoration.drawU(ClusterDecoration.java:82)
net.sourceforge.plantuml.svek.Cluster.drawU(Cluster.java:348)
net.sourceforge.plantuml.svek.SvekResult.drawU(SvekResult.java:76)
net.sourceforge.plantuml.klimt.shape.TextBlockUtils.getMinMax(TextBlockUtils.java:145)
net.sourceforge.plantuml.svek.SvekResult.calculateDimension(SvekResult.java:140)
net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFileInternal(CucaDiagramFileMakerSvek.java:125)
net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFile(CucaDiagramFileMakerSvek.java:70)
net.atmp.CucaDiagram.exportDiagramInternal(CucaDiagram.java:435)
net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:142)
net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:198)
net.sourceforge.plantuml.SourceStringReader.outputImage(SourceStringReader.java:165)
net.sourceforge.plantuml.Pipe.generateDiagram(Pipe.java:103)
net.sourceforge.plantuml.Pipe.managePipe(Pipe.java:94)
net.sourceforge.plantuml.Run.managePipe(Run.java:357)
net.sourceforge.plantuml.Run.main(Run.java:184)**

Considering I do not get this error if I use the jar file locally, I figured there must be something related to the Docker image that is causing this error. I did some experimenting changing Java JDK's building my own Docker image locally, but no success.

@emkah-bahn
Copy link

Currently looking at the same problem in a GitLab Instance that uses kroki for rendering PlantUML diagrams after the update to 0.21.3.

As far as i can tell seems to happen only for some definitions from awslib includes though. The basic PlantUML stuff works and also some of the awslib definitions.

Can also be reproduced with https://kroki.io/#try

This works:

!include <awslib/AWSCommon.puml>
!include <awslib/Compute/all.puml>

EC2Instance(az_1_ec2_1, "Instance", "")

This does not work:

!include <awslib/AWSCommon.puml>
!include <awslib/Groups/all.puml>

AWSCloudGroup(cloud) {
}

@ggrossetie
Copy link
Member

Will be fixed in https://github.com/yuzutech/plantuml

ggrossetie added a commit to yuzutech/plantuml that referenced this issue Aug 13, 2023
ggrossetie added a commit to ggrossetie/kroki that referenced this issue Aug 15, 2023
ggrossetie added a commit to yuzutech/plantuml that referenced this issue Sep 23, 2023
ggrossetie added a commit to yuzutech/plantuml that referenced this issue Jan 13, 2024
ggrossetie added a commit to yuzutech/plantuml that referenced this issue Feb 11, 2024
ggrossetie added a commit to yuzutech/plantuml that referenced this issue Feb 15, 2025
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

Successfully merging a pull request may close this issue.

3 participants