|
|
| BATIS (VS2008) looking on the wrong
place for SqlMap.config |

|
2008-04-20 08:48:24 |
After some development with Java and iBATIS, we started
using
iBATIS.NET. (for a college university project)
We are programming a webapplication. Structure is as
follows:
Kronos.Web, Kronos.Persistence, Kronos.Domain
and Kronos.Test, in one solution.
I started creating soms basic maps and the config files, but
now when
I try to run a TestMethod,
I get the following error (Mapper.Instance...)
Test method Kronos.Test.MedewerkerTestMap.MedewerkerList
threw
exception:
IBatisNet.Common.Exceptions.ConfigurationException: Unable
to load file via resource "SqlMap.config" as
resource. Cause : Could
not find file 'C:Program FilesMicrosoft Visual Studio
9.0Common7IDE
SqlMap.config'. ---> System.IO.FileNotFoundException:
Could not find
file 'C:Program FilesMicrosoft Visual Studio
9.0Common7IDE
SqlMap.config'.
I want the sqlmaps, configs and maps in one package.... not
in Program
Files/...
I am sure this is a small, stupid problem.... iBATIS for
Java worked
without a single problem....
I greatly appreciate any help
Pieter Baele
pieter.baele telenet.be
VIM has two modes. The one in which it beeps and the one in
which it
doesn't.
|
|
| Re: BATIS (VS2008) looking on the wrong
place for SqlMap.config |

|
2008-04-20 10:59:24 |
|
How do you used the sqlmap.config file ? You are giving the good path to the file.
-- Cheers, Gilles
|
| Re: BATIS (VS2008) looking on the wrong
place for SqlMap.config |

|
2008-04-20 11:22:32 |
How do you mean?
I placed the SqlMap.config (+ maps and provider.config) in
Kronos.Persistence (class library) and Kronos.Test for the
unit tests.
Then in the unit test: (MedewerkerMapTest.cs)
[TestMethod()]
public void getListOfMedewerkers()
{
IList medewerker =
Mapper.Instance().QueryForList("Medewerker.getAll"
, null);
....
}
I thought when you call the mapper instance, it looks for a
file
sqlmap.config in your solution / package.
But it doesn't...
Or do you have to do something like in Java (-iBATIS)? It's
not
mentioned in iBATIS in Action for iBATIS.NET....
String resource =
"persistence/sqlmaps/SqlMapConfig.xml";
Reader reader = Resources.getResourceAsReader(resource);
sqlMapClient =
SqlMapClientBuilder.buildSqlMapClient(reader);
Pieter Baele
pieter.baele telenet.be
"Before software should be reusable, it should be
usable."
– Ralph Johnson
On 20 Apr 2008, at 17:59, Gilles Bayon wrote:
> How do you used the sqlmap.config file ? You are giving
the good
> path to the file.
>
>
> --
> Cheers,
> Gilles
|
|
| Re: BATIS (VS2008) looking on the wrong
place for SqlMap.config |

|
2008-04-20 11:31:39 |
|
http://ibatis.apache.org/docs/dotnet/datamapper/ch04s04.html
-- Cheers, Gilles
|
| Re: BATIS (VS2008) looking on the wrong
place for SqlMap.config |

|
2008-04-20 11:39:24 |
Gilles,
Thx, I read the document, but a little too fast I suppose
Pieter Baele
pieter.baele telenet.be
"Software is a gas; it expands to fill its
container."
– Nathan Myhrvold
On 20 Apr 2008, at 18:31, Gilles Bayon wrote:
> http://ibatis.apache.org/docs/dotnet/datamapper/ch04
s04.html
>
>
>
> --
> Cheers,
> Gilles
|
|
| Re: BATIS (VS2008) looking on the wrong
place for SqlMap.config |

|
2008-04-20 12:13:06 |
OK, the program could finally find the sqlmap.config,
but now It searches for providers.config in Program
Files/blablabla/
It should just search al these config files in the project
directory
itself (solution) ! (?)
Maybe this is a VS2008 / dotNET 3.5 problem?
I feel really stupid because I don't understand this
weirdness.
Everything worked very well in java, why not in C#/ASP?
Test method Kronos.Test.MedewerkerTestMap.MedewerkerList
threw
exception:
IBatisNet.Common.Exceptions.ConfigurationException:
- The error occurred while loading Providers. --->
IBatisNet.Common.Exceptions.ConfigurationException: Unable
to load
file via resource "providers.config" as resource.
Cause : Could not
find file 'C:Program FilesMicrosoft Visual Studio
9.0Common7IDE
providers.config'. --->
System.IO.FileNotFoundException: Could not
find file 'C:Program FilesMicrosoft Visual Studio
9.0Common7IDE
providers.config'..
Pieter Baele
pieter.baele telenet.be
"Before software should be reusable, it should be
usable."
– Ralph Johnson
On 20 Apr 2008, at 18:31, Gilles Bayon wrote:
> http://ibatis.apache.org/docs/dotnet/datamapper/ch04
s04.html
>
>
>
> --
> Cheers,
> Gilles
|
|
| Re: BATIS (VS2008) looking on the wrong
place for SqlMap.config |

|
2008-04-20 13:55:32 |
|
If you read the doc it will be better http://ibatis.apache.org/docs/dotnet/datamapper/ch04s03.html#id398273
-- Cheers, Gilles
|
| Re: BATIS (VS2008) looking on the wrong
place for SqlMap.config |

|
2008-04-20 14:05:13 |
Hi Gilles,
I did, I put a few hours into iBATIS.NET to get it working
already...
The mysql provider is enabled. (5.2 edition of the website)
Do you have iBATIS working in the latest Visual Studio, or
do you use
2005?
Thank you for your time!
Greetings,
---------------------------
Pieter Baele
On 20 Apr 2008, at 20:55, Gilles Bayon wrote:
> If you read the doc it will be better
> http://ibatis.apache.org/docs/dotnet/datama
pper/ch04s03.html#id398273
>
> --
> Cheers,
> Gilles
|
|
| Re: BATIS (VS2008) looking on the wrong
place for SqlMap.config |

|
2008-04-20 18:59:37 |
You have to put your sqlmap.config in the web root
directory, or in
bin/debug in the test project.
Anyway, you can change the path of your sqlmap.config. See
section
4.4.1.2. of the datamapper manual.
Greetings and sorry for my poor english
2008/4/20 Pieter Baele <pieter.baele telenet.be>:
> Hi Gilles,
>
> I did, I put a few hours into iBATIS.NET to get it
working already...
> The mysql provider is enabled. (5.2 edition of the
website)
>
> Do you have iBATIS working in the latest Visual
Studio, or do you use 2005?
>
> Thank you for your time!
>
> Greetings,
> ---------------------------
> Pieter Baele
>
>
>
>
> On 20 Apr 2008, at 20:55, Gilles Bayon wrote:
>
> > If you read the doc it will be better
> > http://ibatis.apache.org/docs/dotnet/datama
pper/ch04s03.html#id398273
> >
> > --
> > Cheers,
> > Gilles
> >
>
>
|
|
| Re: iBATIS looking on the wrong place
for SqlMap.config SOLVED (for a part) |

|
2008-04-21 00:25:32 |
I placed the providers en sqlmap config in bin/debug, then
it worked.
It isn't that straight-forward.....
The only problem left now is that it doesn't find the newest
mysql.data library I added myself.
The bytefx provider is really too old .... 2004 (?!) Or is
it still a
better option for a mysql db?
I have not changed the publickeytoken, can this cause
problems? If so,
where do I find this token?
I tried adding the reference provided by the visual studio
integration
and also 'the hard way' by providing and
copying the library. None of the two works
Could not load file or assembly 'MySql.Data,
Version=2.0.50727,
Culture=neutral' or one of its dependencies.
[code]
<provider
name="MySql"
description="MySQL, MySQL provider
v2.0.50727"
enabled="true"
default="true"
assemblyName="MySql.Data, Version=2.0.50727,
Culture=neutral,
PublicKeyToken=c5687fc88969c44d"
connectionClass="MySql.Data.MySqlClient.MySqlConnection
"
commandClass="MySql.Data.MySqlClient.MySqlCommand"
parameterClass="MySql.Data.MySqlClient.MySqlParameter&q
uot;
parameterDbTypeClass="MySql.Data.MySqlClient.MySqlDbTyp
e"
parameterDbTypeProperty="MySqlDbType"
dataAdapterClass="MySql.Data.MySqlClient.MySqlDataAdapt
er"
commandBuilderClass="MySql.Data.MySqlClient.MySqlComman
dBuilder"
usePositionalParameters="false"
useParameterPrefixInSql="true"
useParameterPrefixInParameter="true"
parameterPrefix="?"
allowMARS="false"
/>
[/code]
On 21 Apr 2008, at 01:59, Juan Pablo Araya wrote:
> You have to put your sqlmap.config in the web root
directory, or in
> bin/debug in the test project.
>
> Anyway, you can change the path of your sqlmap.config.
See section
> 4.4.1.2. of the datamapper manual.
Pieter Baele
pieter.baele telenet.be
LinuxUser: #310384
testing? What's that? If it compiles, it is good, if it
boots up it is
perfect.
--- Linus Torvalds
|
|