Multiple versions of logback in my classpath

Wessel, Keith kwessel at illinois.edu
Wed Aug 17 12:10:39 EDT 2016


Scott,

Multiple copies; it's the jetty log that refers to it as multiple versions even though they're both 1.1.3.

I was a bit surprised, too, that the IDP wouldn't start when I removed logback-classic from the war.

I get the following in jetty.log when I remove the one from $IDP_HOME/webapp/lib and rebuild the war:

11:02:28.201 - WARN [org.eclipse.jetty.deploy.DeploymentManager:506] - Unable to reach node goal: started
java.lang.LinkageError: loader constraint violation: when resolving method "org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()Lorg/slf4j/ILoggerFactory;" the class loader (instance of org/eclipse/jetty/webapp/WebAppClassLoader) of the current class, org/slf4j/LoggerFactory, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:335) ~[slf4j-api-1.7.12.jar:1.7.12]
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:283) ~[slf4j-api-1.7.12.jar:1.7.12]
	at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155) ~[jcl-over-slf4j-1.7.12.jar:1.7.12]
	at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132) ~[jcl-over-slf4j-1.7.12.jar:1.7.12]
	at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:273) ~[jcl-over-slf4j-1.7.12.jar:1.7.12]
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:304) ~[na:na]
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) ~[na:na]
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:835) ~[jetty-server-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:534) ~[jetty-servlet-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:808) ~[jetty-server-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:346) ~[jetty-servlet-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1379) ~[jetty-webapp-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1341) ~[jetty-webapp-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:772) ~[jetty-server-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:263) ~[jetty-servlet-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:517) ~[jetty-webapp-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:41) ~[jetty-deploy-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:188) ~[jetty-deploy-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:499) [jetty-deploy-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:147) [jetty-deploy-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180) [jetty-deploy-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:458) [jetty-deploy-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64) [jetty-deploy-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:610) [jetty-util-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:529) [jetty-util-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.util.Scanner.scan(Scanner.java:392) [jetty-util-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:313) [jetty-util-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:150) [jetty-deploy-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:561) [jetty-deploy-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:236) [jetty-deploy-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132) [jetty-util-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.server.Server.start(Server.java:405) [jetty-server-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114) [jetty-util-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61) [jetty-server-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.server.Server.doStart(Server.java:372) [jetty-server-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [jetty-util-9.3.7.v20160115.jar:9.3.7.v20160115]
	at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1510) [jetty-xml-9.3.7.v20160115.jar:9.3.7.v20160115]
	at java.security.AccessController.doPrivileged(Native Method) [na:1.8.0_74]
	at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1435) [jetty-xml-9.3.7.v20160115.jar:9.3.7.v20160115]

I also have duplicate copies of logback-core and slf4j-api in the war and the Jetty lib dir. If I remove logback-core from the war, not surprisingly, same results. If I remove slf4j from the IDP war, I get no errors/warnings in the jetty.og, but the IDP still fails to start.

I'm starting to think it's not worth the time/research to get rid of this little error in the Jetty start-up from the duplicate copies.

Keith

-----Original Message-----
From: users [mailto:users-bounces at shibboleth.net] On Behalf Of Cantor, Scott
Sent: Wednesday, August 17, 2016 10:54 AM
To: Shib Users <users at shibboleth.net>
Subject: Re: Multiple versions of logback in my classpath

On 8/17/16 11:45 AM, Wessel, Keith wrote:
> 
> When Jetty starts up, it complains to the log file that I have multiple
> versions of logback. I do, but I can't figure out how not to. There's a
> logback-classic-1.1.3.jar in $jetty_base/lib/logging and another compiled
> into the IDP war file.

Multiple versions or multiple copies? I don't think you can avoid
multiple copies unless you just don't use logback with Jetty. I suppose
you could remove it from the IdP.

> And if I remove the one from the IDP war, the IDP fails to start.

That seems surprising, but it might have something to do with how slf4j
auto-identifies the logging back-end to use. That's all pretty arcane to
me, but it might not cross class loader boundaries.

Probably there are tricks you can use to do all that differently with
system properties or something like that, I've never looked into it. It
would be more of an slf4j thing probably.

-- Scott
-- 
To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net


More information about the users mailing list