Ticket #63 (reopened enhancement)

Opened 5 years ago

Last modified 4 years ago

Improve logging when shared artifact version conflicts occur

Reported by: karel Owned by: bruno
Priority: minor Milestone: 0.5
Component: core/kauri-runtime Version: trunk
Keywords: logging sharing shareable classloader Cc:

Description

In case of version conflicts in shareable artifact versions, the error logging is not helpful: it does not show which versions cause the conflict (even after enabling classloader logging as instructed)

First run (without classloader logging)

Note: it is recommended to specify a log configuration. Will print error logs to the console.
[main] INFO org.kauriproject.runtime.info - Starting the Kauri Runtime.
[main] INFO org.kauriproject.runtime.info - Using local Maven repository at /home/karel/.m2/repository
[main] INFO org.kauriproject.runtime.info - Reading module configurations of 5 modules.
org.kauriproject.runtime.KauriRTException: The artifact kauri:repo:org.kauriproject:kauri-routing-api is required for sharing by one or more modules but other modules use a different version of this artifact with allowed or prohibited sharing. Enable classloading logging to see details.

at org.kauriproject.runtime.ClassLoaderConfigurer?.handleArtifact(ClassLoaderConfigurer?.java:102)
at org.kauriproject.runtime.ClassLoaderConfigurer?.handleArtifacts(ClassLoaderConfigurer?.java:68)
at org.kauriproject.runtime.ClassLoaderConfigurer?.configure(ClassLoaderConfigurer?.java:61)
at org.kauriproject.runtime.ClassLoaderConfigurer?.configureClassPaths(ClassLoaderConfigurer?.java:51)
at org.kauriproject.runtime.KauriRuntime?.start(KauriRuntime?.java:110)
at org.kauriproject.runtime.cli.KauriRuntimeCli?.run(KauriRuntimeCli?.java:240)
at org.kauriproject.runtime.cli.KauriRuntimeCli?.main(KauriRuntimeCli?.java:57)

Startup failed. Will try to shutdown and exit.
[main] INFO org.kauriproject.runtime.info - Shutting down the modules.

Second run: (with -z for classloader logging)

Note: it is recommended to specify a log configuration. Will print error logs to the console.
[main] INFO org.kauriproject.runtime.info - Starting the Kauri Runtime.
[main] INFO org.kauriproject.runtime.info - Using local Maven repository at /home/karel/.m2/repository
[main] INFO org.kauriproject.runtime.info - Reading module configurations of 5 modules.
[main] INFO org.kauriproject.runtime.classloading-info - Shareable artifact kauri:repo:org.kauriproject:kauri-template is only used by one module, so won't add it to the common classloader.
[main] INFO org.kauriproject.runtime.classloading-info - Shareable artifact kauri:repo:org.codehaus.groovy-contrib:groovy-restlet is only used by one module, so won't add it to the common classloader.
[main] INFO org.kauriproject.runtime.classloading-info - Shareable artifact kauri:repo:commons-cli:commons-cli is only used by one module, so won't add it to the common classloader.
[main] INFO org.kauriproject.runtime.classloading-info - Multiple versions in use of shareable artifact kauri:repo:org.kauriproject:kauri-runtime-rapi, hence not adding it to the common classloader.
[main] INFO org.kauriproject.runtime.classloading-info - Shareable artifact kauri:repo:javax.xml.stream:stax-api is only used by one module, so won't add it to the common classloader.
[main] INFO org.kauriproject.runtime.classloading-info - Shareable artifact kauri:repo:org.mortbay.jetty:servlet-api-2.5 is only used by one module, so won't add it to the common classloader.
org.kauriproject.runtime.KauriRTException: The artifact kauri:repo:org.kauriproject:kauri-routing-api is required for sharing by one or more modules but other modules use a different version of this artifact with allowed or prohibited sharing. Enable classloading logging to see details.

at org.kauriproject.runtime.ClassLoaderConfigurer?.handleArtifact(ClassLoaderConfigurer?.java:102)
at org.kauriproject.runtime.ClassLoaderConfigurer?.handleArtifacts(ClassLoaderConfigurer?.java:68)
at org.kauriproject.runtime.ClassLoaderConfigurer?.configure(ClassLoaderConfigurer?.java:61)
at org.kauriproject.runtime.ClassLoaderConfigurer?.configureClassPaths(ClassLoaderConfigurer?.java:51)
at org.kauriproject.runtime.KauriRuntime?.start(KauriRuntime?.java:110)
at org.kauriproject.runtime.cli.KauriRuntimeCli?.run(KauriRuntimeCli?.java:240)
at org.kauriproject.runtime.cli.KauriRuntimeCli?.main(KauriRuntimeCli?.java:57)

Startup failed. Will try to shutdown and exit.
[main] INFO org.kauriproject.runtime.info - Shutting down the modules.

The problem may be with the logging configuration because there already is code to list the artifacts that cause the problem:

classLoadingLog.error("Multiple modules use different versions of the share-required artifact " + holder);
for (ArtifactUser? user : holder.required) {

classLoadingLog.error(" version " + user.version + " by " + user.module.getId());

}

Change History

comment:1 Changed 4 years ago by mpo

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from 0.3 to 0.5

beyond scope of 0.4

comment:2 Changed 4 years ago by mpo

  • Status changed from closed to reopened
  • Resolution fixed deleted

obviously I've closed this unwillingly while doing some 0.4 bugtriage, sorry

Note: See TracTickets for help on using tickets.