From dev-return-86167-apmail-geronimo-dev-archive=geronimo.apache.org@geronimo.apache.org Fri Oct 08 16:16:23 2010 Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 13603 invoked from network); 8 Oct 2010 16:16:22 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Oct 2010 16:16:22 -0000 Received: (qmail 40138 invoked by uid 500); 8 Oct 2010 16:16:22 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 40094 invoked by uid 500); 8 Oct 2010 16:16:22 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 40087 invoked by uid 99); 8 Oct 2010 16:16:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Oct 2010 16:16:22 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of c1vamsi1c@gmail.com designates 209.85.213.182 as permitted sender) Received: from [209.85.213.182] (HELO mail-yx0-f182.google.com) (209.85.213.182) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Oct 2010 16:16:14 +0000 Received: by yxe42 with SMTP id 42so39083yxe.13 for ; Fri, 08 Oct 2010 09:15:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=2XnHpS3+kFQrjNrRUZW0vUVnWaViZyN39lNTlh2t3C8=; b=vVPKTS1CAc6iIZ8Ob/HyKU2gvxwv0LEGflp778fv1l4UiMW7SH1QkfeE+ygnWBY49P soE6NgsdJUYw94cz2XHet+Z9KUbiO0Wm39Ljs5KsLGBCzlnDsoNR+z74VyA9/bCwj/43 27xmuL7Ptu78GxNnfI4RR3us/1YPsstrhD9/w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=dgwlvTh/tVG3b3wE0bjywiCUOn2WpLVg0BLdoRKrzcT+y7q2jt12BIKqzkzUmOoYYT wBaP6NqdDiz786kf0Uj3kEWsd+Hq+BMYGHPmMA+NOaWRfF+Bo9jX2uiklfqCS1/we3ih bJON3SwfRPTKyxwGu54BhD0KdMsl2effuee0Q= MIME-Version: 1.0 Received: by 10.100.47.9 with SMTP id u9mr731331anu.18.1286554553408; Fri, 08 Oct 2010 09:15:53 -0700 (PDT) Received: by 10.100.227.3 with HTTP; Fri, 8 Oct 2010 09:15:53 -0700 (PDT) Date: Fri, 8 Oct 2010 21:45:53 +0530 Message-ID: Subject: Is there an OSGI Framework Bundle API for accessing nested archive content? From: Vamsavardhana Reddy To: Geronimo Dev Content-Type: multipart/alternative; boundary=0016e64097c623db5604921d5397 X-Virus-Checked: Checked by ClamAV on apache.org --0016e64097c623db5604921d5397 Content-Type: text/plain; charset=ISO-8859-1 The ValidatorFactoryGBean uses Bundle.getEntry() to get to META-INF/validation.xml and WEB-INF/validation.xml files in EJB and Web archives. This works fine for standalone modules. When the JAR or WAR is packaged in an EAR file, Bundle.getEntry(".war/WEB-INF/validation.xml") gets me to the file as WAR file is exploded and repackaged in the EAR whereas Bundle.getEntry(".jar/META-INF/validation.xml") does not work since the EJB jar is stored as is in the EAR. One option I can think of is to get the EJB jar entry, store it to a temporary file, open it with Jar APIs to get to "META-INF/validation.xml". myapp.ear my-ejb.jar (EJB jar is stored as is) +--META-INF +-- validation.xml +--my-web.war (WAR file is exploded, so WEB-INF is a directory in the repackaged EAR) +--WEB-INF +-- validation.xml Is there any Bundle API that will allow to access the content in the nested archives? Or any other way to get to the file of interest without creating temporary files? -- Vamsi --0016e64097c623db5604921d5397 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable The ValidatorFactoryGBean uses Bundle.getEntry() to get to META-INF/validat= ion.xml and WEB-INF/validation.xml files in EJB and Web archives.=A0 This w= orks fine for standalone modules.=A0 When the JAR or WAR is packaged in an = EAR file, Bundle.getEntry("<war-modulename>.war/WEB-INF/validati= on.xml") gets me to the file as WAR file is exploded and repackaged in= the EAR whereas Bundle.getEntry("<ejb-modulename>.jar/META-INF/= validation.xml") does not work since the EJB jar is stored as is in th= e EAR.=A0 One option I can think of is to get the EJB jar entry, store it t= o a temporary file, open it with Jar APIs to get to "META-INF/validati= on.xml".

myapp.ear=A0my-ejb.jar (EJB jar is stored as is)
=A0=A0 +--META-INF
= =A0=A0=A0=A0=A0=A0 +-- validation.xml
=A0+--my-web.war (WAR file is expl= oded, so WEB-INF is a directory in the repackaged EAR)
=A0=A0=A0=A0 +--W= EB-INF
=A0=A0=A0=A0=A0=A0=A0=A0 +-- validation.xml

=A0Is there any Bundle API that will allow to access the content= in the nested archives? Or any other way to get to the file of interest wi= thout creating temporary files?

--
Vamsi
--0016e64097c623db5604921d5397--