mavisakal
Sep 9th, 2004, 07:10 AM
Hi everybody,
My configuration:
- 1 datasource : Oracle 9i - (a table named User exists)
- using Websphere 5.1 as application server
- using spring+hibernate
My datasource definition in applicationContext.xml is like this:
<bean id="OracleDataSourceJNDI" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>jdbc/OraDS</value>
</property>
</bean>
I can insert my first record in User table appropriately, but when I
try to insert my second record, I get the following exception:
[09.09.2004 14:51:16:641 EEST] 1336424 RequestProces W org.apache.struts.action.RequestProcessor Unhandled Exception thrown: class java.lang.NullPointerException
[09.09.2004 14:51:17:094 EEST] 1336424 WebGroup E SRVE0026E: [Servlet Error]-[]: java.lang.NullPointerException
at oracle.jdbc.dbaccess.DBData.clearItem(DBData.java: 431)
at oracle.jdbc.dbaccess.DBDataSetImpl.clearItem(DBDat aSetImpl.java:3528)
at oracle.jdbc.driver.OraclePreparedStatement.clearPa rameters(OraclePreparedStatement.java:3401)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.resetSt atement(WSJdbcConnection.java:1762)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepare Statement(WSJdbcConnection.java:1458)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepare Statement(WSJdbcConnection.java:1424)
at net.sf.hibernate.impl.BatcherImpl.getPreparedState ment(BatcherImpl.java:257)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement (BatcherImpl.java:61)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement (BatcherImpl.java:56)
at net.sf.hibernate.impl.BatcherImpl.prepareBatchStat ement(BatcherImpl.java:109)
at net.sf.hibernate.persister.EntityPersister.insert( EntityPersister.java:460)
at net.sf.hibernate.persister.EntityPersister.insert( EntityPersister.java:442)
at net.sf.hibernate.impl.ScheduledInsertion.execute(S cheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(Sessi onImpl.java:2418)
at net.sf.hibernate.impl.SessionImpl.execute(SessionI mpl.java:2371)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImp l.java:2240)
at net.sf.hibernate.transaction.JDBCTransaction.commi t(JDBCTransaction.java:61)
at org.springframework.orm.hibernate.HibernateTransac tionManager.doCommit(HibernateTransactionManager.j ava:460)
at org.springframework.transaction.support.AbstractPl atformTransactionManager.commit(AbstractPlatformTr ansactionManager.java:373)
at org.springframework.transaction.interceptor.Transa ctionAspectSupport.doCommitTransactionAfterReturni ng(TransactionAspectSupport.java:241)
at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:66)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :138)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:152)
at $Proxy0.saveUser(Unknown Source)
at com.elikasu.springtemplate.web.user.UserAction.sav e(UserAction.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:41)
at java.lang.reflect.Method.invoke(Method.java:386)
at org.apache.struts.actions.DispatchAction.dispatchM ethod(DispatchAction.java:280)
at org.apache.struts.actions.DispatchAction.execute(D ispatchAction.java:216)
at org.springframework.web.struts.DelegatingActionPro xy.execute(DelegatingActionProxy.java:104)
at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInsta nce.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.s ervice(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.se rvice(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletRefere nceState.dispatch(ValidServletReferenceState.java: 42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceRef erence.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:76)
at com.opensymphony.module.sitemesh.filter.PageFilter .parsePage(PageFilter.java:142)
at com.opensymphony.module.sitemesh.filter.PageFilter .doFilter(PageFilter.java:58)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapp er.doFilter(FilterInstanceWrapper.java:132)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:71)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.handleWebAppDispatch(WebAppRequestDispatcher. java:974)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.dispatch(WebAppRequestDispatcher.java:564)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForwar d(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleIn vocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInv ocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.Cacheable InvocationContext.invoke(CacheableInvocationContex t.java:116)
at com.ibm.ws.webcontainer.srp.ServletRequestProcesso r.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDis patcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handle Request(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleReques t(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection. java:443)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:672)
When I started to seek the problem source, I found Statement cache size:
property with a value 10 in Websphere data source
configuration. I changed the value to 0, and the problem solved. I did't get the exception above.
We have been using Statement cache size: property set to a value greater than 0 since we started using spring+hibernate.
So what's with the 'statement cache size'? Any idea?
Thanks
[/b]
My configuration:
- 1 datasource : Oracle 9i - (a table named User exists)
- using Websphere 5.1 as application server
- using spring+hibernate
My datasource definition in applicationContext.xml is like this:
<bean id="OracleDataSourceJNDI" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>jdbc/OraDS</value>
</property>
</bean>
I can insert my first record in User table appropriately, but when I
try to insert my second record, I get the following exception:
[09.09.2004 14:51:16:641 EEST] 1336424 RequestProces W org.apache.struts.action.RequestProcessor Unhandled Exception thrown: class java.lang.NullPointerException
[09.09.2004 14:51:17:094 EEST] 1336424 WebGroup E SRVE0026E: [Servlet Error]-[]: java.lang.NullPointerException
at oracle.jdbc.dbaccess.DBData.clearItem(DBData.java: 431)
at oracle.jdbc.dbaccess.DBDataSetImpl.clearItem(DBDat aSetImpl.java:3528)
at oracle.jdbc.driver.OraclePreparedStatement.clearPa rameters(OraclePreparedStatement.java:3401)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.resetSt atement(WSJdbcConnection.java:1762)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepare Statement(WSJdbcConnection.java:1458)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepare Statement(WSJdbcConnection.java:1424)
at net.sf.hibernate.impl.BatcherImpl.getPreparedState ment(BatcherImpl.java:257)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement (BatcherImpl.java:61)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement (BatcherImpl.java:56)
at net.sf.hibernate.impl.BatcherImpl.prepareBatchStat ement(BatcherImpl.java:109)
at net.sf.hibernate.persister.EntityPersister.insert( EntityPersister.java:460)
at net.sf.hibernate.persister.EntityPersister.insert( EntityPersister.java:442)
at net.sf.hibernate.impl.ScheduledInsertion.execute(S cheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(Sessi onImpl.java:2418)
at net.sf.hibernate.impl.SessionImpl.execute(SessionI mpl.java:2371)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImp l.java:2240)
at net.sf.hibernate.transaction.JDBCTransaction.commi t(JDBCTransaction.java:61)
at org.springframework.orm.hibernate.HibernateTransac tionManager.doCommit(HibernateTransactionManager.j ava:460)
at org.springframework.transaction.support.AbstractPl atformTransactionManager.commit(AbstractPlatformTr ansactionManager.java:373)
at org.springframework.transaction.interceptor.Transa ctionAspectSupport.doCommitTransactionAfterReturni ng(TransactionAspectSupport.java:241)
at org.springframework.transaction.interceptor.Transa ctionInterceptor.invoke(TransactionInterceptor.jav a:66)
at org.springframework.aop.framework.ReflectiveMethod Invocation.proceed(ReflectiveMethodInvocation.java :138)
at org.springframework.aop.framework.JdkDynamicAopPro xy.invoke(JdkDynamicAopProxy.java:152)
at $Proxy0.saveUser(Unknown Source)
at com.elikasu.springtemplate.web.user.UserAction.sav e(UserAction.java:106)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:41)
at java.lang.reflect.Method.invoke(Method.java:386)
at org.apache.struts.actions.DispatchAction.dispatchM ethod(DispatchAction.java:280)
at org.apache.struts.actions.DispatchAction.execute(D ispatchAction.java:216)
at org.springframework.web.struts.DelegatingActionPro xy.execute(DelegatingActionProxy.java:104)
at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:484)
at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
at com.ibm.ws.webcontainer.servlet.StrictServletInsta nce.doService(StrictServletInstance.java:110)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet._service(StrictLifecycleServlet.java:174)
at com.ibm.ws.webcontainer.servlet.IdleServletState.s ervice(StrictLifecycleServlet.java:313)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleSer vlet.service(StrictLifecycleServlet.java:116)
at com.ibm.ws.webcontainer.servlet.ServletInstance.se rvice(ServletInstance.java:283)
at com.ibm.ws.webcontainer.servlet.ValidServletRefere nceState.dispatch(ValidServletReferenceState.java: 42)
at com.ibm.ws.webcontainer.servlet.ServletInstanceRef erence.dispatch(ServletInstanceReference.java:40)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:76)
at com.opensymphony.module.sitemesh.filter.PageFilter .parsePage(PageFilter.java:142)
at com.opensymphony.module.sitemesh.filter.PageFilter .doFilter(PageFilter.java:58)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapp er.doFilter(FilterInstanceWrapper.java:132)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.d oFilter(WebAppFilterChain.java:71)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.handleWebAppDispatch(WebAppRequestDispatcher. java:974)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.dispatch(WebAppRequestDispatcher.java:564)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispat cher.forward(WebAppRequestDispatcher.java:200)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForwar d(WebAppInvoker.java:119)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleIn vocationHook(WebAppInvoker.java:276)
at com.ibm.ws.webcontainer.cache.invocation.CachedInv ocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.cache.invocation.Cacheable InvocationContext.invoke(CacheableInvocationContex t.java:116)
at com.ibm.ws.webcontainer.srp.ServletRequestProcesso r.dispatchByURI(ServletRequestProcessor.java:186)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDis patcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handle Request(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleReques t(HttpConnection.java:618)
at com.ibm.ws.http.HttpConnection.run(HttpConnection. java:443)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.j ava:672)
When I started to seek the problem source, I found Statement cache size:
property with a value 10 in Websphere data source
configuration. I changed the value to 0, and the problem solved. I did't get the exception above.
We have been using Statement cache size: property set to a value greater than 0 since we started using spring+hibernate.
So what's with the 'statement cache size'? Any idea?
Thanks
[/b]