You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Sean Mitchell <se...@mitchwood.com> on 2009/04/28 21:45:31 UTC

newbie trouble grokking error message

Hi...

I'm new to iBATIS, just started a new job last week and am trying to
get up to speed on a bunch of stuff, including iBATIS. The task I'm
given is to modify some existing code, which seems pretty
straightforward.

Having made most of my mods (working and running within Eclipse) I'm
getting an error that I can't decipher:

2009-04-28 15:30:27,419[main           ] DEBUG
rrorCodeSQLExceptionTranslator - Unable to translate SQLException with
Error code '0', will now try the fallback translator
2009-04-28 15:30:27,419[main           ] DEBUG
DataSourceUtils - Returning JDBC Connection to DataSource
unable to execute upic translator.  Error message = SqlMapClient
operation; uncategorized SQLException for SQL []; SQL state [null];
error code [0];
--- The error occurred in cdw.upic.sqlmap.xml.
--- The error occurred while applying a result map.
--- Check the cdwUpic.aprIncentiveResultMap.
--- The error happened while setting a property on the result object.
--- Cause: java.lang.reflect.UndeclaredThrowableException; nested
exception is com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in cdw.upic.sqlmap.xml.
--- The error occurred while applying a result map.
--- Check the cdwUpic.aprIncentiveResultMap.
--- The error happened while setting a property on the result object.
--- Cause: java.lang.reflect.UndeclaredThrowableException

I'm fairly sure that the problem is not cdwUpic.aprIncentiveResultMap,
because that has not changed and was working yesterday. This error
occurs no matter what resultmap my code uses. In fact, this worked
yesterday, but at some point today it started giving this error.

I'm guessing wildly that the problem is in the JDBC layer, although
the queries all work fine in SquirrelSQL. My other theory is that my
project (Maven based) is not configured properly somehow.

Anyone seen this before, or can suggest how I can get more information?

Cheers,

Sean

Re: newbie trouble grokking error message

Posted by Larry Meadors <la...@gmail.com>.
"The error happened while setting a property on the result object."

I'm guessing that's your culprit..check that the results are all being
mapped to valid properties.

Larry


On Tue, Apr 28, 2009 at 3:52 PM, Nathan Maves <na...@gmail.com> wrote:
> Welcome to ibatis!
> Could you give us a little more information like what DB you are using? what
> driver?  what does the sql look like?
> I can't say that I have seen your error before but I am sure we can figure
> out what this issue is.
> Nathan
>
> On Tue, Apr 28, 2009 at 1:45 PM, Sean Mitchell <se...@mitchwood.com> wrote:
>>
>> Hi...
>>
>> I'm new to iBATIS, just started a new job last week and am trying to
>> get up to speed on a bunch of stuff, including iBATIS. The task I'm
>> given is to modify some existing code, which seems pretty
>> straightforward.
>>
>> Having made most of my mods (working and running within Eclipse) I'm
>> getting an error that I can't decipher:
>>
>> 2009-04-28 15:30:27,419[main           ] DEBUG
>> rrorCodeSQLExceptionTranslator - Unable to translate SQLException with
>> Error code '0', will now try the fallback translator
>> 2009-04-28 15:30:27,419[main           ] DEBUG
>> DataSourceUtils - Returning JDBC Connection to DataSource
>> unable to execute upic translator.  Error message = SqlMapClient
>> operation; uncategorized SQLException for SQL []; SQL state [null];
>> error code [0];
>> --- The error occurred in cdw.upic.sqlmap.xml.
>> --- The error occurred while applying a result map.
>> --- Check the cdwUpic.aprIncentiveResultMap.
>> --- The error happened while setting a property on the result object.
>> --- Cause: java.lang.reflect.UndeclaredThrowableException; nested
>> exception is com.ibatis.common.jdbc.exception.NestedSQLException:
>> --- The error occurred in cdw.upic.sqlmap.xml.
>> --- The error occurred while applying a result map.
>> --- Check the cdwUpic.aprIncentiveResultMap.
>> --- The error happened while setting a property on the result object.
>> --- Cause: java.lang.reflect.UndeclaredThrowableException
>>
>> I'm fairly sure that the problem is not cdwUpic.aprIncentiveResultMap,
>> because that has not changed and was working yesterday. This error
>> occurs no matter what resultmap my code uses. In fact, this worked
>> yesterday, but at some point today it started giving this error.
>>
>> I'm guessing wildly that the problem is in the JDBC layer, although
>> the queries all work fine in SquirrelSQL. My other theory is that my
>> project (Maven based) is not configured properly somehow.
>>
>> Anyone seen this before, or can suggest how I can get more information?
>>
>> Cheers,
>>
>> Sean
>
>

Re: newbie trouble grokking error message

Posted by Sean Mitchell <se...@mitchwood.com>.
On Wed, Apr 29, 2009 at 9:46 AM, Nathan Maves <na...@gmail.com> wrote:

> This really does look like a mapping issue.  Please include the source code
> of the bean and the <select> map that you are using.

No go on posting any code... I was referred to in house 'experts' who
knew even less than I.

It turns out that it was indeed a mapping issue, but not in the
reported file. The error log said the problem was in the source
mapping file, but in fact it was in the target mapping file. Case
sensitivity issue and user error :)

Sean

Re: newbie trouble grokking error message

Posted by Sean Mitchell <se...@mitchwood.com>.
On Wed, Apr 29, 2009 at 9:46 AM, Nathan Maves <na...@gmail.com> wrote:

> This really does look like a mapping issue.  Please include the source code
> of the bean and the <select> map that you are using.

As I'm new to this company and they are a bit uptight about some
things, I'm not sure that I can do that just yet. Will ask my manager
when he comes back from whatever meeting he's in if I can do that.

However, here's something interesting. I created an exact duplicate of
the bean in the same package, with only a differing name, specified
that in the class of the resultmap, and it works. Maybe some sort of
weird classpath badness is happening here.

Spring is involved in this project too... and that's something else
that I haven't any familiarity with. Think I'll spend a bit of time
looking at that end and see if there's some sort of factory build
objects or something.

Thanks for your quick responses!

Sean

Re: newbie trouble grokking error message

Posted by Nathan Maves <na...@gmail.com>.
This really does look like a mapping issue.  Please include the source code
of the bean and the <select> map that you are using.

On Wed, Apr 29, 2009 at 7:31 AM, Sean Mitchell <se...@mitchwood.com> wrote:

> On Tue, Apr 28, 2009 at 5:52 PM, Nathan Maves <na...@gmail.com>
> wrote:
>
> > Welcome to ibatis!
>
> Thanks... it's a very interesting project, not sure how it escaped my
> notice before. A very nice middle ground between Hibernate and
> DBUtils.
>
> > Could you give us a little more information like what DB you are using?
> what
> > driver?  what does the sql look like?
>
> Ok.... the code is a collection of simple translators that builds up
> POJOs from data in a MS SQL Server db, and then writes them out to a
> MySQL db. The urls look like:
>
> source:
> jdbc:jtds:sqlserver://sqlserver:1433/SRCDB;sendStringParametersAsUnicode=false
> destination: jdbc:mysql://localhost/DESTDB
>
> To narrow down the problem, I have commented out all but one
> field/property (a String) and am using a simple
>
> select typename from Incentives
>
> This query works fine in SquirrelSQL.
>
> My resultmap looks like:
>
>        <resultMap id="aprIncentiveResultMap"
> class="com.mitchwood.Incentive" >
>                <result column="typename" property="type" />
>        </resultMap>
>
>
> Now, there are some other translators than the one I am currently
> working with, and they all have their own resultmaps and SQL, and they
> all fail in the same way. Even when I commented out the entire body of
> the result map, so that nothing was mapped, I get this error.
>
> On one of them, the query takes a while to run in Squirrel, and I get
> a corresponding pause on execution, before I see the error in the
> console. I'm starting to think that maybe the resultset is going away
> right after it has been created, as iBATIS tries to access it.
>
> Wish I could see the actual Throwable at the heart of it:
> --- Cause: java.lang.reflect.UndeclaredThrowableException
>
>
> Hopefully something in here will help you help me :)
>
> Cheers,
>
> Sean
>

Re: newbie trouble grokking error message

Posted by Sean Mitchell <se...@mitchwood.com>.
On Tue, Apr 28, 2009 at 5:52 PM, Nathan Maves <na...@gmail.com> wrote:

> Welcome to ibatis!

Thanks... it's a very interesting project, not sure how it escaped my
notice before. A very nice middle ground between Hibernate and
DBUtils.

> Could you give us a little more information like what DB you are using? what
> driver?  what does the sql look like?

Ok.... the code is a collection of simple translators that builds up
POJOs from data in a MS SQL Server db, and then writes them out to a
MySQL db. The urls look like:

source: jdbc:jtds:sqlserver://sqlserver:1433/SRCDB;sendStringParametersAsUnicode=false
destination: jdbc:mysql://localhost/DESTDB

To narrow down the problem, I have commented out all but one
field/property (a String) and am using a simple

select typename from Incentives

This query works fine in SquirrelSQL.

My resultmap looks like:

	<resultMap id="aprIncentiveResultMap" class="com.mitchwood.Incentive" >		
		<result column="typename" property="type" />
	</resultMap>


Now, there are some other translators than the one I am currently
working with, and they all have their own resultmaps and SQL, and they
all fail in the same way. Even when I commented out the entire body of
the result map, so that nothing was mapped, I get this error.

On one of them, the query takes a while to run in Squirrel, and I get
a corresponding pause on execution, before I see the error in the
console. I'm starting to think that maybe the resultset is going away
right after it has been created, as iBATIS tries to access it.

Wish I could see the actual Throwable at the heart of it:
--- Cause: java.lang.reflect.UndeclaredThrowableException


Hopefully something in here will help you help me :)

Cheers,

Sean

Re: newbie trouble grokking error message

Posted by Nathan Maves <na...@gmail.com>.
Welcome to ibatis!
Could you give us a little more information like what DB you are using? what
driver?  what does the sql look like?

I can't say that I have seen your error before but I am sure we can figure
out what this issue is.

Nathan

On Tue, Apr 28, 2009 at 1:45 PM, Sean Mitchell <se...@mitchwood.com> wrote:

> Hi...
>
> I'm new to iBATIS, just started a new job last week and am trying to
> get up to speed on a bunch of stuff, including iBATIS. The task I'm
> given is to modify some existing code, which seems pretty
> straightforward.
>
> Having made most of my mods (working and running within Eclipse) I'm
> getting an error that I can't decipher:
>
> 2009-04-28 15:30:27,419[main           ] DEBUG
> rrorCodeSQLExceptionTranslator - Unable to translate SQLException with
> Error code '0', will now try the fallback translator
> 2009-04-28 15:30:27,419[main           ] DEBUG
> DataSourceUtils - Returning JDBC Connection to DataSource
> unable to execute upic translator.  Error message = SqlMapClient
> operation; uncategorized SQLException for SQL []; SQL state [null];
> error code [0];
> --- The error occurred in cdw.upic.sqlmap.xml.
> --- The error occurred while applying a result map.
> --- Check the cdwUpic.aprIncentiveResultMap.
> --- The error happened while setting a property on the result object.
> --- Cause: java.lang.reflect.UndeclaredThrowableException; nested
> exception is com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in cdw.upic.sqlmap.xml.
> --- The error occurred while applying a result map.
> --- Check the cdwUpic.aprIncentiveResultMap.
> --- The error happened while setting a property on the result object.
> --- Cause: java.lang.reflect.UndeclaredThrowableException
>
> I'm fairly sure that the problem is not cdwUpic.aprIncentiveResultMap,
> because that has not changed and was working yesterday. This error
> occurs no matter what resultmap my code uses. In fact, this worked
> yesterday, but at some point today it started giving this error.
>
> I'm guessing wildly that the problem is in the JDBC layer, although
> the queries all work fine in SquirrelSQL. My other theory is that my
> project (Maven based) is not configured properly somehow.
>
> Anyone seen this before, or can suggest how I can get more information?
>
> Cheers,
>
> Sean
>