Return-Path: X-Original-To: apmail-tomcat-dev-archive@www.apache.org Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D15A410833 for ; Mon, 20 Jan 2014 17:32:42 +0000 (UTC) Received: (qmail 67891 invoked by uid 500); 20 Jan 2014 17:32:24 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 67798 invoked by uid 500); 20 Jan 2014 17:32:23 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 67663 invoked by uid 99); 20 Jan 2014 17:32:20 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Jan 2014 17:32:20 +0000 Date: Mon, 20 Jan 2014 17:32:20 +0000 (UTC) From: "Brendan Le Ny (JIRA)" To: dev@tomcat.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MTOMCAT-257) Classpathes separation between plugin and application is broken (can't use slf4j-jcl in app) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MTOMCAT-257?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D138= 76600#comment-13876600 ]=20 Brendan Le Ny commented on MTOMCAT-257: --------------------------------------- true doesn't s= olve the issue. It seems that the classpaths are not separated. I've created a project to show the whole issue. The problem appeared when i= added shiro as a dependency to my project. Shiro depends on slf4j-api. I a= lso use commons-codec 1.8. My project use log4j to log and slf4j-jcl to gat= her slf4j logs (so i will get Shiro's log). Log4j and slf4j-jcl are in scop= e runtime. Here is the whole thing: if I do a tomcat:run, the application breaks, because tomcat-plugin put= jcl-over-slf4j in classpath and slf4j initialization fail because you can'= t have both jcl-over-slf4j and slf4j-jcl in the same classpath. The applica= tion works when deployed in a tomcat, but it doesn't work in tomcat:run. Th= at's the exact problem Tony raised. If I add true in plugin config, it solve the issue because jcl-over-slf4j and slf4j-j= cl But ! it raise another issue: in my application, I use commons-codec 1.= 8 and when the time come when the class is loaded, I get a linkage error sa= ying that DigestUtils#sha1hex method doesn't exists. It exists in commons-c= odec 1.8 but not in commons-codec version declared in tomcat-plugin. So it = seems that even with useSeparateTomcatClassLoader=3Dtrue, the actual classp= ath of the application running in tomcat7:run is not the same that the one = given by mvn package, ie with the exact dependencies and exact version defi= ned in the project's pom. For now, the only workaround i've found is to leave useSeparateTomcatClassL= oader =3D false and add a maven profile to put slf4j-jcl in scope runtime, = I use the profile only when doing a tomcat7:run. I don't know if useSeparat= eTomcatClassLoader =3D true is buggy or what occurs actually but it's sure = that the application's classpath is not sane. > Classpathes separation between plugin and application is broken (can't us= e slf4j-jcl in app) > -------------------------------------------------------------------------= ------------------- > > Key: MTOMCAT-257 > URL: https://issues.apache.org/jira/browse/MTOMCAT-257 > Project: Apache Tomcat Maven Plugin > Issue Type: Bug > Components: tomcat7 > Affects Versions: 2.1 > Reporter: Brendan Le Ny > Assignee: Olivier Lamy (*$^=C2=A8%`=C2=A3) > Attachments: MTOMCAT-227-2.zip, MTOMCAT-227.tgz > > > I use in my war the slf4j-jcl, which is not compatible with the jcl-over-= slf4j used in the plugin dependencies. > I give you a little project that show the problem. -- This message was sent by Atlassian JIRA (v6.1.5#6160) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org