You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Jane Phillips <ja...@yahoo.com> on 2007/05/11 14:52:51 UTC

unable to load dao.xml outside of .war

Hello,
   
  I am new to iBatis and need help on one,maybe simple to you, problem. I need to read dao.xml file from a config path which is out side of the .ear or .war package. I was required to put all those .xml files(dao.xml , sqlMap.xml and datasource.properties etc) under a arbitrary directory like C:\myConfig. I know it is working if I place all those .xml files under package root directory. But when I put them in c:\myConfig directory and set my environment CLASSPATH to C:\myConfig, it couldn't find the file!??
   
  I am using Resource.getResourceAsReader("dao.xml") to locate it. Can someone give me guidance on this? Thanks so much.
   
  Jane

       
---------------------------------
Building a website is a piece of cake. 
Yahoo! Small Business gives you all the tools to get online.

Re: unable to load dao.xml outside of .war

Posted by Jane Phillips <ja...@yahoo.com>.
Richard,
   
  You are right. We use Tomcat and I fixed it. Thank you so much.
   
  Jane
  
Richard Yee <ry...@cruzio.com> wrote:
  Jane,
What server are you using? Typically, servers ignore the environment 
classpath setting and set it explicitly in the server startup script. 
You might need to edit the server startup script.

-Richard


Jane Phillips wrote:
> Hello,
> 
> I am new to iBatis and need help on one,maybe simple to you, problem. 
> I need to read dao.xml file from a config path which is out side of 
> the .ear or .war package. I was required to put all those .xml 
> files(dao.xml , sqlMap.xml and datasource.properties etc) under a 
> arbitrary directory like C:\myConfig. I know it is working if I place 
> all those .xml files under package root directory. But when I put them 
> in c:\myConfig directory and set my environment CLASSPATH to 
> C:\myConfig, it couldn't find the file!??
> 
> I am using Resource.getResourceAsReader("dao.xml") to locate it. Can 
> someone give me guidance on this? Thanks so much.
> 
> Jane
>
> ------------------------------------------------------------------------
> Building a website is a piece of cake.
> Yahoo! Small Business gives you all the tools to get online. 
> 




       
---------------------------------
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 

Re: unable to load dao.xml outside of .war

Posted by Richard Yee <ry...@cruzio.com>.
Jane,
What server are you using? Typically, servers ignore the environment 
classpath setting  and set it explicitly in the server startup script. 
You might need to edit the server startup script.

-Richard


Jane Phillips wrote:
> Hello,
>  
> I am new to iBatis and need help on one,maybe simple to you, problem. 
> I need to read dao.xml file from a config path which is out side of 
> the .ear or .war package. I was required to put all those .xml 
> files(dao.xml , sqlMap.xml and datasource.properties etc) under a 
> arbitrary directory like C:\myConfig. I know it is working if I place 
> all those .xml files under package root directory. But when I put them 
> in c:\myConfig directory and set my environment CLASSPATH to 
> C:\myConfig, it couldn't find the file!??
>  
> I am using Resource.getResourceAsReader("dao.xml") to locate it. Can 
> someone give me guidance on this? Thanks so much.
>  
> Jane
>
> ------------------------------------------------------------------------
> Building a website is a piece of cake.
> Yahoo! Small Business gives you all the tools to get online. 
> <http://us.rd.yahoo.com/evt=48251/*http://smallbusiness.yahoo.com/webhosting/?p=PASSPORTPLUS> 



RE: unable to load dao.xml outside of .war

Posted by "Sheehan, Andrew" <An...@chasepaymentech.com>.
Have you tried using java.net.Url, or one of its subtypes, to locate it?

________________________________

From: Jane Phillips [mailto:jane22124@yahoo.com] 
Sent: Friday, May 11, 2007 8:53 AM
To: user-java@ibatis.apache.org
Subject: unable to load dao.xml outside of .war 


Hello,
 
I am new to iBatis and need help on one,maybe simple to you, problem. I
need to read dao.xml file from a config path which is out side of the
.ear or .war package. I was required to put all those .xml files(dao.xml
, sqlMap.xml and datasource.properties etc) under a arbitrary directory
like C:\myConfig. I know it is working if I place all those .xml files
under package root directory. But when I put them in c:\myConfig
directory and set my environment CLASSPATH to C:\myConfig, it couldn't
find the file!??
 
I am using Resource.getResourceAsReader("dao.xml") to locate it. Can
someone give me guidance on this? Thanks so much.
 
Jane

________________________________

Building a website is a piece of cake. 
Yahoo! Small Business gives you all the tools to get online.
<http://us.rd.yahoo.com/evt=48251/*http://smallbusiness.yahoo.com/webhos
ting/?p=PASSPORTPLUS> 

  
Learn more about Chase Paymentech Solutions,LLC payment processing services at www.chasepaymentech.com.
THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary and confidential information intended only for the use of the recipient(s) named above.  If you are not the intended recipient, you may not print, distribute, or copy this message or any attachments.  If you have received this communication in error, please notify the sender by return e-mail and delete this message and any attachments from your computer.