Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 95242 invoked from network); 29 Aug 2006 12:54:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 Aug 2006 12:54:03 -0000 Received: (qmail 70896 invoked by uid 500); 29 Aug 2006 12:54:01 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 70883 invoked by uid 500); 29 Aug 2006 12:54:01 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 70872 invoked by uid 99); 29 Aug 2006 12:54:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Aug 2006 05:54:01 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of larry.meadors@gmail.com designates 64.233.182.186 as permitted sender) Received: from [64.233.182.186] (HELO nf-out-0910.google.com) (64.233.182.186) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Aug 2006 05:54:00 -0700 Received: by nf-out-0910.google.com with SMTP id x30so167773nfb for ; Tue, 29 Aug 2006 05:53:39 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:sender:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=ecwWJHhSE1TDkHwOkhD661YJ1eNL6969pG7+E+kV2HiP8mgBkrrQnvrcfSjkvtBMVGn2ZY3iYR+PjKohYAIcOjTtXHgnwptrWmKGbdg4L6v/PA8pCDj0mllPcw8wZYOK1CZzJ901/3YO3Qg/Ql/1xAwi/1dxY/jz2bu34GLIuss= Received: by 10.48.242.19 with SMTP id p19mr1064629nfh; Tue, 29 Aug 2006 05:53:39 -0700 (PDT) Received: by 10.49.19.13 with HTTP; Tue, 29 Aug 2006 05:53:38 -0700 (PDT) Message-ID: Date: Tue, 29 Aug 2006 06:53:39 -0600 From: "Larry Meadors" Reply-To: lmeadors@apache.org Sender: larry.meadors@gmail.com To: user-java@ibatis.apache.org Subject: Re: Resource load problem In-Reply-To: <933f2a180608290409t2a9c546eo187c673537c97208@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <933f2a180608290409t2a9c546eo187c673537c97208@mail.gmail.com> X-Google-Sender-Auth: 27be6ded1e4d727e X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N If you use a filename, it is no longer considered a resource. You could use this, though: String smcPath = System.getProperty("jboss.server.home.dir") + "/conf/SqlMapConfig.xml"; Resources.getUrlAsReader("file://" + smcPath); Larry On 8/29/06, Javier Leyba wrote: > Hi > > I' ll use iBatis in my JBoss application and want to keep all > configuration files in my conf directory so I did: > > static { > try { > String resource = System.getProperty("jboss.server.home.dir") > + "/conf/SqlMapConfig.xml"; > Reader reader = Resources.getResourceAsReader(resource); > sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader); > } catch (Exception e) { > e.printStackTrace(); > throw new RuntimeException( > "Error initializing MyAppSqlConfig class. Cause: " + e); > } > > > But when I call the application I get the error message: > > 12:52:06,764 INFO [STDOUT] java.io.IOException: Could not find > resource /home/jcm/jboss-4.0.3SP1/server/javier01/conf/SqlMapConfig.xml > > but if open a telent console and do > > vi /home/jcm/jboss-4.0.3SP1/server/javier01/conf/SqlMapConfig.xml from > elsewhere I can open the file without problems. > > Any idea ? > > Thanks in advance > > J > > > -- > Javier Leyba > Barcelona - Spain > http://blog.leyba.com.ar >