You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by Edwin Castillo <ec...@gmail.com> on 2005/08/11 01:02:23 UTC

how do i assure that my dao.config file is being read?

Hi,

I have a windows form application that uses the DataMapper and the 
DataAccess assemblies. I realize the variable daoManager never takes a
value(is null) when the code: daoManager
= DaoManager.GetInstance("SqlMapDao") is executed, reason why the 
application crashes. I check mi config files in a browser and any syntax error 
was showed up. Furthermore, these are well placed. why it happens? how do i 
test that my dao.config file is being read? exists some windows form 
application example that works?. My dao.config file is:

<?xml version="1.0" encoding="utf-8"?>
<daoConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:noNamespaceSchemaLocation="DaoConfig.xsd">

<context name="SqlMapDao">
<properties resource="properties.config"/>

<database>
<provider name="sqlServer1.1"/>
<dataSource name="WMI" connectionString="Persist Security Info=False;User 
ID=${userid};Pwd=${password};Initial Catalog=${database};Data 
Source=${datasource};Packet Size=4096;Workstation ID=localhost"/>
</database>

<daoSessionHandler id="SqlMap">
<property name="resource" value="SqlMap.config"/>
</daoSessionHandler>

<daoFactory>
<dao interface ="ibatis4.Interfaces.IPerson, ibatis4"
implementation="ibatis4.Manejadores.MPerson, ibatis4"/>
</daoFactory>
</context>
</daoConfig>

any suggestion?

Thanks in advice...

Re: how do i assure that my dao.config file is being read?

Posted by Ron Grabowski <ro...@yahoo.com>.
Why did you send your question to so many addresses?

Have you tried specifing the path to the dao.config file you want to
use:

 string pathToDaoFile = GetPathToDaoFile();
 log.Debug("Preparing to configure DaoManager: [" + pathToDaoFile +
"]);
 DomDaoManagerBuilder builder = new DomDaoManagerBuilder(); 
 builder.Configure(GetPathToDaoFile());
 daoManager = DaoManager.GetInstance("SqlMapDao");

--- Edwin Castillo <ec...@gmail.com> wrote:

> Hi,
> 
> I have a windows form application that uses the DataMapper and the 
> DataAccess assemblies. I realize the variable daoManager never takes
> a
> value(is null) when the code: daoManager
> = DaoManager.GetInstance("SqlMapDao") is executed, reason why the 
> application crashes. I check mi config files in a browser and any
> syntax error 
> was showed up. Furthermore, these are well placed. why it happens?
> how do i 
> test that my dao.config file is being read? exists some windows form 
> application example that works?. My dao.config file is:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <daoConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xsi:noNamespaceSchemaLocation="DaoConfig.xsd">
> 
> <context name="SqlMapDao">
> <properties resource="properties.config"/>
> 
> <database>
> <provider name="sqlServer1.1"/>
> <dataSource name="WMI" connectionString="Persist Security
> Info=False;User 
> ID=${userid};Pwd=${password};Initial Catalog=${database};Data 
> Source=${datasource};Packet Size=4096;Workstation ID=localhost"/>
> </database>
> 
> <daoSessionHandler id="SqlMap">
> <property name="resource" value="SqlMap.config"/>
> </daoSessionHandler>
> 
> <daoFactory>
> <dao interface ="ibatis4.Interfaces.IPerson, ibatis4"
> implementation="ibatis4.Manejadores.MPerson, ibatis4"/>
> </daoFactory>
> </context>
> </daoConfig>
> 
> any suggestion?
> 
> Thanks in advice...
>