ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Schrader" <tschra...@gmail.com>
Subject Re: locating errors in SqlMap
Date Tue, 18 Jul 2006 21:04:16 GMT
Hi Vadim,

I feel your pain in quietly cursing iBATIS' seemingly mystical error
messages when I was first starting out.

I'm not aware of any way to make iBATIS' error mechanism more verbose.
 In practice, I do the following, along with your suggestion of
commenting out parts of the map:

1.  Keep the SQL Map XML files concise.
2.  Separate SQL Map XML files into logical units.

I reckon a good idea would be to start a catalog of various error
messages on the wiki, or maybe even a full-blown debugging strategy
section (I didn't see one after a quick perusal of the wiki today).
Taking your example:

Error:
"no readable property named FOO"

Problem:
iBATIS cannot find the FOO property on the class specified in the result map.

Resolution (the usual suspects):
Does the class have a FOO property?
Does the class adhere to JavaBeans specifications?
Is the result map element free of typos?

I suspect this could turn out to be an extremely helpful resource if
maintained, but I personally lack the time to get this sort of thing
started.  Any takers?

Ted

On 18/07/06, Vadim Grinshpun <vadim@ll.mit.edu> wrote:
> Hi all,
>
> in a situation where iBATIS's parser throws an exception, is there a way
> to tell which part of the sql map being parsed is actually the culprit?
> The error shown in the exception is too vague, and doesn't point to a
> particular file/line/xml element/whatnot. Specifically, I have a case of
> a "no readable property named FOO", but the FOO in question is being
> used in a number of places, a number of which have just been modified. I
> could try to track it down by commenting out different parts of the map
> to see which part(s) make the error go appear/go away, but I was hoping
> there might be a more intelligent way to approach this.
>
> If there isn't a better way to do this currently, is it feasible to add
> better error reporting facilities into the parser, and are there any
> plans to do so?
>
> Thanks for any advice.
> -Vadim
>

Mime
View raw message