ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Lamey <cla...@localmatters.com>
Subject Re: error after adding a field in table
Date Wed, 26 Dec 2007 17:13:42 GMT
On 12/26/07 12:24 AM, "Joni Tan" <james7_05@hotmail.com> wrote:

> it's "localhost_log.2007-12-26.txt" log file, there is another log file
> "localhost_examples_log.2007-12-26.txt" but i think it's just an example log
> file and it doesn't have any exception
> hmm, i don't have exception caught like try and catch in my codding. But a
> while ago i add a simple try and catch in my codding and the status error is
> same like before.
>    try {
>    ...
>    }catch(Exception ex) {
>         out.println(ex);
>    }

And this is in your jsp file?  Do you have some kind of error handler setup
for HTTP 500s?  I haven't written scriplets in jsp files for a while, but
the implicit variable 'out' is a stream to the response, so it'll just show
up in the browser - not a logfile.

In general, you should use some kind of logging facility (commons-logging,
JDK logging, log4j, etc.), know how it is configured, and know where the
logs are being written.  Not having the ability to log correctly makes for
very difficult and painful development.  For example, without proper
logging, you don't know what the root cause of your current exception, which
would give you a very detailed message including the line of source code
causing the problem.

> the thing that make me strange is i just add a column in one of my sql
> mapping file but it make all my page that connect to database become error.
>> .<
> is that any specific manner when making a sql mapping in IBATIS? Because i
> just try adding a field again in another table that don't have any relation
> with other table (the query only from one table) and it run normaly( no
> error) but in the sql mapping have more than one table (that error since one
> week ago till now) it become error. --'

Yes, there is a specific manner when making a sql mapping in iBATIS.
Download the PDF here:


And read up in the "Mapped Statements" section.  Specifically you need to
know what columns are being returned by the SQL and how they are being
mapped back to Java.

My guess is that you have a "select *" somewhere in your SQL that's causing
the problem.  When you add the new column to your table, it's getting
returned via the "select *", but isn't accounted for in your resultMap for
the statement.

Without knowing what the root exception is exactly, debugging this problem
is a game of chance.  You really need to find out where your exceptions are


View raw message