[ https://issues.apache.org/jira/browse/IBATIS-464?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12709676#action_12709676 ]
LindsayW edited comment on IBATIS-464 at 5/15/09 2:51 AM: ---------------------------------------------------------- Thanks and apologize for having left out the log. Log: com.mobile.scms.servicechange.util.ServiceChangeException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; --- The error occurred in /SqlMap.xml. --- The error occurred while applying a result map. --- Check the SCMS.ReceiveItemListResultMap. --- Check the result mapping for the 'scmsChngWoVoList' property. --- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in /SqlMap.xml. --- The error occurred while applying a result map. --- Check the SCMS.ReceiveItemListResultMap. --- Check the result mapping for the 'scmsChngWoVoList' property. --- Cause: java.lang.NullPointerException at com.mobile.scms.servicechange.service.impl.ReceiveServiceImpl.getReceiveItemList(ReceiveServiceImpl.java:142) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176) at $Proxy183.getReceiveItemList(Unknown Source) at com.mobile.scms.servicechange.main.action.MultipleModificationAction.getChrgTypeGExpenseListByReceiveId(MultipleModificationAction.java:2765) at com.mobile.scms.servicechange.main.action.MultipleModificationAction.submit(MultipleModificationAction.java:638) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) at com.mobile.scms.servicechange.servlet.MyActionServlet.process(MyActionServlet.java:59) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at com.mobile.scms.sso.web.AuthenticationFilter.doFilter(Unknown Source) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:334) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) at com.mobile.scms.servicechange.servlet.MyActionServlet.process(MyActionServlet.java:59) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at com.mobile.scms.sso.web.AuthenticationFilter.doFilter(Unknown Source) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183) Caused by: org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; --- The error occurred in /SCMS_SqlMap.xml. --- The error occurred while applying a result map. --- Check the SCMS.ReceiveItemListResultMap. --- Check the result mapping for the 'scmsChngWoVoList' property. --- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in /SCMS_SqlMap.xml. --- The error occurred while applying a result map. --- Check the SCMS.ReceiveItemListResultMap. --- Check the result mapping for the 'scmsChngWoVoList' property. --- Cause: java.lang.NullPointerException at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:96) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:257) at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:184) at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:204) at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:243) at com.mobile.scms.servicechange.dao.scms.ScmsDAOImpl.queryForList(ScmsDAOImpl.java:226) at com.mobile.scms.servicechange.dao.scms.ScmsDAOImpl.getReceiveItemList(ScmsDAOImpl.java:459) at com.mobile.scms.servicechange.service.impl.ReceiveServiceImpl.getReceiveItemList(ReceiveServiceImpl.java:121) ... 54 more was (Author: lindsay2007): Thanks and apologize for having left out the log. should I set sqlMapClient1 for datasource1 , sqlMapClient2 for datasource2 , and so on? Thank you Log: com.mobile.scms.servicechange.util.ServiceChangeException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; --- The error occurred in /SqlMap.xml. --- The error occurred while applying a result map. --- Check the SCMS.ReceiveItemListResultMap. --- Check the result mapping for the 'scmsChngWoVoList' property. --- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in /SqlMap.xml. --- The error occurred while applying a result map. --- Check the SCMS.ReceiveItemListResultMap. --- Check the result mapping for the 'scmsChngWoVoList' property. --- Cause: java.lang.NullPointerException at com.mobile.scms.servicechange.service.impl.ReceiveServiceImpl.getReceiveItemList(ReceiveServiceImpl.java:142) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176) at $Proxy183.getReceiveItemList(Unknown Source) at com.mobile.scms.servicechange.main.action.MultipleModificationAction.getChrgTypeGExpenseListByReceiveId(MultipleModificationAction.java:2765) at com.mobile.scms.servicechange.main.action.MultipleModificationAction.submit(MultipleModificationAction.java:638) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274) at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194) at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) at com.mobile.scms.servicechange.servlet.MyActionServlet.process(MyActionServlet.java:59) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at com.mobile.scms.sso.web.AuthenticationFilter.doFilter(Unknown Source) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:334) at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1063) at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:386) at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229) at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) at com.mobile.scms.servicechange.servlet.MyActionServlet.process(MyActionServlet.java:59) at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432) at javax.servlet.http.HttpServlet.service(HttpServlet.java:760) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1077) at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:465) at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at com.mobile.scms.sso.web.AuthenticationFilter.doFilter(Unknown Source) at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:7053) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3902) at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2773) at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224) at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183) Caused by: org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; --- The error occurred in /SCMS_SqlMap.xml. --- The error occurred while applying a result map. --- Check the SCMS.ReceiveItemListResultMap. --- Check the result mapping for the 'scmsChngWoVoList' property. --- Cause: java.lang.NullPointerException; nested exception is com.ibatis.common.jdbc.exception.NestedSQLException: --- The error occurred in /SCMS_SqlMap.xml. --- The error occurred while applying a result map. --- Check the SCMS.ReceiveItemListResultMap. --- Check the result mapping for the 'scmsChngWoVoList' property. --- Cause: java.lang.NullPointerException at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:96) at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:257) at org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:184) at org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:204) at org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:243) at com.mobile.scms.servicechange.dao.scms.ScmsDAOImpl.queryForList(ScmsDAOImpl.java:226) at com.mobile.scms.servicechange.dao.scms.ScmsDAOImpl.getReceiveItemList(ScmsDAOImpl.java:459) at com.mobile.scms.servicechange.service.impl.ReceiveServiceImpl.getReceiveItemList(ReceiveServiceImpl.java:121) ... 54 more > iBatis throws a NPE when performing a sub-select in a resultMap. > ---------------------------------------------------------------- > > Key: IBATIS-464 > URL: https://issues.apache.org/jira/browse/IBATIS-464 > Project: iBatis for Java > Issue Type: Bug > Components: SQL Maps > Affects Versions: 2.2.0, 2.3.0 > Environment: WinXP, Java 1.5, originally discovered when moving to > Spring 2.0.6 (spring-ibatis depends on ibatis 2.3.0) > Reporter: Mitchell L. Waters III > Priority: Blocker > > iBatis throws a NullPointerException when performing a sub-select in a > resultMap. > For some foo record in the DB, there are a variable number of comments. > iBatis allows the user to return an object that contains the information from > the foo table and return the list/array/collection of related items (comments > in this example) from a separate table that relate to the foo record, using a > resultMap like what is listed below. > <resultMap class="test.FooDto" id="fooResult"> > <result property="foo" column="foo" /> > <result property="bar" column="bar" /> > <result property="comments" select="getCommentList" column="{foo=foo}" > /> > </resultMap> > This works without a hitch in iBatis 2.1.7. However when you attempt to do > the same in iBatis 2.2.0 or 2.3.0, you get a NPE (stack trace to follow). > Digging in a bit, it seems that the session returned to do the SessionScope > that is returned for the sub-select is different than that used to run the > original select (different than the behavior in 2.1.7) and that the > transaction/transaction manager for the new SessionScope object is null. It > ends up throwing when it attempts to start a new transaction for the > sub-select. > I originally saw this problem when updating my application to use Spring > 2.0.6 (which uses iBatis 2.3.0 as a dependency of the spring-ibatis module), > but upon further investigation I was able to isolate it to being in the > ibatis-sqlmap module. I've since set up our project to use Spring 2.0.6 with > an older version (2.1.7) of iBatis, and this works fine. While testing the > problem, we tested iBatis 2.1.7, 2.2.0 and 2.3.0 with both Spring 1.2.9 and > 2.0.6, and we only experience the problem with iBatis 2.2.0 and 2.3.0. > Hopefully, this will be fixed but until then we will be sticking with 2.1.7. > Thank you, > Mitch Waters > org.springframework.jdbc.UncategorizedSQLException: SqlMapClient operation; > uncategorized SQLException for SQL []; SQL state [null]; error code [0]; > --- The error occurred in test.xml. > --- The error occurred while applying a result map. > --- Check the complexResult. > --- Check the result mapping for the 'roles' property. > --- Cause: java.lang.NullPointerException; nested exception is > com.ibatis.common.jdbc.exception.NestedSQLException: > --- The error occurred in test.xml. > --- The error occurred while applying a result map. > --- Check the complexResult. > --- Check the result mapping for the 'roles' property. > --- Cause: java.lang.NullPointerException > Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: > --- The error occurred in test.xml. > --- The error occurred while applying a result map. > --- Check the complexResult. > --- Check the result mapping for the 'roles' 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.executeQueryForList(GeneralStatement.java:123) > at > com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:615) > at > com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589) > at > com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118) > at > org.springframework.orm.ibatis.SqlMapClientTemplate$3.doInSqlMapClient(SqlMapClientTemplate.java:269) > at > org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:194) > at > org.springframework.orm.ibatis.SqlMapClientTemplate.executeWithListResult(SqlMapClientTemplate.java:220) > at > org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:267) > at > org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:261) > at dbtest.UserDao.queryForList(UserDao.java:23) > at dbtest.UserDao.complexQuery(UserDao.java:14) > at dbtest.UserDaoTest.testGetComplexUserList(UserDaoTest.java:43) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:585) > at junit.framework.TestCase.runTest(TestCase.java:164) > at junit.framework.TestCase.runBare(TestCase.java:130) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:120) > at junit.framework.TestSuite.runTest(TestSuite.java:230) > at junit.framework.TestSuite.run(TestSuite.java:225) > at > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) > at > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) > at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) > 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.queryForList(SqlMapExecutorDelegate.java:622) > at > com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589) > at > com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118) > at > com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:95) > at > com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader.getResult(ResultLoader.java:72) > 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) > ... 30 more -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.