使用SpringSide1.0,环境win2003+mysql5+tomcat5,运行一天左右,就出现问题,一定要重新启动tomcat才能够解决,出错代码如下:
2007-04-24 08:06:59,109 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: 0, SQLState: 07001>
2007-04-24 08:06:59,109 ERROR [org.hibernate.util.JDBCExceptionReporter] - <No value specified for parameter 3>
2007-04-24 08:06:59,109 ERROR [/listcatalog.do] - <Hibernate operation: could not execute query; bad SQL grammar [select user0_.ID as ID9_, user0_.LOGINID as LOGINID9_, user0_.PASSWD as PASSWD9_, user0_.NAME as NAME9_, user0_.EMAIL as EMAIL9_, user0_.REGION as REGION9_, user0_.STATUS as STATUS9_, user0_.DESCN as DESCN9_ from SS_USERS user0_ where user0_.LOGINID=? and user0_.PASSWD=?]; nested exception is java.sql.SQLException: No value specified for parameter 3>
org.springframework.jdbc.BadSqlGrammarException: Hibernate operation: could not execute query; bad SQL grammar [select user0_.ID as ID9_, user0_.LOGINID as LOGINID9_, user0_.PASSWD as PASSWD9_, user0_.NAME as NAME9_, user0_.EMAIL as EMAIL9_, user0_.REGION as REGION9_, user0_.STATUS as STATUS9_, user0_.DESCN as DESCN9_ from SS_USERS user0_ where user0_.LOGINID=? and user0_.PASSWD=?]; nested exception is java.sql.SQLException: No value specified for parameter 3
Caused by:
java.sql.SQLException: No value specified for parameter 3
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:1530)
at com.mysql.jdbc.PreparedStatement.fillSendPacket(PreparedStatement.java:1478)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1199)
at sun.reflect.GeneratedMethodAccessor257.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.logicalcobwebs.proxool.ProxyStatement.invoke(ProxyStatement.java:100)
at org.logicalcobwebs.proxool.ProxyStatement.intercept(ProxyStatement.java:57)
at $java.sql.PreparedStatement$$EnhancerByProxool$$bf09aef6.executeQuery(<generated>)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1669)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2145)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2029)
at org.hibernate.loader.Loader.list(Loader.java:2024)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:308)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:153)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1129)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.springframework.orm.hibernate3.HibernateTemplate$29.doInHibernate(HibernateTemplate.java:837)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:366)
at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:828)
at org.springside.bookstore.plugins.security.dao.UserDao.getUserByLoginidAndPasswd(UserDao.java:41)
at org.springside.bookstore.plugins.security.service.logic.UserManager.getUserByLoginidAndPasswd(UserManager.java:61)
at org.springside.bookstore.plugins.security.service.logic.UserManager$$FastClassByCGLIB$$a735a36f.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:709)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:66)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:647)
atorg.springside.bookstore.plugins.security.service.logic.UserManager$$EnhancerByCGLIB$$90fa70af.getUserByLoginidAndPasswd(<generated>)
后来我用了proxool连接池,也不行;不知道是不是我的连接池的参数配置有问题,请各位高手指教一下
另:proxool我是这样配置的 applicationContext-db.xml上的dataSource改一下
<bean id="dataSource" class="org.logicalcobwebs.proxool.ProxoolDataSource" destroy-method="close">
<property name="driver">
<value>${jdbc.driverClassName}</value>
</property>
<property name="driverUrl">
<value>${jdbc.url}</value>
</property>
<property name="user">
<value>${jdbc.username}</value>
</property>
<property name="password">
<value>${jdbc.password}</value>
</property>
<property name="alias">
<value>newvideopool</value>
</property>
<property name="houseKeepingTestSql">
<value>select CURRENT_DATE from dual</value>
</property>
<property name="testBeforeUse">
<value>false</value>
</property>
<property name="maximumActiveTime">
<value>1000</value>
</property>
<property name="maximumConnectionCount">
<value>100</value>
</property>
<property name="minimumConnectionCount">
<value>5</value>
</property>
<property name="delegateProperties">
<value>user=${jdbc.username},password=${jdbc.password}</value>
</property>
</bean>
--转自