PlantUML Problems

As I was doing some testing with the PlantUML Macro I had multiple problems. Many of the examples at https://plantuml.com/ wasn’t working as they do at the Online-Demo-Servers.

Example for nwdiag: the “long group label” is not rendered the same:

@startuml
nwdiag {
  network DMZ {
      address = "y.x.x.x/24"
      web01 [address = "y.x.x.1"];
      web02 [address = "y.x.x.2"];
  }
   network Internal {
    web01;
    web02;
    db01 [address = "w.w.w.z", shape = database];
  } 
    group {
    description = "long group label";
    web01;
    web02;
    db01;
  }
}
@enduml

Several other examples fail with something like this:

182186950

… including the following example from the documentation page of the macro:

@startuml
package "Classic Collections" #DDDDDD {
  Object <|-- ArrayList
}

package net.sourceforge.plantuml {
  Object <|-- Demo1
  Demo1 *- Demo2
}
@enduml

Is there something I do wrong?

Have you configured something ? From what I understand of https://extensions.xwiki.org/xwiki/bin/view/Extension/PlantUML%20Macro#HConfiguration getting an error related to Graphviz might suggest you set plantuml.server to an empty value.

Or there is a problem when it tries to access the server (maybe you block it ?) which cause the macro to fallback on Graphviz (which you probably did not install). You might find more information on what exactly went wrong in your application server log.

Hi! Unable to reproduce. It is working great here:

Perhaps you can describe your environment and the installation process to help to work out your issues?

Cheers!

I have the same Issue on a localhost environment (XWiki Jetty HSQLDB 15.10.11) and the same behavior on our XWiki SAS Cloud environment (XWiki 15.10.10). I didn’t change any configuration and I didn’t block the server. The log-file is empty at every log-level.

Copied your source to my page with the following result:

All good for me with the 15.10.11 demo package and

{{plantuml}}
@startuml
:Customer: -> (Withdraw)
note right of (Withdraw) : This is an example.
@enduml
{{/plantuml}}

now maybe I have Graphviz installed locally, not sure.

Edit: I do apparently seems to have a graphviz package installed on Ubuntu 24.04 (seems to be a dependency of Gimp). So it’s possible that’s why it’s working, maybe the extension has some problem with the default server and does not log anything about it.

After installing PlantUML Administration and setting the server to PlantUML Web Server it works after refreshing the page (hard reload). Setting the server manually with {{plantuml server="http://www.plantuml.com/plantuml"}} works as well.

Thanks for your help!

Indeed, from what I see in the code there does not seem to be any server by default, which seems to contradict what’s indicated on https://extensions.xwiki.org/xwiki/bin/view/Extension/PlantUML%20Macro#HConfiguration.

Edit: Actually the default is in the admin extension, if you don’t install it you don’t have the default.

1 Like

I guess the contradictory line is “It works out of the box with all the different kinds of diagrams, using the PlantUML server available on the internet.”

As PlantUML Administration is not installed as a dependency, the only alternatives are 1) to hard code a default PlantUML server or 2) to say that we must use the server parameter of the PlantUML macro at least you install and use PlantUML Administration or set a server in xwiki.properties.

It is a bit confusing to me. Why don’t install PlantUML Administration and PlantUML Macro as mutually dependent? In particular Maxime (I don’t know how to reach him!), @vmassol, what do you think?

They are dependent on one another but from the direction https://extensions.xwiki.org/xwiki/bin/view/Extension/PlantUML%20Administration/ to https://extensions.xwiki.org/xwiki/bin/view/Extension/PlantUML%20Macro

See https://extensions.xwiki.org/xwiki/bin/view/Extension/PlantUML%20Administration/#HDependencies

This is a typical problem we have. For the jira extension I’ve made the admin ui depends on the macro but it has its problems too.

The doc is probably missing some explanation that to have the default server configured you need to istall the admin extension.

Is it not possible to declare two extensions as mutually dependent? Accept my apologies if the question is too naive, please!

No, that would be a circular dependency…

See Extension Manager feature for conditional installation of extension? which is related I think.

Thanks! I will read and think about it. I’m afraid it is far beyond my skills to contribute to that discussion. But I don’t understand why “circular” can not be acceptable in some circumstances.

If you have A that depends on B, it means that B must be installed first since it could have stuff that is needed for A to be installed. And if B depends on A too, then the same happens. Thus there’s no way to choose which one to install first.

And why the order does matter? Can’t declare both extensions “mutually dependent”. A can’t be installed without installing B. And B can’t be installed without installing A. I don’t mind what extension I install in the first place. Logically, I would expect to need an administrator if I have anything to administrate, but as both are “extensions”, I can survive at forgetting that logic!

As I said above:

[…] it could have stuff that is needed for A to be installed […]

Example:

  • A JAR extension (A) provides a java interface for a component
  • Extension (B) implements the interface.

If you don’t install A before B then the installation of B will fail.

The same can happen for XARs.

So what we would need to implement what you said would be to have a way for developers to declare in an extension that its dependencies are only needed when the extension is used but not needed to install it.

Note that when the extensions are being installed, anyone navigating to some pages of the extension would generate errors and problems because of the missing deps too.

It’s a pretty slippery slope.

2 Likes