java 物体移动不了总结_java开发遇到的问题总结(二)

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:

PropertyAccessException1:org.springframework.beans.MethodInvocationException: Property ‘driverClassName‘ threw exception; nestedexception isorg.springframework.jdbc.CannotGetJdbcConnectionException: Could not load JDBC driver class[oracle.jdbc.driver.OracleDriver]; nested exception isjava.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

Caused by:org.springframework.beans.PropertyBatchUpdateException; nestedPropertyAccessExceptiondetails (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)publicvoidsetPerg(String perg) {

try{

this.perg= java.net.URLDecoder.decode(perg,"UTF-8");

}catch(UnsupportedEncodingException e) {

e.printStackTrace();

}

}

如果前台页面是用JSP写的,则前台写例:

varurl ="AJAXServer?name="+encodeURI(encodeURI($("#userName").val()));

2)publicvoidsetTargetName(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(inti=0;i

HashMap maps=listnews.get(i);

if(maps!=null){

booleanflag=false;

for(Map.Entry 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--;

}

}

}

原文:http://haoxiaoli.blog.51cto.com/8691383/1702181

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值