logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Sicker <boa...@gmail.com>
Subject Re: Overlapping Classes
Date Sat, 08 Feb 2014 02:25:35 GMT
Using an OSGi framework would help. It has separate class loaders for each bundle you install.
Check out Apache Felix or Eclipse Equinox or some other implementation.

Matt Sicker

> On Feb 7, 2014, at 16:35, Chris Veal <cmveal@gmail.com> wrote:
> 
> I'm using the maven shade plugin with apache-log4j-extras-1.2.17
> and log4j-1.2.17. That plugin takes the project artifacts and all its
> dependencies and puts them in a single jar. During compilation, the plugin
> states:
> 
> [WARNING] apache-log4j-extras-1.2.17.jar, log4j-1.2.17.jar define 126
> overlappping classes:
> [WARNING]   - org.apache.log4j.xml.DOMConfigurator$2
> [WARNING]   - org.apache.log4j.xml.DOMConfigurator$5
> [WARNING]   - org.apache.log4j.NDC$DiagnosticContext
> [WARNING]   - org.apache.log4j.spi.AppenderAttachable
> [WARNING]   - org.apache.log4j.spi.ErrorHandler
> [WARNING]   - org.apache.log4j.spi.RootCategory
> [WARNING]   - org.apache.log4j.pattern.PatternConverter
> [WARNING]   - org.apache.log4j.TTCCLayout
> [WARNING]   - org.apache.log4j.RollingCalendar
> [WARNING]   - org.apache.log4j.spi.Configurator
> [WARNING]   - 116 more...
> [WARNING] maven-shade-plugin has detected that some .class files
> [WARNING] are present in two or more JARs. When this happens, only
> [WARNING] one single version of the class is copied in the uberjar.
> [WARNING] Usually this is not harmful and you can skeep these
> [WARNING] warnings, otherwise try to manually exclude artifacts
> [WARNING] based on mvn dependency:tree -Ddetail=true and the above
> [WARNING] output
> [WARNING] See http://docs.codehaus.org/display/MAVENUSER/Shade+Plugin
> 
> If I exclude apache-log4j-extras-1.2.17, then my code complains about not
> having the updated RollingAppender.
> 
> If I exclude log4j-1.2.17, then my code complains that it can't find
> RendererMap.
> 
> Any ideas on how to get this code to work properly with the overlapping
> classes?
> 
> Thanks,
> 
> Chris

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message