Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 30268 invoked from network); 28 Jan 2010 19:51:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Jan 2010 19:51:56 -0000 Received: (qmail 80208 invoked by uid 500); 28 Jan 2010 19:51:55 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 80109 invoked by uid 500); 28 Jan 2010 19:51:55 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 80099 invoked by uid 99); 28 Jan 2010 19:51:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jan 2010 19:51:55 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rahul.akolkar@gmail.com designates 209.85.221.177 as permitted sender) Received: from [209.85.221.177] (HELO mail-qy0-f177.google.com) (209.85.221.177) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jan 2010 19:51:47 +0000 Received: by qyk7 with SMTP id 7so291304qyk.10 for ; Thu, 28 Jan 2010 11:51:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=2Ws4Q/ZRPrqLo6W5Um/thkcr9nFXmHB1Vb1gWzKWCxI=; b=rAoUkxD/jOAw95bQzdOCR6ya/I8dAUElEE3oDL0sznChjDhXjEJ8O0IU19G89j2mDp 8DbX52cS2RUzH5OioE3Bs09SS4TvlMohDPtFSlB8Gybdt0sUEvF/rzuyrQ+nlP1LW9nK 5q/7qdQLD2EnnDXu5fj4z1Fyc6C2cxIhONEJ8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=A916XXhEpB7uHKau9HsPSdpNuW+yPP2S5Mub4EQNf5YD+GEiIbPu6Mv8Y8AtFsC8+T ovM6enNEcWvLT4FCpbvPbXaANPUt3oMe2nf8cwJ1xqfUemYCzzSbCbMqFrvuvpuYGIPf 48r6GyAKFbzCQWjTOEckGzZLY2jq/oTJy/Xw8= MIME-Version: 1.0 Received: by 10.224.66.163 with SMTP id n35mr886614qai.30.1264708286407; Thu, 28 Jan 2010 11:51:26 -0800 (PST) In-Reply-To: <4917B331-FE38-46D1-800C-F06B8C98336D@openmethods.com> References: <4B61B65D.8030004@googlemail.com> <4917B331-FE38-46D1-800C-F06B8C98336D@openmethods.com> Date: Thu, 28 Jan 2010 14:51:26 -0500 Message-ID: Subject: Re: [SCXML] Modifying classloader for SCXML digester? From: Rahul Akolkar To: Commons Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Jan 28, 2010 at 1:16 PM, Bill Herring wr= ote: > I'm developing an Eclipse plugin application and have Commons SCXML and > Digester in a plugin/bundle separate from my main project bundle. =A0The > problem with this is that if I'm submitting a list of custom actions to > SCXMLParser.parse() the classloader that digester is using can't find the > custom action classes and throws an exception. =A0The offending line is i= n > digester.ObjectCreateRule.begin(): > > =A0 =A0 Class clazz =3D digester.getClassLoader().loadClass(realClassN= ame); > > The docs for getClassLoader() indicate that I can use setClassLoader() to > use another class loader, which might solve my problem. =A0However, I can= 't > find a simple way to invoke that function before SCXMLParser.parse() > generates the error. =A0I can use SCXMLParser.getInstance() to get a dige= ster > instance, and then I can call setClassLoader() and then invoke parse() on > the digester directly. Doing that, I have to set up the digester rules > manually before parsing, which appears doable but non-trivial... > Thats one way, if you choose that as a reminder there is a post digester parsing step that needs to be invoked in such scenarios (as mentioned in the Javadoc). > Is there a simpler way to coax the digester used in SCXMLParser.parse() t= o > employ a different class loader? > Indirectly, by resolving this at the framework (OSGi) level. This is a classic example from a set of valid scenarios that are faced when using bundles that expect to see both application / client code as well as their own code (obviously). For such scenarios, its usually possible to use the Eclipse buddy class loading mechanisms. Look up the Eclipse-BuddyPolicy and Eclipse-RegisterBuddy manifest entries to see if that works for you. -Rahul > =A0Thanks, > Bill > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org