Error when creating Json block with component or rectangle

+1 vote
asked Dec 2, 2022 in Bug by Arin

​Error java.lang.ClassCastException: net.sourceforge.plantuml.descdiagram.DescriptionDiagram cannot be cast to net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram

java.lang.ClassCastException: net.sourceforge.plantuml.descdiagram.DescriptionDiagram cannot be cast to net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram

at net.sourceforge.plantuml.objectdiagram.command.CommandCreateJson.executeNow(CommandCreateJson.java:66)

at net.sourceforge.plantuml.command.CommandMultilines2.execute(CommandMultilines2.java:111)

at net.sourceforge.plantuml.command.ProtectedCommand.execute(ProtectedCommand.java:55)

at net.sourceforge.plantuml.AbstractPSystem.executeCommand(AbstractPSystem.java:158)

at net.sourceforge.plantuml.command.PSystemCommandFactory.executeFewLines(PSystemCommandFactory.java:125)

at net.sourceforge.plantuml.command.PSystemCommandFactory.createSystem(PSystemCommandFactory.java:108)

at net.sourceforge.plantuml.PSystemBuilder.createPSystem(PSystemBuilder.java:137)

at net.sourceforge.plantuml.BlockUml.getDiagram(BlockUml.java:179)

at net.sourceforge.plantuml.SourceStringReader.outputImage(SourceStringReader.java:159)

at net.sourceforge.plantuml.Pipe.generateDiagram(Pipe.java:101)

at net.sourceforge.plantuml.Pipe.managePipe(Pipe.java:92)

at net.sourceforge.plantuml.Run.managePipe(Run.java:354)

at net.sourceforge.plantuml.Run.main(Run.java:181)

You should send a mail to plantuml@gmail.com or post to http://plantuml.com/qa with this log (V1.2022.13)

ERROR

28

You should send a mail to plantuml@gmail.com or post to http://plantuml.com/qa with this log (V1.2022.13) java.lang.ClassCastException: net.sourceforge.plantuml.descdiagram.DescriptionDiagram cannot be cast to net.sourceforge.plantuml.objectdiagram.AbstractClassOrObjectDiagram

Some diagram description contains errors


JSON diagram seems to conflict when having a component.

If I change component to class it works. Everything works fine on the online editor. This is just happening in VSCode PlantUML previewer (https://marketplace.visualstudio.com/items?itemName=jebbs.plantuml). I updated to latest JAR.

@startuml

component ProcessCommunicationRequest

json Request {

"recipients": [

]

}

@enduml

1 Answer

+1 vote
answered Dec 3, 2022 by The-Lu (64,760 points)

Hello A., and all,

Perhaps add: allowmixing or allow_mixing

But without and with the last version (1.2022.14b6), it seems ok, as:


Enjoy.
Regards.

commented Dec 5, 2022 by blake.johnson (100 points)

Not the original asker, but I'm having the same issue on V1.2022.13 which is the current version available via the Windows 'choco' installer. I downloaded the ~v1.2022.14beta7 release from GitHub and replaced the choco provided plantuml.jar with the beta release. It works fine with the beta jar.

Just a datapoint that to the extent this is/was a bug, it may have been fixed already in 2022.14.

Thanks for posting the results on beta, I would have not thought to try that.

...