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 Ling Wang <li...@yahoo.com> on 2005/09/12 17:43:51 UTC

Debug SQL Statement, Log4net help needed

Hi there,

I ran NPetShop out of box and got an sql exception
"Data type mismatch in criteria" when I tried to
register a new user (I did not create any new code,
the original code uses "InsertProfile"). I would like
to see the sql statement. I searched the mail archive
and found a suggestion using
GetMappedStatement("InsertProfile"). I tried and got
an message:

MappedStatement: InsertProfile
InsertProfile-InLineParameterMap 

which is not I am looking for.

I then tried to configure log4net following the
documentation. Hoping to get the SQL statement that
way. I tried almost everything including adding
log4net config info to  the web.config or using its
own config file by setting or withoug setting: 

[assembly: log4net.Config.DOMConfigurator(
ConfigFile="NPetshop.Web.dll.config",Watch=true )] 

I still did not see any log.txt file.

Can anyone help me out?

Thanks.

Ling

Re: Debug SQL Statement, Log4net help needed

Posted by Ling Wang <li...@yahoo.com>.
Ron,

Thanks a lot for your help. I tried again using
[assembly: log4net.Config.DOMConfigurator()]. Still no
luck. I am using the access mdb included with the
distribution.

I also tried npetshop2 and got a few problems. I could
at least get npetshop running. I can not even load
successfully npetshop2 int VS.Net 2003. I first got a
error message box saying: refreshing the project
failed: unable to retrieve the folder information from
the server (even though I have copied the web project
to the wwwroot and set the virtual directory). I then
needed to down load nunitAsp. I then found that
default.aspx was excluded from the web project. After
I include it into the web project, the code can not
compile saying

NPetshop.Presentation.UserActions is not right because
 UserActions does not exist.

I can run the NPetshop (not NPetshop2) but unable to
see the sql statement and can not make log4net work
either.

Ling


> What database are you running NPetShop against?
> 
> NPetShop has been neglected for a while. I think
> NPetShop2:
> 
> 
>
http://svn.apache.org/repos/asf/ibatis/trunk/cs/npetshop2/
> 
> is more up to date. 
> 
> What does your log4net config file/section look
> like?
> 
> This is wrong:
> 
>  [assembly: log4net.Config.DOMConfigurator(
>  ConfigFile="NPetshop.Web.dll.config",Watch=true )] 
> 
> The config file for every ASP.Net application is
> Web.config. ASP.Net
> automatically puts a file watch on the Web.config
> file. If the log4net
> node is inside the Web.config file, this is what
> you'd call to
> configure log4net:
> 
>  [assembly: log4net.Config.DOMConfigurator()]
> 
> --- Ling Wang <li...@yahoo.com> wrote:
> 
> > Hi there,
> > 
> > I ran NPetShop out of box and got an sql exception
> > "Data type mismatch in criteria" when I tried to
> > register a new user (I did not create any new
> code,
> > the original code uses "InsertProfile"). I would
> like
> > to see the sql statement. I searched the mail
> archive
> > and found a suggestion using
> > GetMappedStatement("InsertProfile"). I tried and
> got
> > an message:
> > 
> > MappedStatement: InsertProfile
> > InsertProfile-InLineParameterMap 
> > 
> > which is not I am looking for.
> > 
> > I then tried to configure log4net following the
> > documentation. Hoping to get the SQL statement
> that
> > way. I tried almost everything including adding
> > log4net config info to  the web.config or using
> its
> > own config file by setting or withoug setting: 
> > 
> > [assembly: log4net.Config.DOMConfigurator(
> > ConfigFile="NPetshop.Web.dll.config",Watch=true )]
> 
> > 
> > I still did not see any log.txt file.
> > 
> > Can anyone help me out?
> > 
> > Thanks.
> > 
> > Ling
> > 
> 
> 


Re: Debug SQL Statement, Log4net help needed

Posted by Ron Grabowski <ro...@yahoo.com>.
What database are you running NPetShop against?

NPetShop has been neglected for a while. I think NPetShop2:

 http://svn.apache.org/repos/asf/ibatis/trunk/cs/npetshop2/

is more up to date. 

What does your log4net config file/section look like?

This is wrong:

 [assembly: log4net.Config.DOMConfigurator(
 ConfigFile="NPetshop.Web.dll.config",Watch=true )] 

The config file for every ASP.Net application is Web.config. ASP.Net
automatically puts a file watch on the Web.config file. If the log4net
node is inside the Web.config file, this is what you'd call to
configure log4net:

 [assembly: log4net.Config.DOMConfigurator()]

--- Ling Wang <li...@yahoo.com> wrote:

> Hi there,
> 
> I ran NPetShop out of box and got an sql exception
> "Data type mismatch in criteria" when I tried to
> register a new user (I did not create any new code,
> the original code uses "InsertProfile"). I would like
> to see the sql statement. I searched the mail archive
> and found a suggestion using
> GetMappedStatement("InsertProfile"). I tried and got
> an message:
> 
> MappedStatement: InsertProfile
> InsertProfile-InLineParameterMap 
> 
> which is not I am looking for.
> 
> I then tried to configure log4net following the
> documentation. Hoping to get the SQL statement that
> way. I tried almost everything including adding
> log4net config info to  the web.config or using its
> own config file by setting or withoug setting: 
> 
> [assembly: log4net.Config.DOMConfigurator(
> ConfigFile="NPetshop.Web.dll.config",Watch=true )] 
> 
> I still did not see any log.txt file.
> 
> Can anyone help me out?
> 
> Thanks.
> 
> Ling
>