plantuml / plantuml-server

PlantUML Online Server
https://plantuml.com/
GNU General Public License v3.0
1.59k stars 463 forks source link

Multiple warnings about 'fop' and 'fop-core' when running server under Ubuntu #297

Closed Belaslav closed 1 year ago

Belaslav commented 1 year ago

Describe the bug When running a local instance of PlantUML server via mvn jetty:run, there are multiple warnings about classes being scanned from multiple locations:

[WARNING] org.apache.fop.util.text.LocatorFormatter scanned from multiple locations: jar:file:///home/belaslav/.m2/repository/org/apache/xmlgraphics/fop/2.8/fop-2.8.jar!/org/apache/fop/util/text/LocatorFormatter.class, jar:file:///home/belaslav/.m2/repository/org/apache/xmlgraphics/fop-core/2.8/fop-core-2.8.jar!/org/apache/fop/util/text/LocatorFormatter.class

To Reproduce Steps to reproduce the behavior:

  1. Under Ubuntu, run git clone https://github.com/plantuml/plantuml-server.git
  2. Go into plantuml-server dir
  3. Run mvn jetty:run
  4. See warning above

Expected behavior No warnings.

Desktop (please complete the following information):

HeinrichAD commented 1 year ago

First, I can reproduce the issue also on an ArchLinux system. Additionally, these warnings also appear inside the jetty docker container.

If I search for classpath issues only for the project itself (mvn duplicate-finder:check), I only get 3 warnings. All these are only generated during "Checking test classpath". So, no issues on the classpath during compile or runtime. In my opinion this is justifiable.

Detailed answer about project's classpath analyis:
io.netty.channel ``` [WARNING] Found duplicate and different classes in [io.netty:netty-transport-classes-epoll:4.1.92.Final, io.netty:netty-transport-native-epoll:4.1.60.Final:jar:linux-x86_64]: [WARNING] io.netty.channel.epoll.AbstractEpollChannel [WARNING] io.netty.channel.epoll.AbstractEpollStreamChannel [WARNING] io.netty.channel.epoll.Epoll [WARNING] io.netty.channel.epoll.EpollChannelConfig [WARNING] io.netty.channel.epoll.EpollChannelOption [WARNING] io.netty.channel.epoll.EpollDatagramChannel [WARNING] io.netty.channel.epoll.EpollDatagramChannelConfig [WARNING] io.netty.channel.epoll.EpollDomainSocketChannel [WARNING] io.netty.channel.epoll.EpollEventArray [WARNING] io.netty.channel.epoll.EpollEventLoop [WARNING] io.netty.channel.epoll.EpollEventLoopGroup [WARNING] io.netty.channel.epoll.EpollServerChannelConfig [WARNING] io.netty.channel.epoll.EpollServerSocketChannel [WARNING] io.netty.channel.epoll.EpollSocketChannel [WARNING] io.netty.channel.epoll.LinuxSocket [WARNING] io.netty.channel.epoll.Native [WARNING] io.netty.channel.epoll.NativeDatagramPacketArray [WARNING] io.netty.channel.epoll.NativeStaticallyReferencedJniMethods [WARNING] io.netty.channel.epoll.SegmentedDatagramPacket [WARNING] io.netty.channel.epoll.TcpMd5Util [WARNING] Found duplicate and different classes in [io.netty:netty-transport-classes-kqueue:4.1.92.Final, io.netty:netty-transport-native-kqueue:4.1.60.Final:jar:osx-x86_64]: [WARNING] io.netty.channel.kqueue.AbstractKQueueChannel [WARNING] io.netty.channel.kqueue.AbstractKQueueServerChannel [WARNING] io.netty.channel.kqueue.AbstractKQueueStreamChannel [WARNING] io.netty.channel.kqueue.BsdSocket [WARNING] io.netty.channel.kqueue.KQueue [WARNING] io.netty.channel.kqueue.KQueueChannelConfig [WARNING] io.netty.channel.kqueue.KQueueDatagramChannel [WARNING] io.netty.channel.kqueue.KQueueDatagramChannelConfig [WARNING] io.netty.channel.kqueue.KQueueDomainSocketChannel [WARNING] io.netty.channel.kqueue.KQueueDomainSocketChannelConfig [WARNING] io.netty.channel.kqueue.KQueueEventLoop [WARNING] io.netty.channel.kqueue.KQueueEventLoopGroup [WARNING] io.netty.channel.kqueue.KQueueServerChannelConfig [WARNING] io.netty.channel.kqueue.KQueueServerSocketChannel [WARNING] io.netty.channel.kqueue.KQueueServerSocketChannelConfig [WARNING] io.netty.channel.kqueue.KQueueSocketChannel [WARNING] io.netty.channel.kqueue.KQueueSocketChannelConfig [WARNING] io.netty.channel.kqueue.KQueueStaticallyReferencedJniMethods [WARNING] io.netty.channel.kqueue.Native [WARNING] io.netty.channel.kqueue.NativeLongArray ```
This is cause inside `org.seleniumhq.selenium:selenium-java` itself. Hopefully they will fix it themself.
org.apache.commons.logging ``` [WARNING] Found duplicate and different classes in [commons-logging:commons-logging:1.0.4, org.slf4j:jcl-over-slf4j:1.7.30]: [WARNING] org.apache.commons.logging.Log [WARNING] org.apache.commons.logging.LogConfigurationException [WARNING] org.apache.commons.logging.LogFactory [WARNING] org.apache.commons.logging.impl.NoOpLog [WARNING] org.apache.commons.logging.impl.SimpleLog ```
This is caused by a missmatch between sub-dependencies of the dependencies `io.github.bonigarcia:webdrivermanager` and `org.apache.xmlgraphics:fop`. If someone wants to verify this for themselves, they can use `mvn dependency:tree`.

But as stated, Jetty throws many classpath warning for the fop package. Further investigations shows that there might be a conflict inside the fop package (the apache fop all in one packge) itself. The warnings disappear if only the fop-core instead of the whole fop package is used. PlantUML also seems to work fine only with the fop-core package.

At the time of this analysis/tests fop 2.8, Jetty 11.0.15 and PlantUML 1.2023.8 were up to date.

Also note: All dependencies from the fop package are also included inside the fop-core package. As long as the fop package does not provided special implementations switching to the fop-core package shouldn't make any difference.