ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Larry Meadors <larry.mead...@gmail.com>
Subject Re: the systems cannot load the resource files
Date Tue, 27 Sep 2005 14:05:07 GMT
This line is wrong:

Resources.getResourceAsReader("../../resources/daoConfig.xml");

Resources are absolute names based on the classpath. So, if you put
your daoConfig.xml file in a resources package, you would use this
instead:

Resources.getResourceAsReader("/resources/daoConfig.xml");

Larry


On 9/27/05, Carlos de la Flor Egiluz <c.delaflor@gmail.com> wrote:
>
>
> Hello i am new using ibatis.
> I am working, making, one j2ee applicaction.
> the packeages are:
> com.domain.resources
> com.domain.ibatis.sqlmapdao
>
> in the sqlmapdao package i have one class, DaoConfig.java with this.
>
> public static DaoManager getDaoManager(){
> DaoManager daoManager=null;
> try{
> Reader reader =
> Resources.getResourceAsReader("../../resources/daoConfig.xml");
> daoManager = DaoManagerBuilder.buildDaoManager (reader);
> }
> ....
>
> in the resources package i have:
> the xqlmapconfig, iwth the configuration to the db and with the includes for
> the sql xml files.
>
> i cannot deploy my application into one was server.
> the server log says me the the resource file has been begin with one /
>
> how must i to load the resource files?
> this is correct?
> Reader reader =
> Resources.getResourceAsReader("../../resources/daoConfig.xml");
>
> my application goes into one ear file for deploy into other platform, i dont
> know the absolute path to the conf files, resource files.
> and the properties files go into the ear. afte the deploy i cannot change.
>
> how can i solve this problem?
> thanks
>

Mime
View raw message