Return-Path: X-Original-To: apmail-ant-dev-archive@www.apache.org Delivered-To: apmail-ant-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 DA10D11A9A for ; Sun, 11 May 2014 23:51:42 +0000 (UTC) Received: (qmail 99954 invoked by uid 500); 11 May 2014 23:51:42 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 99881 invoked by uid 500); 11 May 2014 23:51:42 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 99873 invoked by uid 99); 11 May 2014 23:51:42 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 May 2014 23:51:42 +0000 X-ASF-Spam-Status: No, hits=0.3 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of nicolas.lalevee@hibnet.org does not designate 216.86.168.183 as permitted sender) Received: from [216.86.168.183] (HELO mxout-08.mxes.net) (216.86.168.183) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 11 May 2014 23:51:37 +0000 Received: from [10.80.1.100] (unknown [86.68.205.116]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 3DC84509B6 for ; Sun, 11 May 2014 19:51:15 -0400 (EDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) Subject: Re: Classloading issue From: =?iso-8859-1?Q?Nicolas_Lalev=E9e?= In-Reply-To: Date: Mon, 12 May 2014 01:51:12 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <38A56A7D-B5EF-429F-961E-C134EC677ED9@hibnet.org> References: To: "Ant Developers List" X-Mailer: Apple Mail (2.1510) X-Virus-Checked: Checked by ClamAV on apache.org Le 12 mai 2014 =E0 01:34, Antoine Levy Lambert a =E9crit = : > Hello Nicolas, >=20 > I have tried your test case and it is failing as you except : >=20 > BUILD FAILED > /Users/antoine/dev/asf/ivyde-trunk/test/ssh-resolver/build.xml:27: = java.lang.NoClassDefFoundError: = com/jcraft/jsch/agentproxy/AgentProxyException > at = org.apache.ivy.plugins.repository.ssh.AbstractSshBasedRepository.getSessio= n(AbstractSshBasedRepository.java:108) > at = org.apache.ivy.plugins.repository.ssh.SshRepository.resolveResource(SshRep= ository.java:82) > at = org.apache.ivy.plugins.repository.ssh.SshResource.resolve(SshResource.java= :101) >=20 > The line 108 in AbstractSsshBasedRepository contains this : >=20 > return SshCache.getInstance().getSession(host, port, user, = userPassword, getKeyFile(), > getKeyFilePassword(), getPassFile(), isAllowedAgentUse()); >=20 > getSession is a method which calls attemptAgentUse. It is only called is attemptAgentUse is true. In our case it is false. > Does this explain why an attempt to load AgentProxyException happens = at that time ? I have plugged a debugger, and the class loading exception is raised on = the call of SshCache.getInstance(). As far as I can tell, it is the = class SshCache which fails to load, but I don't understand why. Nicolas >=20 > Regards, >=20 > Antoine >=20 > On May 11, 2014, at 5:41 PM, Nicolas Lalev=E9e = wrote: >=20 >> Hi, >>=20 >> I need some help to understand a bug around classloading (nothing = that particular to Ivy). >>=20 >> I was looking into IVY-1471 [1] and I don't understand why it is = failing that way. In the classpath there are both Ivy and Jsch, but not = the optional jar related to managing the ssh agent via jsch. And it is = failing because a class in that optional jar is not found. But I don't = understand why the classloader is looking for it in the first place. >>=20 >> The error is raised is AbstractSshBasedRepository, on the call of = SshCache.getInstance() [2]. But as far as I can tell, nothing in the = loading of the SshCache [3] class requires AgentProxyException. The = class is only needed by the function SshCache#attemptAgentUse() [4], = which will be called at runtime, if the end user actually want ssh agent = support, in which case it would naturally fail. But here it fails very = earlier. >>=20 >> I have made a test case you can test with its build.xml, no IvyDE = required there [5]. >>=20 >> Am I missing something ? Is there a special treatment for the loading = of Exception classes ? >>=20 >> Nicolas >>=20 >> [1] https://issues.apache.org/jira/browse/IVY-1471 >> [2] = https://fisheye6.atlassian.com/browse/ant/ivy/core/trunk/src/java/org/apac= he/ivy/plugins/repository/ssh/AbstractSshBasedRepository.java?hb=3Dtrue#to= 108 >> [3] = https://fisheye6.atlassian.com/browse/ant/ivy/core/trunk/src/java/org/apac= he/ivy/plugins/repository/ssh/SshCache.java?hb=3Dtrue >> [4] = https://fisheye6.atlassian.com/browse/ant/ivy/core/trunk/src/java/org/apac= he/ivy/plugins/repository/ssh/SshCache.java?hb=3Dtrue#to300 >> [5] = http://svn.apache.org/repos/asf/ant/ivy/ivyde/trunk/test/ssh-resolver/ >>=20 >>=20 >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org >> For additional commands, e-mail: dev-help@ant.apache.org >>=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org