Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 57496 invoked from network); 16 Dec 2008 15:43:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Dec 2008 15:43:11 -0000 Received: (qmail 47108 invoked by uid 500); 16 Dec 2008 15:43:14 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 46992 invoked by uid 500); 16 Dec 2008 15:43:14 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 46983 invoked by uid 99); 16 Dec 2008 15:43:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Dec 2008 07:43:13 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Dec 2008 15:42:52 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LCc47-0003eI-Gj for axis-user@ws.apache.org; Tue, 16 Dec 2008 07:42:31 -0800 Message-ID: <21035519.post@talk.nabble.com> Date: Tue, 16 Dec 2008 07:42:31 -0800 (PST) From: Seem To: axis-user@ws.apache.org Subject: Re: get Resource inside .aar? In-Reply-To: <4946F70C.705@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: simzim@gmx.de References: <21019445.post@talk.nabble.com> <4946F70C.705@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Thanks to everybody, especially to Deepal for your unlimited patience. Finally everything is working fine, with all different possibilies ;-)! I had some problems with Eclipse, Classpath and invoking everything at the service_startup with the ServiceLifeCycle technique... I didn't see the wood for the trees. Deepal Jayasinghe-2 wrote: > > Seem wrote: >> Hi, >> >> I still have problems to access a file inside an .aar. I tried to extend >> the >> simple "quickstart" example from the axis2 repository, but I won't get >> > Try this > > MessageContext.getCurrentMessageContext().getAxisService().getClassLoader().getResourceAsSteam(); > > Thank you! > Deepal >> access?!?!?! >> >> The .aar folder structure is >> META-INF/ >> samples/... >> res/stock.txt >> >> >> here is my code: >> >> ######################################### >> package samples.quickstart.service.pojo; >> >> import java.io.BufferedReader; >> import java.io.IOException; >> import java.io.InputStream; >> import java.io.InputStreamReader; >> import java.util.HashMap; >> >> >> public class StockQuoteService >> { >> private HashMap map = new HashMap(); >> >> public double getPrice(String symbol) { >> StockQuoteService i = new StockQuoteService(); >> InputStream a = >> i.getClass().getClassLoader().getResourceAsStream("res/stock.txt"); >> >> // Thread thread = Thread.currentThread(); >> // ClassLoader loader = thread.getContextClassLoader(); >> // thread.setContextClassLoader(i.getClass().getClassLoader()); >> // InputStream a = >> Thread.currentThread().getContextClassLoader().getResourceAsStream("res/stock.txt"); >> >> >> return Double.valueOf(i.convertStreamToString(a)).doubleValue(); >> } >> >> private String convertStreamToString(InputStream a) >> { >> BufferedReader reader = new BufferedReader(new InputStreamReader(a)); >> .....} >> >> } >> ######################################### >> > > > -- > Thank you! > > > http://blogs.deepal.org > > > -- View this message in context: http://www.nabble.com/get-Resource-inside-.aar--tp21019445p21035519.html Sent from the Axis - User mailing list archive at Nabble.com.