Return-Path: Delivered-To: apmail-maven-dev-archive@www.apache.org Received: (qmail 46054 invoked from network); 2 Oct 2006 19:23:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Oct 2006 19:23:29 -0000 Received: (qmail 87714 invoked by uid 500); 2 Oct 2006 19:23:27 -0000 Delivered-To: apmail-maven-dev-archive@maven.apache.org Received: (qmail 87650 invoked by uid 500); 2 Oct 2006 19:23:27 -0000 Mailing-List: contact dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Developers List" Reply-To: "Maven Developers List" Delivered-To: mailing list dev@maven.apache.org Received: (qmail 87639 invoked by uid 99); 2 Oct 2006 19:23:26 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (140.211.166.84) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Oct 2006 12:23:26 -0700 Authentication-Results: idunn.apache.osuosl.org header.from=stephane.nicoll@gmail.com; domainkeys=good X-ASF-Spam-Status: No, hits=0.5 required=5.0 tests=DNS_FROM_RFC_ABUSE DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 Received: from [64.233.182.188] ([64.233.182.188:40986] helo=nf-out-0910.google.com) by idunn.apache.osuosl.org (ecelerity 2.1.1.8 r(12930)) with ESMTP id A4/F5-24395-D2761254 for ; Mon, 02 Oct 2006 12:23:26 -0700 Received: by nf-out-0910.google.com with SMTP id l23so1659471nfc for ; Mon, 02 Oct 2006 12:23:22 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=plnLeifEpJ5z85mTpA57K5oDguYKeozTwllrN+vZ9TM9woRKGh85zkhAbvjIxWC3qE7U/KcSK3BB4TDFwDjWZ45QVtt4iEkMzWsGsuYgezrNrJYGqEhopO1Ho6/Bm3RaCz39hn01zFwxSf/Cf7iuLb8Ptma4f1poi4sIp4rBvUE= Received: by 10.78.182.20 with SMTP id e20mr3736054huf; Mon, 02 Oct 2006 12:23:22 -0700 (PDT) Received: by 10.78.178.16 with HTTP; Mon, 2 Oct 2006 12:23:21 -0700 (PDT) Message-ID: <541f12ca0610021223p7e928841u4cc7d4917fb439b2@mail.gmail.com> Date: Mon, 2 Oct 2006 21:23:21 +0200 From: "Stephane Nicoll" To: "Maven Developers List" Subject: Re: MNG-2571 - weird exception using the embedder In-Reply-To: <4520FEE5.8090305@apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <541f12ca0610010204y17b91136x50d52beba9433955@mail.gmail.com> <541f12ca0610011210y7a967418x82e015ca87247bdc@mail.gmail.com> <541f12ca0610011214q1e3e97aatd6e9792a8d9807db@mail.gmail.com> <4520FEE5.8090305@apache.org> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Kenney and all, On 10/2/06, Kenney Westerhof wrote: > Hi, Stephane, > > I'm trying to reproduce this but I'm having trouble. First, the > dependency on maven-plugin-testing-harness is missing. Secondly, > even though the localRepoDir is correct, the ejb-sample-one and -two > can't be found. Wouh, I rever the maven-* dependency from 2.0.4 to 2.0.1 and it worked. So either we introduced a regression in 2.0.1+ or I am missing a mandatory dependency. The SVN head of the ear plugin now builds successfully, commenting out the testProject02 method allows to reproduce the classloader issue. Thanks, St=E9phane > > Anyway, the problem is with the setClassLoader(). That one already contai= ns > the EjbModule (and EarMojo) classes since they're in src/main/java. So th= ey're also available > to plexus. > > The embedder tries to configure another EarMojo in a new plugin classload= er, and > instantiates the EjbModule from the embedder classloader, not from the pl= ugin classloader. > That's because the plugin classloader delegates to the parent (the embedd= er classloader), > and finds an instance of the field class there. > > Solution: use an isolated classloader where the mojo code itself is NOT p= art of the embedder. > For instance, by using the maven-it-plugin, (or maven-invoker?) or by con= structing a new classloader with the > embedder archive and it's dependencies manually. > > -- Kenney > > Stephane Nicoll wrote: > > On 10/1/06, Stephane Nicoll wrote: > >> On 10/1/06, David Jencks wrote: > >> > > >> > > >> > The classes are in different classloaders. Hopefully the > >> > classloaders' toString() will give you enough info about which ones > >> > they are if you add that to the debugging. > >> > >> You're right. The interface and the actual implementation are in > >> different classloaders. > > > > More specifically: > > > > Classloader... > > Current thread > > classloader[org.codehaus.classworlds.RealmClassLoader@b60b93] > > type.getComponentType classloader[sun.misc.Launcher$AppClassLoader@e80a= 59] > > values(0). classloader[org.codehaus.classworlds.RealmClassLoader@5e13ad= ] > > The component Type is[ interface org.apache.maven.plugin.ear.EarModule] > > The values elements are the following > > Object class[org.apache.maven.plugin.ear.EjbModule] - is NOT > > assignable to[interface org.apache.maven.plugin.ear.EarModule] !!! > > > > s/ > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org > > For additional commands, e-mail: dev-help@maven.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org > For additional commands, e-mail: dev-help@maven.apache.org > > --=20 Un chewing-gum? Non merci, jamais pour parler. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org For additional commands, e-mail: dev-help@maven.apache.org