2013年12月7日星期六

Short key for Mplayer to download subtitles

Just Ctrl+W, no more mouse click, select and click again!

2009年3月6日星期五

How to fix "The column name xxx was not found in this ResultSet" error

JDK 1.6.0_07, Postgres 8.3 Windows 2000 SP4.

Update postgres jdbc driver from "postgresql-8.1-405.jdbc3.jar"
to "postgresql-8.3-604.jdbc4.jar", then this problem seems go away.
The new version is for JDK 1.6 and above, so we should use this other than other version.
===============================
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select a.* from t_user a where a.email = ?]; nested exception is org.postgresql.util.PSQLException: The column name last_login_ip was not found in this ResultSet.
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:286)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
com.mycom.webapp.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:42)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
com.mycom.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:107)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)


root cause

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select a.* from t_user a where a.email = ?]; nested exception is org.postgresql.util.PSQLException: The column name last_login_ip was not found in this ResultSet.
org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:107)
org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:276)
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:554)
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:588)
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:617)
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:625)
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:657)
com.myapp.db.dao.UserDao.getUserByEmail(UserDao.java:29)
com.mycom.myapp.user.manager.SiteUserManager.getUserByEmail(SiteUserManager.java:729)
com.mycom.myapp.user.manager.SiteUserManager.loginSiteUser(SiteUserManager.java:759)
com.mycom.myapp.user.manager.SiteUserManager$$FastClassByCGLIB$$30a9b650.invoke()
net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:694)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:629)
com.mycom.myapp.user.manager.SiteUserManager$$EnhancerByCGLIB$$ad0fc739.loginSiteUser()
com.mycom.myapp.webapp.action.IMAction.login(IMAction.java:94)
com.mycom.myapp.webapp.action.IMAction.execute(IMAction.java:48)
org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
com.mycom.webapp.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:42)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
com.mycom.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:107)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)


root cause

org.postgresql.util.PSQLException: The column name last_login_ip was not found in this ResultSet.
org.postgresql.jdbc2.AbstractJdbc2ResultSet.findColumn(AbstractJdbc2ResultSet.java:2365)
org.postgresql.jdbc2.AbstractJdbc2ResultSet.getString(AbstractJdbc2ResultSet.java:2187)
org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:225)
com.mycom.db.helper.annota.AnnotaEntityOper.getObjFromRs(AnnotaEntityOper.java:270)
com.mycom.db.helper.annota.AnnotaEntityOper.createObjByRs(AnnotaEntityOper.java:121)
com.mycom.db.dao.CommDbOperTool$CustomRowMap.mapRow(CommDbOperTool.java:71)
org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:92)
org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:600)
org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:538)
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:588)
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:617)
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:625)
org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:657)
com.myapp.db.dao.UserDao.getUserByEmail(UserDao.java:29)
com.mycom.myapp.user.manager.SiteUserManager.getUserByEmail(SiteUserManager.java:729)
com.mycom.myapp.user.manager.SiteUserManager.loginSiteUser(SiteUserManager.java:759)
com.mycom.myapp.user.manager.SiteUserManager$$FastClassByCGLIB$$30a9b650.invoke()
net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:694)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:629)
com.mycom.myapp.user.manager.SiteUserManager$$EnhancerByCGLIB$$ad0fc739.loginSiteUser()
com.mycom.myapp.webapp.action.IMAction.login(IMAction.java:94)
com.mycom.myapp.webapp.action.IMAction.execute(IMAction.java:48)
org.apache.struts.chain.commands.servlet.ExecuteAction.execute(ExecuteAction.java:58)
org.apache.struts.chain.commands.AbstractExecuteAction.execute(AbstractExecuteAction.java:67)
org.apache.struts.chain.commands.ActionCommandBase.execute(ActionCommandBase.java:51)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.commons.chain.generic.LookupCommand.execute(LookupCommand.java:304)
org.apache.commons.chain.impl.ChainBase.execute(ChainBase.java:190)
org.apache.struts.chain.ComposableRequestProcessor.process(ComposableRequestProcessor.java:283)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
com.mycom.webapp.filter.GZIPFilter.doFilterInternal(GZIPFilter.java:42)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
com.mycom.webapp.filter.LocaleFilter.doFilterInternal(LocaleFilter.java:107)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)


note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.


--------------------------------------------------------------------------------

Apache Tomcat/6.0.18

2009年2月11日星期三

Javascript including issue.

Although I did this profession for years, I wrote quite bad codes today.

<script language="javascript" src="jquery-1.2.6.js" type="text/javascript"></script>

not:

<script language="javascript" src="jquery-1.2.6.js" type="text/javascript"/>

otherwise there are lots of boring errors, such browser cannot find your javascript functions(xxx is not defined).

2009年2月4日星期三

html height problem in ie7

css:
html{height:90%;}

this will limit page's height to screen height in ie7(internet explorer 7), instead of expected expanding page height to screen height..

2008年12月28日星期日

run groovy the first time

java.lang.SecurityException: Prohibited package name: java.lang


remove ***\rt.jar from "classpath" and then groovy(.bat) runs well.

2008年12月19日星期五

evil 163.com

it hides the auditing note of user's comments.

Bitch and cheater.

2008年12月18日星期四

The column name xxx was not found in this ResultSet.

org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [select * from t_service_transaction where id = ?]; nested exception is org.postgresql.util.PSQLException: The column name sp_id was not found in this ResultSet.
    org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:107)
    org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:276)
    org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:554)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:588)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:617)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:625)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:657)


sp_id is absolutely not a field of table `t_service_transaction`,
and this exception occurred many times with different table names but same field name.

restart postgres sql server, and evrything goes fine.

@see:
http://archives.postgresql.org/pgsql-jdbc/2005-06/msg00086.php