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 Witold Bołt <ja...@houp.info> on 2007/01/14 22:34:58 UTC

Complex Properties problem

Hi!

I'm developing a simple Web app with Spring (2.0) and iBatis (2.2), and 
... got one strange problem with so called complex properties.

What I did was basically following the Developer guide (as on page 34, 
current stable version), and did:

<sqlMap namespace="foo">
     <resultMap id="User" class="foo.bar.User">
         <result property="id" column="id"  />
         <result property="login" column="login" />
     </resultMap>

     <resultMap id="Article" class="foo.bar.Article">
         <result property="id" column="id"  />
         <result property="author" column="user_id" select="getUser"/>
         <result property="title" column="title"  />
     </resultMap>
		
     <select id="getUser" parameterClass="int"  resultMap="User">
     	SELECT id,login FROM user WHERE id = #value#
     </select>

     <select id="getArticle" parameterClass="int" resultMap="Article">
     	SELECT id,user_id,title FROM object WHERE id = #value#
     </select>
</sqlMap>


User and Article classes are simple JavaBeans. Everything works without 
the select="getUser" in Article. I can get a selected User and Article. 
But I can not get them together. (I know that I could change this and do 
a select from two tables with some joins, but that is not the case - I 
want it the way it is.)

When the code is used as it's shown here, the first SQL statment is 
passed to the database (MySQL 5), and the second is not. Instead a Null 
Pointer Exception arise:

com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in /org/kolor/cms/data/dao/ibatis/jcms-client.xml.
--- The error occurred while applying a result map.
--- Check the jcms-client.Article.
--- Check the result mapping for the 'author' property.
--- Cause: java.lang.NullPointerException
	at 
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:188)
	at 
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)
	at 
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:566)
	at 
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:541)
	at 
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
	at 
org.springframework.orm.ibatis.SqlMapClientTemplate$1.doInSqlMapClient(SqlMapClientTemplate.java:243)
	at 
org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:193)
	at 
org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(SqlMapClientTemplate.java:241)
	at 
org.kolor.cms.data.dao.ibatis.IbatisClientDao.getArticle(IbatisClientDao.java:18)
	at 
org.kolor.cms.controler.ShowItemController.handleRequestInternal(ShowItemController.java:54)
...

(full log info and stack trace in attachment).

I'm sure that database is working well. The JDBC data source comes from 
the server (Apache Geronimo) database pool (and it's invoked through 
JNDI). And as I said - I can invoke getUser(1) alone, and getArticle(1) 
when this 'complex property' is removed.

I've tried running in different modes with and without lazy init, 
enchencments modes and so on.

How you got any idea what is wrong?

If you need any more code I can send it here.

Greetings,
-me.

-- 
--==--==----------------------
   Witold Bołt ::  ja@houp.info
gsm#660316053 :: www.houp.info

Re: Complex Properties problem

Posted by Witold Bołt <ja...@houp.info>.
Joakim Olsson napisał(a):
>> Joakim Olsson napisał(a):
>>> I have had this problem since switching to Geronimo from a "clean"
>>> Tomcat-environment too.
>>>
>>> The problem is that Geronimo uses a newer version of CGLIB than iBatis
>>> is
>>> supporting.
>>>
>>> I solved the problem by putting the correct version of cglib.jar in my
>>> webapps lib-dir but I think it should also be possible to solve the
>>> problem by using the <hidden-classes>-tag in the geronimo-web.xml to
>>> mask
>>> out the cglib-packages for your application.
>> Uhm. From what I can see - my geronimo comes with cglib 2.1_3. Also
>> Spring uses this version. In iBATIS documentation it says that it
>> supports cglib 2.0, but I can't find this version anywhere (on
>> cglib.sf.net there are only 2.1_3 and 2.2_beta). Also - are you sure
>> that when iBATIS is set to useEnchancemnts="false" in sqlMapConfig, it
>> uses cglib?
>>
>> Anyway I'll try with different application server in case it's geronimo
>> problem.
>>
> 
> I have tried with useEnhancements="false" as well but it didn't seem to
> help. Turning off lazy loading helps but causes other problems in my app
> since I depend on the lazy loading of course. :-D

I've tried turning lazy load and enchantments on and off in different 
combinations and got problems in all of those configurations. As it 
looks like from stack trace logs, cglib gets only used when both lazy 
loading and enhancement are enabled. In this case, error messages look 
slightly different, because of cglib-generated classes.

Anyway such select scenario that we are talking about SHOULD work 
perfectly (even if it's not optimal or smart to use;) without any 
magical enhancments and tricks, and it does not, and still it's unclear why.

> I found the correct jar by Google but it wasn't easy to find. I can send
> it to you tonight when I come home from work if you want it.

Ok. Please send it to my private mail address. Thanks!

> I think that <hidden-classes> can be used to mask out the cglib-package
> from the classloader for your application though. There was a thread on
> the Geronimo-list on hidden-classes just a couple of days ago.

I'll check on that.

Greetings,
-me.

-- 
--==--==----------------------
   Witold Bołt ::  ja@houp.info
gsm#660316053 :: www.houp.info

Re: Complex Properties problem

Posted by Joakim Olsson <ar...@lingonpaj.com>.
> Joakim Olsson napisał(a):
>> I have had this problem since switching to Geronimo from a "clean"
>> Tomcat-environment too.
>>
>> The problem is that Geronimo uses a newer version of CGLIB than iBatis
>> is
>> supporting.
>>
>> I solved the problem by putting the correct version of cglib.jar in my
>> webapps lib-dir but I think it should also be possible to solve the
>> problem by using the <hidden-classes>-tag in the geronimo-web.xml to
>> mask
>> out the cglib-packages for your application.
>
> Uhm. From what I can see - my geronimo comes with cglib 2.1_3. Also
> Spring uses this version. In iBATIS documentation it says that it
> supports cglib 2.0, but I can't find this version anywhere (on
> cglib.sf.net there are only 2.1_3 and 2.2_beta). Also - are you sure
> that when iBATIS is set to useEnchancemnts="false" in sqlMapConfig, it
> uses cglib?
>
> Anyway I'll try with different application server in case it's geronimo
> problem.
>

I have tried with useEnhancements="false" as well but it didn't seem to
help. Turning off lazy loading helps but causes other problems in my app
since I depend on the lazy loading of course. :-D

I found the correct jar by Google but it wasn't easy to find. I can send
it to you tonight when I come home from work if you want it.

I think that <hidden-classes> can be used to mask out the cglib-package
from the classloader for your application though. There was a thread on
the Geronimo-list on hidden-classes just a couple of days ago.

/Joakim


Re: Complex Properties problem

Posted by Witold Bołt <ja...@houp.info>.
Joakim Olsson napisał(a):
> I have had this problem since switching to Geronimo from a "clean"
> Tomcat-environment too.
> 
> The problem is that Geronimo uses a newer version of CGLIB than iBatis is
> supporting.
> 
> I solved the problem by putting the correct version of cglib.jar in my
> webapps lib-dir but I think it should also be possible to solve the
> problem by using the <hidden-classes>-tag in the geronimo-web.xml to mask
> out the cglib-packages for your application.

Uhm. From what I can see - my geronimo comes with cglib 2.1_3. Also 
Spring uses this version. In iBATIS documentation it says that it 
supports cglib 2.0, but I can't find this version anywhere (on 
cglib.sf.net there are only 2.1_3 and 2.2_beta). Also - are you sure 
that when iBATIS is set to useEnchancemnts="false" in sqlMapConfig, it 
uses cglib?

Anyway I'll try with different application server in case it's geronimo 
problem.

Greetings,
-me.

-- 
--==--==----------------------
   Witold Bołt ::  ja@houp.info
gsm#660316053 :: www.houp.info

Re: Complex Properties problem

Posted by Joakim Olsson <ar...@lingonpaj.com>.
I have had this problem since switching to Geronimo from a "clean"
Tomcat-environment too.

The problem is that Geronimo uses a newer version of CGLIB than iBatis is
supporting.

I solved the problem by putting the correct version of cglib.jar in my
webapps lib-dir but I think it should also be possible to solve the
problem by using the <hidden-classes>-tag in the geronimo-web.xml to mask
out the cglib-packages for your application.

Best regards,
Joakim


> Brandon Goodin napisa³(a):
>> I would recommend you turn on the iBATIS logging and take a look at the
>> SQL that is being executed and the parameters being passed in at the
>> time of failure. It appears to be a problem with the SQL being executed
>> for the author property to be populated with a User object.
>
> The problem is that the SQL for author is not executed at all.
> The first SELECT is visible in the log that is supplied. I've also
> turned on logging in MySQL server, so I can see every statement/query
> that goes to the server. So something happens after first and before
> second query to the server. Apparently null-pointer exception arise, but
> I have no idea why. Changing author to int property of article and
> removing select="getUser" from the sqlmap gives me a correct Article
> with correct user id (=1). Executing getUser(1) by hand also works fine
> - I get a valid user with all the data - and notice that the sql syntax
> for this statement does not change.
>
> Anyway thanks to your response!
>
> Greetings,
> -me.
>
> --
> --==--==----------------------
>    Witold Bo³t ::  ja@houp.info
> gsm#660316053 :: www.houp.info
>
>


Re: Complex Properties problem

Posted by Witold Bołt <ja...@houp.info>.
Brandon Goodin napisał(a):
> I would recommend you turn on the iBATIS logging and take a look at the 
> SQL that is being executed and the parameters being passed in at the 
> time of failure. It appears to be a problem with the SQL being executed 
> for the author property to be populated with a User object.

The problem is that the SQL for author is not executed at all.
The first SELECT is visible in the log that is supplied. I've also 
turned on logging in MySQL server, so I can see every statement/query 
that goes to the server. So something happens after first and before 
second query to the server. Apparently null-pointer exception arise, but 
I have no idea why. Changing author to int property of article and 
removing select="getUser" from the sqlmap gives me a correct Article 
with correct user id (=1). Executing getUser(1) by hand also works fine 
- I get a valid user with all the data - and notice that the sql syntax 
for this statement does not change.

Anyway thanks to your response!

Greetings,
-me.

-- 
--==--==----------------------
   Witold Bołt ::  ja@houp.info
gsm#660316053 :: www.houp.info

Re: Complex Properties problem

Posted by Brandon Goodin <br...@gmail.com>.
I would recommend you turn on the iBATIS logging and take a look at the SQL
that is being executed and the parameters being passed in at the time of
failure. It appears to be a problem with the SQL being executed for the
author property to be populated with a User object.

Brandon

On 1/14/07, Witold Bołt <ja...@houp.info> wrote:
>
> Hi!
>
> I'm developing a simple Web app with Spring (2.0) and iBatis (2.2), and
> ... got one strange problem with so called complex properties.
>
> What I did was basically following the Developer guide (as on page 34,
> current stable version), and did:
>
> <sqlMap namespace="foo">
>      <resultMap id="User" class="foo.bar.User">
>          <result property="id" column="id"  />
>          <result property="login" column="login" />
>      </resultMap>
>
>      <resultMap id="Article" class="foo.bar.Article">
>          <result property="id" column="id"  />
>          <result property="author" column="user_id" select="getUser"/>
>          <result property="title" column="title"  />
>      </resultMap>
>
>      <select id="getUser" parameterClass="int"  resultMap="User">
>         SELECT id,login FROM user WHERE id = #value#
>      </select>
>
>      <select id="getArticle" parameterClass="int" resultMap="Article">
>         SELECT id,user_id,title FROM object WHERE id = #value#
>      </select>
> </sqlMap>
>
>
> User and Article classes are simple JavaBeans. Everything works without
> the select="getUser" in Article. I can get a selected User and Article.
> But I can not get them together. (I know that I could change this and do
> a select from two tables with some joins, but that is not the case - I
> want it the way it is.)
>
> When the code is used as it's shown here, the first SQL statment is
> passed to the database (MySQL 5), and the second is not. Instead a Null
> Pointer Exception arise:
>
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in /org/kolor/cms/data/dao/ibatis/jcms-client.xml.
> --- The error occurred while applying a result map.
> --- Check the jcms-client.Article.
> --- Check the result mapping for the 'author' property.
> --- Cause: java.lang.NullPointerException
>         at
>
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback
> (GeneralStatement.java:188)
>         at
>
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject
> (GeneralStatement.java:104)
>         at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(
> SqlMapExecutorDelegate.java:566)
>         at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(
> SqlMapExecutorDelegate.java:541)
>         at
> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(
> SqlMapSessionImpl.java:106)
>         at
> org.springframework.orm.ibatis.SqlMapClientTemplate$1.doInSqlMapClient(
> SqlMapClientTemplate.java:243)
>         at
> org.springframework.orm.ibatis.SqlMapClientTemplate.execute(
> SqlMapClientTemplate.java:193)
>         at
> org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(
> SqlMapClientTemplate.java:241)
>         at
> org.kolor.cms.data.dao.ibatis.IbatisClientDao.getArticle(
> IbatisClientDao.java:18)
>         at
> org.kolor.cms.controler.ShowItemController.handleRequestInternal(
> ShowItemController.java:54)
> ...
>
> (full log info and stack trace in attachment).
>
> I'm sure that database is working well. The JDBC data source comes from
> the server (Apache Geronimo) database pool (and it's invoked through
> JNDI). And as I said - I can invoke getUser(1) alone, and getArticle(1)
> when this 'complex property' is removed.
>
> I've tried running in different modes with and without lazy init,
> enchencments modes and so on.
>
> How you got any idea what is wrong?
>
> If you need any more code I can send it here.
>
> Greetings,
> -me.
>
> --
> --==--==----------------------
>    Witold Bołt ::  ja@houp.info
> gsm#660316053 :: www.houp.info
>
>
> 2007-01-14 22:12:37,703 DEBUG [
> org.springframework.web.servlet.DispatcherServlet] - Testing handler map [
> org.springframework.web.servlet.handler.SimpleUrlHandlerMapping@5d7a8d] in
> DispatcherServlet with name 'jkolorcms'
> 2007-01-14 22:12:37,703 DEBUG [
> org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - Looking
> up handler for [/1]
> 2007-01-14 22:12:37,718 DEBUG [
> org.springframework.web.servlet.DispatcherServlet] - Testing handler
> adapter [
> org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter@a456bb]
> 2007-01-14 22:12:37,718 DEBUG [
> org.springframework.web.servlet.DispatcherServlet] - Testing handler
> adapter [
> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter@2b3223]
> 2007-01-14 22:12:37,718 DEBUG [
> org.springframework.web.servlet.DispatcherServlet] - Last-Modified value
> for [/jKolorCMS/article/1] is [-1]
> 2007-01-14 22:12:37,734 DEBUG [
> org.springframework.web.servlet.DispatcherServlet] - DispatcherServlet
> with name 'jkolorcms' received request for [/jKolorCMS/article/1]
> 2007-01-14 22:12:37,750 DEBUG [
> org.springframework.web.servlet.DispatcherServlet] - Bound request context
> to thread: org.apache.catalina.connector.RequestFacade@e6f7a
> 2007-01-14 22:12:37,765 DEBUG [
> org.springframework.web.servlet.DispatcherServlet] - Testing handler
> adapter [
> org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter@a456bb]
> 2007-01-14 22:12:37,765 DEBUG [
> org.springframework.web.servlet.DispatcherServlet] - Testing handler
> adapter [
> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter@2b3223]
> 2007-01-14 22:12:37,765 DEBUG [
> org.springframework.orm.ibatis.SqlMapClientTemplate] - Opened
> SqlMapSession [com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl@10e08e1]
> for iBATIS operation
> 2007-01-14 22:12:37,796 DEBUG [
> org.springframework.jdbc.datasource.DataSourceUtils] - Fetching JDBC
> Connection from DataSource
> 2007-01-14 22:12:37,812 DEBUG [java.sql.Connection] - {conn-100000}
> Connection
> 2007-01-14 22:12:37,812 DEBUG [
> org.springframework.orm.ibatis.SqlMapClientTemplate] - Obtained JDBC
> Connection [org.tranql.connector.jdbc.ConnectionHandle@be675c] for iBATIS
> operation
> 2007-01-14 22:12:37,843 DEBUG [java.sql.Connection] - {conn-100000}
> Preparing Statement:       SELECT id,user_id,title,summary,body,date FROM
> object WHERE id = ? AND deleted = 'false'
> 2007-01-14 22:12:40,453 DEBUG [java.sql.PreparedStatement] - {pstm-100001}
> Executing Statement:       SELECT id,user_id,title,summary,body,date FROM
> object WHERE id = ? AND deleted = 'false'
> 2007-01-14 22:12:40,468 DEBUG [java.sql.PreparedStatement] - {pstm-100001}
> Parameters: [1]
> 2007-01-14 22:12:40,468 DEBUG [java.sql.PreparedStatement] - {pstm-100001}
> Types: [java.lang.Integer]
> 2007-01-14 22:12:40,953 DEBUG [java.sql.ResultSet] - {rset-100002}
> ResultSet
> 2007-01-14 22:12:41,031 DEBUG [
> org.springframework.beans.factory.xml.PluggableSchemaResolver] - Loading
> schema mappings from [META-INF/spring.schemas]
> 2007-01-14 22:12:41,031 DEBUG [
> org.springframework.beans.factory.xml.PluggableSchemaResolver] - Loaded
> schema mappings: {
> http://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd,
>
> http://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd,
>
> http://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd,
>
> http://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd,
>
> http://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd,
>
> http://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd,
>
> http://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd,
>
> http://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd,
>
> http://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd,
>
> http://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-2.0.xsd,
>
> http://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd,
>
> http://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd,
>
> http://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd,
>
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd
> }
> 2007-01-14 22:12:41,046 INFO [
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading
> XML bean definitions from class path resource
> [org/springframework/jdbc/support/sql-error-codes.xml]
> 2007-01-14 22:12:41,046 DEBUG [
> org.springframework.beans.factory.xml.DefaultDocumentLoader] - Using JAXP
> provider [org.apache.xerces.jaxp.DocumentBuilderFactoryImpl]
> 2007-01-14 22:12:41,062 DEBUG [
> org.springframework.beans.factory.xml.BeansDtdResolver] - Found beans DTD
> [http://www.springframework.org/dtd/spring-beans-2.0.dtd] in classpath:
> spring-beans-2.0.dtd
> 2007-01-14 22:12:41,078 DEBUG [
> org.springframework.beans.factory.xml.DefaultNamespaceHandlerResolver] -
> Loaded mappings [{
> http://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler,
>
> http://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler,
>
> http://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler,
>
> http://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler,
>
> http://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler,
>
> http://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler}
> ]
> 2007-01-14 22:12:41,078 DEBUG [org.springframework.util.ClassUtils] -
> Class [groovy.lang.GroovyObject] or one of its dependencies is not
> present: java.lang.ClassNotFoundException: groovy.lang.GroovyObject in
> classloader default/jKolorCMSEAR_jKolorCMS.war/1.0/car
> 2007-01-14 22:12:41,093 DEBUG [org.springframework.util.ClassUtils] -
> Class [org.jruby.IRuby] or one of its dependencies is not present:
> java.lang.ClassNotFoundException: org.jruby.IRuby in classloader
> default/jKolorCMSEAR_jKolorCMS.war/1.0/car
> 2007-01-14 22:12:41,093 DEBUG [org.springframework.util.ClassUtils] -
> Class [bsh.Interpreter] or one of its dependencies is not present:
> java.lang.ClassNotFoundException: bsh.Interpreter in classloader
> default/jKolorCMSEAR_jKolorCMS.war/1.0/car
> 2007-01-14 22:12:41,093 DEBUG [
> org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader]
> - Loading bean definitions
> 2007-01-14 22:12:41,109 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating shared instance of singleton bean 'DB2'
> 2007-01-14 22:12:41,109 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating instance of bean 'DB2' with merged definition [Root bean: class [
> org.springframework.jdbc.support.SQLErrorCodes]; scope=singleton;
> abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0;
> dependencyCheck=0; factoryBeanName=null; factoryMethodName=null;
> initMethodName=null; destroyMethodName=null; defined in class path resource
> [org/springframework/jdbc/support/sql-error-codes.xml]]
> 2007-01-14 22:12:41,125 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Eagerly caching bean 'DB2' to allow for resolving potential circular
> references
> 2007-01-14 22:12:41,140 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating shared instance of singleton bean 'Derby'
> 2007-01-14 22:12:41,140 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating instance of bean 'Derby' with merged definition [Root bean: class [
> org.springframework.jdbc.support.SQLErrorCodes]; scope=singleton;
> abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0;
> dependencyCheck=0; factoryBeanName=null; factoryMethodName=null;
> initMethodName=null; destroyMethodName=null; defined in class path resource
> [org/springframework/jdbc/support/sql-error-codes.xml]]
> 2007-01-14 22:12:41,140 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Eagerly caching bean 'Derby' to allow for resolving potential circular
> references
> 2007-01-14 22:12:41,156 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating shared instance of singleton bean 'HSQL'
> 2007-01-14 22:12:41,156 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating instance of bean 'HSQL' with merged definition [Root bean: class [
> org.springframework.jdbc.support.SQLErrorCodes]; scope=singleton;
> abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0;
> dependencyCheck=0; factoryBeanName=null; factoryMethodName=null;
> initMethodName=null; destroyMethodName=null; defined in class path resource
> [org/springframework/jdbc/support/sql-error-codes.xml]]
> 2007-01-14 22:12:41,156 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Eagerly caching bean 'HSQL' to allow for resolving potential circular
> references
> 2007-01-14 22:12:41,171 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating shared instance of singleton bean 'Informix'
> 2007-01-14 22:12:41,171 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating instance of bean 'Informix' with merged definition [Root bean:
> class [org.springframework.jdbc.support.SQLErrorCodes]; scope=singleton;
> abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0;
> dependencyCheck=0; factoryBeanName=null; factoryMethodName=null;
> initMethodName=null; destroyMethodName=null; defined in class path resource
> [org/springframework/jdbc/support/sql-error-codes.xml]]
> 2007-01-14 22:12:41,171 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Eagerly caching bean 'Informix' to allow for resolving potential circular
> references
> 2007-01-14 22:12:41,171 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating shared instance of singleton bean 'MS-SQL'
> 2007-01-14 22:12:41,171 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating instance of bean 'MS-SQL' with merged definition [Root bean: class
> [org.springframework.jdbc.support.SQLErrorCodes]; scope=singleton;
> abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0;
> dependencyCheck=0; factoryBeanName=null; factoryMethodName=null;
> initMethodName=null; destroyMethodName=null; defined in class path resource
> [org/springframework/jdbc/support/sql-error-codes.xml]]
> 2007-01-14 22:12:41,187 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Eagerly caching bean 'MS-SQL' to allow for resolving potential circular
> references
> 2007-01-14 22:12:41,187 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating shared instance of singleton bean 'MySQL'
> 2007-01-14 22:12:41,187 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating instance of bean 'MySQL' with merged definition [Root bean: class [
> org.springframework.jdbc.support.SQLErrorCodes]; scope=singleton;
> abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0;
> dependencyCheck=0; factoryBeanName=null; factoryMethodName=null;
> initMethodName=null; destroyMethodName=null; defined in class path resource
> [org/springframework/jdbc/support/sql-error-codes.xml]]
> 2007-01-14 22:12:41,187 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Eagerly caching bean 'MySQL' to allow for resolving potential circular
> references
> 2007-01-14 22:12:41,203 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating shared instance of singleton bean 'Oracle'
> 2007-01-14 22:12:41,203 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating instance of bean 'Oracle' with merged definition [Root bean: class
> [org.springframework.jdbc.support.SQLErrorCodes]; scope=singleton;
> abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0;
> dependencyCheck=0; factoryBeanName=null; factoryMethodName=null;
> initMethodName=null; destroyMethodName=null; defined in class path resource
> [org/springframework/jdbc/support/sql-error-codes.xml]]
> 2007-01-14 22:12:41,203 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Eagerly caching bean 'Oracle' to allow for resolving potential circular
> references
> 2007-01-14 22:12:41,203 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating shared instance of singleton bean 'PostgreSQL'
> 2007-01-14 22:12:41,203 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating instance of bean 'PostgreSQL' with merged definition [Root bean:
> class [org.springframework.jdbc.support.SQLErrorCodes]; scope=singleton;
> abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0;
> dependencyCheck=0; factoryBeanName=null; factoryMethodName=null;
> initMethodName=null; destroyMethodName=null; defined in class path resource
> [org/springframework/jdbc/support/sql-error-codes.xml]]
> 2007-01-14 22:12:41,218 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Eagerly caching bean 'PostgreSQL' to allow for resolving potential circular
> references
> 2007-01-14 22:12:41,218 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating shared instance of singleton bean 'Sybase'
> 2007-01-14 22:12:41,218 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Creating instance of bean 'Sybase' with merged definition [Root bean: class
> [org.springframework.jdbc.support.SQLErrorCodes]; scope=singleton;
> abstract=false; lazyInit=false; autowireCandidate=true; autowireMode=0;
> dependencyCheck=0; factoryBeanName=null; factoryMethodName=null;
> initMethodName=null; destroyMethodName=null; defined in class path resource
> [org/springframework/jdbc/support/sql-error-codes.xml]]
> 2007-01-14 22:12:41,218 DEBUG [
> org.springframework.beans.factory.support.DefaultListableBeanFactory] -
> Eagerly caching bean 'Sybase' to allow for resolving potential circular
> references
> 2007-01-14 22:12:41,234 INFO [
> org.springframework.jdbc.support.SQLErrorCodesFactory] - SQLErrorCodes
> loaded: [DB2, Derby, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL,
> Sybase]
> 2007-01-14 22:12:41,234 DEBUG [
> org.springframework.jdbc.support.SQLErrorCodesFactory] - Looking up
> default SQLErrorCodes for DataSource [
> org.tranql.connector.jdbc.DataSource@d5064b]
> 2007-01-14 22:12:41,250 DEBUG [
> org.springframework.jdbc.datasource.DataSourceUtils] - Fetching JDBC
> Connection from DataSource
> 2007-01-14 22:12:41,265 DEBUG [
> org.springframework.jdbc.datasource.DataSourceUtils] - Returning JDBC
> Connection to DataSource
> 2007-01-14 22:12:41,265 DEBUG [
> org.springframework.jdbc.support.SQLErrorCodesFactory] - Database product
> name cached for DataSource [org.tranql.connector.jdbc.DataSource@d5064b]:
> name is 'MySQL'
> 2007-01-14 22:12:41,265 DEBUG [
> org.springframework.jdbc.support.SQLErrorCodesFactory] - SQL error codes
> for 'MySQL' found
> 2007-01-14 22:12:41,265 DEBUG [
> org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator] -
> Unable to translate SQLException with Error code '0', will now try the
> fallback translator
> 2007-01-14 22:12:41,265 DEBUG [
> org.springframework.jdbc.datasource.DataSourceUtils] - Returning JDBC
> Connection to DataSource
> 2007-01-14 22:12:41,281 DEBUG [
> org.springframework.web.servlet.DispatcherServlet] - Cleared thread-bound
> request context: org.apache.catalina.connector.RequestFacade@e6f7a
> 2007-01-14 22:12:41,281 DEBUG [
> org.springframework.web.servlet.DispatcherServlet] - Could not complete
> request
> org.springframework.jdbc.UncategorizedSQLException: SqlMapClient
> operation; uncategorized SQLException for SQL []; SQL state [null]; error
> code [0];
> --- The error occurred in /org/kolor/cms/data/dao/ibatis/jcms-client.xml.
> --- The error occurred while applying a result map.
> --- Check the jcms-client.Article.
> --- Check the result mapping for the 'author' property.
> --- Cause: java.lang.NullPointerException; nested exception is
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in /org/kolor/cms/data/dao/ibatis/jcms-client.xml.
> --- The error occurred while applying a result map.
> --- Check the jcms-client.Article.
> --- Check the result mapping for the 'author' property.
> --- Cause: java.lang.NullPointerException
> Caused by:
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in /org/kolor/cms/data/dao/ibatis/jcms-client.xml.
> --- The error occurred while applying a result map.
> --- Check the jcms-client.Article.
> --- Check the result mapping for the 'author' property.
> --- Cause: java.lang.NullPointerException
>     at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback
> (GeneralStatement.java:188)
>     at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject
> (GeneralStatement.java:104)
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject
> (SqlMapExecutorDelegate.java:566)
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject
> (SqlMapExecutorDelegate.java:541)
>     at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(
> SqlMapSessionImpl.java:106)
>     at
> org.springframework.orm.ibatis.SqlMapClientTemplate$1.doInSqlMapClient(
> SqlMapClientTemplate.java:243)
>     at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(
> SqlMapClientTemplate.java:193)
>     at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(
> SqlMapClientTemplate.java:241)
>     at org.kolor.cms.data.dao.ibatis.IbatisClientDao.getArticle(
> IbatisClientDao.java:18)
>     at org.kolor.cms.controler.ShowItemController.handleRequestInternal(
> ShowItemController.java:54)
>     at
> org.springframework.web.servlet.mvc.AbstractController.handleRequest(
> AbstractController.java:153)
>     at
> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(
> SimpleControllerHandlerAdapter.java:45)
>     at org.springframework.web.servlet.DispatcherServlet.doDispatch(
> DispatcherServlet.java:820)
>     at org.springframework.web.servlet.DispatcherServlet.doService(
> DispatcherServlet.java:755)
>     at org.springframework.web.servlet.FrameworkServlet.processRequest(
> FrameworkServlet.java:396)
>     at org.springframework.web.servlet.FrameworkServlet.doGet(
> FrameworkServlet.java:350)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:252)
>     at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:173)
>     at org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:213)
>     at org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:178)
>     at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(
> DefaultSubjectValve.java:56)
>     at
> org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke
> (GeronimoStandardContext.java:342)
>     at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(
> GeronimoBeforeAfterValve.java:31)
>     at org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:126)
>     at org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:105)
>     at org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:107)
>     at org.apache.catalina.valves.AccessLogValve.invoke(
> AccessLogValve.java:541)
>     at org.apache.catalina.connector.CoyoteAdapter.service(
> CoyoteAdapter.java:148)
>     at org.apache.coyote.http11.Http11Processor.process(
> Http11Processor.java:869)
>     at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (Http11BaseProtocol.java:667)
>     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
> PoolTcpEndpoint.java:527)
>     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:80)
>     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
>     at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.NullPointerException
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction
> (SqlMapExecutorDelegate.java:782)
>     at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(
> SqlMapSessionImpl.java:176)
>     at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(
> SqlMapClientImpl.java:154)
>     at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransaction(
> SqlMapExecutorDelegate.java:883)
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject
> (SqlMapExecutorDelegate.java:573)
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject
> (SqlMapExecutorDelegate.java:541)
>     at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(
> SqlMapSessionImpl.java:106)
>     at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(
> SqlMapClientImpl.java:83)
>     at
> com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.getResult(
> ResultLoader.java:77)
>     at
> com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.loadResult(
> ResultLoader.java:59)
>     at
> com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getNestedSelectMappingValue
> (BasicResultMap.java:502)
>     at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getResults(
> BasicResultMap.java:340)
>     at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(
> SqlExecutor.java:381)
>     at
> com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(
> SqlExecutor.java:301)
>     at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(
> SqlExecutor.java:190)
>     at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery
> (GeneralStatement.java:205)
>     at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback
> (GeneralStatement.java:173)
>     ... 35 more
> 2007-01-14 22:12:41,296 DEBUG [
> org.springframework.web.context.support.XmlWebApplicationContext] -
> Publishing event in context [WebApplicationContext for namespace
> 'jkolorcms-servlet']: ServletRequestHandledEvent:
> url=[/jKolorCMS/article/1]; client=[127.0.0.1]; method=[GET];
> servlet=[jkolorcms]; session=[null]; user=[null]; time=[3562ms];
> status=[failed: org.springframework.jdbc.UncategorizedSQLException:
> SqlMapClient operation; uncategorized SQLException for SQL []; SQL state
> [null]; error code [0];
> --- The error occurred in /org/kolor/cms/data/dao/ibatis/jcms-client.xml.
> --- The error occurred while applying a result map.
> --- Check the jcms-client.Article.
> --- Check the result mapping for the 'author' property.
> --- Cause: java.lang.NullPointerException; nested exception is
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in /org/kolor/cms/data/dao/ibatis/jcms-client.xml.
> --- The error occurred while applying a result map.
> --- Check the jcms-client.Article.
> --- Check the result mapping for the 'author' property.
> --- Cause: java.lang.NullPointerException]
> 2007-01-14 22:12:41,296 ERROR [org.apache.catalina.core.ContainerBase.[Geronimo].[localhost].[/jKolorCMS].[jkolorcms]]
> - Servlet.service() for servlet jkolorcms threw exception
> com.ibatis.common.jdbc.exception.NestedSQLException:
> --- The error occurred in /org/kolor/cms/data/dao/ibatis/jcms-client.xml.
> --- The error occurred while applying a result map.
> --- Check the jcms-client.Article.
> --- Check the result mapping for the 'author' property.
> --- Cause: java.lang.NullPointerException
>     at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback
> (GeneralStatement.java:188)
>     at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject
> (GeneralStatement.java:104)
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject
> (SqlMapExecutorDelegate.java:566)
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject
> (SqlMapExecutorDelegate.java:541)
>     at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(
> SqlMapSessionImpl.java:106)
>     at
> org.springframework.orm.ibatis.SqlMapClientTemplate$1.doInSqlMapClient(
> SqlMapClientTemplate.java:243)
>     at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(
> SqlMapClientTemplate.java:193)
>     at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(
> SqlMapClientTemplate.java:241)
>     at org.kolor.cms.data.dao.ibatis.IbatisClientDao.getArticle(
> IbatisClientDao.java:18)
>     at org.kolor.cms.controler.ShowItemController.handleRequestInternal(
> ShowItemController.java:54)
>     at
> org.springframework.web.servlet.mvc.AbstractController.handleRequest(
> AbstractController.java:153)
>     at
> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(
> SimpleControllerHandlerAdapter.java:45)
>     at org.springframework.web.servlet.DispatcherServlet.doDispatch(
> DispatcherServlet.java:820)
>     at org.springframework.web.servlet.DispatcherServlet.doService(
> DispatcherServlet.java:755)
>     at org.springframework.web.servlet.FrameworkServlet.processRequest(
> FrameworkServlet.java:396)
>     at org.springframework.web.servlet.FrameworkServlet.doGet(
> FrameworkServlet.java:350)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:688)
>     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> ApplicationFilterChain.java:252)
>     at org.apache.catalina.core.ApplicationFilterChain.doFilter(
> ApplicationFilterChain.java:173)
>     at org.apache.catalina.core.StandardWrapperValve.invoke(
> StandardWrapperValve.java:213)
>     at org.apache.catalina.core.StandardContextValve.invoke(
> StandardContextValve.java:178)
>     at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(
> DefaultSubjectValve.java:56)
>     at
> org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke
> (GeronimoStandardContext.java:342)
>     at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(
> GeronimoBeforeAfterValve.java:31)
>     at org.apache.catalina.core.StandardHostValve.invoke(
> StandardHostValve.java:126)
>     at org.apache.catalina.valves.ErrorReportValve.invoke(
> ErrorReportValve.java:105)
>     at org.apache.catalina.core.StandardEngineValve.invoke(
> StandardEngineValve.java:107)
>     at org.apache.catalina.valves.AccessLogValve.invoke(
> AccessLogValve.java:541)
>     at org.apache.catalina.connector.CoyoteAdapter.service(
> CoyoteAdapter.java:148)
>     at org.apache.coyote.http11.Http11Processor.process(
> Http11Processor.java:869)
>     at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
> (Http11BaseProtocol.java:667)
>     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
> PoolTcpEndpoint.java:527)
>     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
> LeaderFollowerWorkerThread.java:80)
>     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
> ThreadPool.java:684)
>     at java.lang.Thread.run(Unknown Source)
> Caused by: java.lang.NullPointerException
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction
> (SqlMapExecutorDelegate.java:782)
>     at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(
> SqlMapSessionImpl.java:176)
>     at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(
> SqlMapClientImpl.java:154)
>     at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransaction(
> SqlMapExecutorDelegate.java:883)
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject
> (SqlMapExecutorDelegate.java:573)
>     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject
> (SqlMapExecutorDelegate.java:541)
>     at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(
> SqlMapSessionImpl.java:106)
>     at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForObject(
> SqlMapClientImpl.java:83)
>     at
> com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.getResult(
> ResultLoader.java:77)
>     at
> com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.loadResult(
> ResultLoader.java:59)
>     at
> com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getNestedSelectMappingValue
> (BasicResultMap.java:502)
>     at com.ibatis.sqlmap.engine.mapping.result.BasicResultMap.getResults(
> BasicResultMap.java:340)
>     at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleResults(
> SqlExecutor.java:381)
>     at
> com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(
> SqlExecutor.java:301)
>     at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(
> SqlExecutor.java:190)
>     at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery
> (GeneralStatement.java:205)
>     at
> com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback
> (GeneralStatement.java:173)
>     ... 35 more
>
>
>

Re: Complex Properties problem

Posted by Witold Bołt <ja...@houp.info>.
Goga, Murtaza napisał(a):
> If you are using Spring, you might want to check if you are supplying
> a valid 'dataSource' property to the SqlMapClientFactoryBean. I had
> seen similar behavior, and it turned out that the TransactionManager
> was not created for the SqlMapExecutorDelegate.  The second query
> attempts to use a null txManager and it cascades down to the error
> you are seeing.

Yeah! That's it. I didn't pass the dataSource to the 
SqlMapClientFactoryBean. Instead I've passed it to the DAO class - witch 
is also possible and works fine in _some_ situations.

Thanks for your help!!

Greetings,
-me.

-- 
--==--==----------------------
   Witold Bołt ::  ja@houp.info
gsm#660316053 :: www.houp.info

RE: Complex Properties problem

Posted by "Goga, Murtaza" <mu...@trisyngroup.com>.
If you are using Spring, you might want to check if you are supplying a valid 'dataSource' property to the SqlMapClientFactoryBean.  
I had seen similar behavior, and it turned out that the TransactionManager was not created for the SqlMapExecutorDelegate.  The second query attempts to use a null txManager and it cascades down to the error you are seeing.

-----Original Message-----
From: Witold Bołt [mailto:ja@houp.info] 
Sent: Sunday, January 14, 2007 4:35 PM
To: user-java@ibatis.apache.org
Subject: Complex Properties problem
Importance: Low

Hi!

I'm developing a simple Web app with Spring (2.0) and iBatis (2.2), and 
... got one strange problem with so called complex properties.

What I did was basically following the Developer guide (as on page 34, 
current stable version), and did:

<sqlMap namespace="foo">
     <resultMap id="User" class="foo.bar.User">
         <result property="id" column="id"  />
         <result property="login" column="login" />
     </resultMap>

     <resultMap id="Article" class="foo.bar.Article">
         <result property="id" column="id"  />
         <result property="author" column="user_id" select="getUser"/>
         <result property="title" column="title"  />
     </resultMap>
		
     <select id="getUser" parameterClass="int"  resultMap="User">
     	SELECT id,login FROM user WHERE id = #value#
     </select>

     <select id="getArticle" parameterClass="int" resultMap="Article">
     	SELECT id,user_id,title FROM object WHERE id = #value#
     </select>
</sqlMap>


User and Article classes are simple JavaBeans. Everything works without 
the select="getUser" in Article. I can get a selected User and Article. 
But I can not get them together. (I know that I could change this and do 
a select from two tables with some joins, but that is not the case - I 
want it the way it is.)

When the code is used as it's shown here, the first SQL statment is 
passed to the database (MySQL 5), and the second is not. Instead a Null 
Pointer Exception arise:

com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in /org/kolor/cms/data/dao/ibatis/jcms-client.xml.
--- The error occurred while applying a result map.
--- Check the jcms-client.Article.
--- Check the result mapping for the 'author' property.
--- Cause: java.lang.NullPointerException
	at 
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:188)
	at 
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForObject(GeneralStatement.java:104)
	at 
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:566)
	at 
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForObject(SqlMapExecutorDelegate.java:541)
	at 
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForObject(SqlMapSessionImpl.java:106)
	at 
org.springframework.orm.ibatis.SqlMapClientTemplate$1.doInSqlMapClient(SqlMapClientTemplate.java:243)
	at 
org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:193)
	at 
org.springframework.orm.ibatis.SqlMapClientTemplate.queryForObject(SqlMapClientTemplate.java:241)
	at 
org.kolor.cms.data.dao.ibatis.IbatisClientDao.getArticle(IbatisClientDao.java:18)
	at 
org.kolor.cms.controler.ShowItemController.handleRequestInternal(ShowItemController.java:54)
...

(full log info and stack trace in attachment).

I'm sure that database is working well. The JDBC data source comes from 
the server (Apache Geronimo) database pool (and it's invoked through 
JNDI). And as I said - I can invoke getUser(1) alone, and getArticle(1) 
when this 'complex property' is removed.

I've tried running in different modes with and without lazy init, 
enchencments modes and so on.

How you got any idea what is wrong?

If you need any more code I can send it here.

Greetings,
-me.

-- 
--==--==----------------------
   Witold Bołt ::  ja@houp.info
gsm#660316053 :: www.houp.info