18、报错:java.lang.ClassNotFoundException:
没有导出数据库所用的包或者版本不符合
19、 报错:严重: Exception sending contextinitialized event to listener instance of classorg.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined inServletContext resource [/WEB-INF/applicationContext.xml]: Error settingproperty values; nested exception isorg.springframework.beans.PropertyBatchUpdateException; nestedPropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'driverClassName' threw exception; nestedexception is org.springframework.jdbc.CannotGetJdbcConnectionException: Could not load JDBC driver class[oracle.jdbc.driver.OracleDriver]; nested exception is java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
Caused by:org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessException details (1) are:
原因:
20、报错:com.ibatis.common.jdbc.exception.NestedSQLException:
--- The erroroccurred while applying a parameter map.
--- Check theemergencyKPIspace.getQuerySysList-InlineParameterMap.
--- Check thestatement (query failed).
--- Cause: java.sql.SQLException: ORA-01861: 文字与格式字符串不匹配
原因:后台数据库日期语句不符合后台代码。例:
21、set方法中处理中文乱码:
1)publicvoid setPerg(String perg) {
try {
this.perg= java.net.URLDecoder.decode(perg,"UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
如果前台页面是用JSP写的,则前台写例:
var url = "AJAXServer?name=" +encodeURI(encodeURI($("#userName").val()));
2)publicvoid setTargetName(String targetName) {
try {
this.targetName =java.net.URLDecoder.decode(targetName,"UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
在前台EXTJS页面写:viewGrade : encodeURIComponent(viewGrade_ele.getValue()),其中viewGrade代码一个控件的ID,viewGrade_ele代表该控件的名称,一般在获值时用此函数。
22、报错:NoSuchMethodException
原因:struts.xml中配置出错
23、报错:java.lang.IndexOutOfBoundsException:
原因:下标越界
24、//去0操作
for(int i=0;i<listnews.size();i++){
HashMap<String,String> maps=listnews.get(i);
if(maps!=null){
boolean flag=false;
for (Map.Entry<String,String> entry : maps.entrySet()) {
if((entry.getValue()!=null&&!entry.getValue().equals(""))&&
(!(entry.getKey().trim().equals("TASKNAME")||entry.getKey().trim().equals("taskname")))){
if(!String.valueOf(Float.valueOf((entry.getValue().trim().replaceAl("%","")))).equals(String.valueOf(Float.valueOf("0")))){
flag=true;
break;
}
}
}
if(!flag){
listnews.remove(i);
i--;
}
}
}