sxnx-sms山西农信错误信息+处理方法

  1. 错误1:

java.lang.NullPointerException

at com.nantian.sms.service.CoreOnLineTransactionService.findCoreTransactions(CoreOnLineTransactionService.java:128)

at com.nantian.sms.service.CoreOnLineTransactionService.getCoreRealtimeData(CoreOnLineTransactionService.java:72)

报错位置代码:Long selelct=(Long) selectRepeatNum.get("dictionaryVaule");//字典表中的唯一序列号   //???如果字典中没有dictonaryValue,会报空指针异常

解决方法:暂时为数据库s_dictonary中加入数据acctOnlyFlag,202001131510890

  1. 错误2:

java.lang.ClassCastException: com.nantian.sms.dao.model.Dictionary cannot be cast to java.util.Map

at com.sun.proxy.$Proxy105.selectDictionaryVaule(Unknown Source)

at com.nantian.sms.service.CoreOnLineTransactionService.findCoreTransactions(CoreOnLineTransactionService.java:127)

at com.nantian.sms.service.CoreOnLineTransactionService.getCoreRealtimeData(CoreOnLineTransactionService.java:72)

错误位置:

Map  selectRepeatNum=coreOnLineTransactionMapper.selectDictionaryVaule();

解决方法:

<select id="selectDictionaryVaule" resultType="map" >

select dictionaryVaule from s_dictionary where dictionaryKey="acctOnlyFlag"

</select>
3.错误3;

java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Long

at com.nantian.sms.service.CoreOnLineTransactionService.findCoreTransactions(CoreOnLineTransactionService.java:129)

at com.nantian.sms.service.CoreOnLineTransactionService.getCoreRealtimeData(CoreOnLineTransactionService.java:73)

错误位置:

Long selelct=(Long) selectRepeatNum.get("dictionaryVaule");

解决方法:

Long selelct=Long.parseLong((String) selectRepeatNum.get("dictionaryVaule")) ;
4.错误4:

java.lang.IllegalArgumentException: Cannot format given Object as a Date

at java.text.DateFormat.format(DateFormat.java:310)

at java.text.Format.format(Format.java:157)

at com.nantian.sms.service.CoreOnLineTransactionService.noDuplicateRecord(CoreOnLineTransactionService.java:175)

at com.nantian.sms.service.CoreOnLineTransactionService.findCoreTransactions(CoreOnLineTransactionService.java:134)

at com.nantian.sms.service.CoreOnLineTransactionService.getCoreRealtimeData(CoreOnLineTransactionService.java:73)

错误位置:

String  transTime=coreDataRealtime.getS21TXTM().toString();

String customizeTime = "HH:mm:ss";

SimpleDateFormat sdf2 = new SimpleDateFormat(customizeTime);

String customizeTimeFormat=sdf2.format(transTime);

解决方法:

String customizeTimeFormat=sdf2.parse(transTime).toString();(这一步实际是先解析成日期,再转换成字符串)

  1. 错误5:

java.lang.StringIndexOutOfBoundsException: String index out of range: -4

at java.lang.String.substring(String.java:1960)

at com.nantian.sms.service.CoreOnLineTransactionService.noDuplicateRecord(CoreOnLineTransactionService.java:196)

at com.nantian.sms.service.CoreOnLineTransactionService.findCoreTransactions(CoreOnLineTransactionService.java:134)

at com.nantian.sms.service.CoreOnLineTransactionService.getCoreRealtimeData(CoreOnLineTransactionService.java:73)

错误原因:截取空串造成的
if(cardNumber!=null) {

//如果卡号不为空

cardOrAccount=cardNumber;

System.out.println("cardOrAccount卡号:"+cardOrAccount);

String cutAccount=cardOrAccount.substring(cardOrAccount.length()- 4);//截取账号或卡号后四位

allParas.put("cutAccount",cutAccount);//账号或卡号后四位

allParas.put("cardOrAccount", cardOrAccount);

解决方案:增加判断条件

if(cardNumber!=null&&cardNumber.length()!=0)

原理解释:

判断一个字符串是否为空,首先就要确保他不是null,然后再判断他的长度。

String str = xxx;

   if(str != null && str.length() != 0) { }

2020-1-25

  1. 错误1:

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘cardOrAccount‘ not found. Available parameters are [cardNum, param1]

at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:79)

at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:447)

at com.sun.proxy.$Proxy102.selectOne(Unknown Source)

at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:167)

at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)

at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)

at com.sun.proxy.$Proxy105.selectSignMsg(Unknown Source)

at com.nantian.sms.service.CoreOnLineTransactionService.querySignMsg(CoreOnLineTransactionService.java:442)

at com.nantian.sms.service.CoreOnLineTransactionService.dealCoreData(CoreOnLineTransactionService.java:247)

错误原因:

Map selectSignMsg(@Param("cardNum")String cardOrAccount);

原理解释:

采用#{}的方式把@Param注解括号内的参数进行引用(括号内参数对应的是形参)

解决方案:

Map selectSignMsg(@Param("cardOrAccount")String cardOrAccount);

注意:dao层用map类型接收,需要在mapper.xml文件中声明resultType="map"

例如:

/**

* 查询字典表中dictionaryVaule值

*/

Map selectDictionaryVaule();

<!-- 查询字典表中dictionaryVaule值  -->

<select id="selectDictionaryVaule" resultType="map" >

select dictionaryVaule from s_dictionary where dictionaryKey="acctOnlyFlag"

</select>

  1. 错误3

错误原因:

org.springframework.dao.DataIntegrityViolationException:

### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ‘mobile‘ cannot be null

### The error may involve defaultParameterMap

### The error occurred while setting parameters

### SQL: insert into b_sendmsgb(acctOnlyFlag,mobile,msgConent,tradeDate,tradeTime,insertTime,islongMsg) values    (?,?,?,?,?,?,?)

### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ‘mobile‘ cannot be null

; SQL []; Column ‘mobile‘ cannot be null; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Column ‘mobile‘ cannot be null

at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:85)

at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)

at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)

at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:75)

at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:447)

at com.sun.proxy.$Proxy102.insert(Unknown Source)

at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:279)

at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:57)

at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)

at com.sun.proxy.$Proxy105.signMsgInsertSendMsgB(Unknown Source)

at com.nantian.sms.service.CoreOnLineTransactionService.querySignMsg(CoreOnLineTransactionService.java:551)

原因分析:
Map signMsgInsertSendMsgB(Map signMsgSaveSendMsgB);

数据封装在了map中,mapper,xml文件中没有遍历取出手机号,导致报手机号不能为空的错误

解决方案:

4.

错误原因:

org.springframework.jdbc.UncategorizedSQLException:

### Error updating database.  Cause: java.sql.SQLException: sql injection violation, syntax error: syntax error, expect ‘)‘ : insert into b_sendmsgb

values

### SQL: insert into b_sendmsgb       values

### Cause: java.sql.SQLException: sql injection violation, syntax error: syntax error, expect ‘)‘ : insert into b_sendmsgb

values

; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; sql injection violation, syntax error: syntax error, expect ‘)‘ : insert into b_sendmsgb

values; nested exception is java.sql.SQLException: sql injection violation, syntax error: syntax error, expect ‘)‘ : insert into b_sendmsgb

values

  1. 错误原因5:

org.springframework.jdbc.UncategorizedSQLException:

### Error updating database.  Cause: java.sql.SQLException: sql injection violation, syntax error: syntax error, error in :‘le=? from s_dictionary where

dict‘,expect FROM, actual FROM from : update dictionaryVaule set

dictionaryVaule=? from s_dictionary where

dictionaryKey="acctOnlyFlag"

### SQL: update dictionaryVaule set   dictionaryVaule=? from s_dictionary where   dictionaryKey="acctOnlyFlag"

### Cause: java.sql.SQLException: sql injection violation, syntax error: syntax error, error in :‘le=? from s_dictionary where

dict‘,expect FROM, actual FROM from : update dictionaryVaule set

dictionaryVaule=? from s_dictionary where

dictionaryKey="acctOnlyFlag"

; uncategorized SQLException for SQL []; SQL state [null]; error code [0]; sql injection violation, syntax error: syntax error, error in :‘le=? from s_dictionary where

dict‘,expect FROM, actual FROM from : update dictionaryVaule set

dictionaryVaule=? from s_dictionary where

dictionaryKey="acctOnlyFlag"; nested exception is java.sql.SQLException: sql injection violation, syntax error: syntax error, error in :‘le=? from s_dictionary where

dict‘,expect FROM, actual FROM from : update dictionaryVaule set

dictionaryVaule=? from s_dictionary where

dictionaryKey="acctOnlyFlag"

解决方案:自己的sql写的有问题

2010-1-28

  1. 没有找到短信模板处理方式:

  1. 错误1:

原文地址:https://www.cnblogs.com/curedfisher/p/12241144.html

时间: 2024-10-19 19:02:57

sxnx-sms山西农信错误信息+处理方法的相关文章

mysql日常错误信息解决方法:InnoDB: and force InnoDB to continue crash recovery here.

今天早上上班来打开环境,mysql报了这个错误,猜到的原因应该是昨天晚上下班没等mysql服务器退出就关闭计算机. ? 1 2 3 4 5 6 7 8 9 10 11 12 13 2014-05-09 09:44:25 4128 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace manage_yunfan/nav_areasource uses space ID: 2 at

[WCF] - Odata Service 访问失败,查看具体错误信息的方法

Issue 解决 为 Data Service 配置属性如下:[System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)] 参考 http://salvoz.com/blog/2011/02/18/where-are-the-server-logs/

vistual studio 2012 安装失败,提示Microsoft Vistual Studio 2012 Devenv找不到元素,等错误信息

在安装vistual studio 2012过程中,出现安装失败,提示Microsoft Vistual Studio 2012 Devenv找不到元素,等错误信息 解决方法是更新对应的服务器补丁,更新完成后,重新安装vistual studio 2012,就可以通过. vistual studio 2012 安装失败,提示Microsoft Vistual Studio 2012 Devenv找不到元素,等错误信息

短信猫信息记录读取程序

有二年多时间没有写程序了写起程序太陌生了要求写一个短信猫信息记录的读取程序买了个短信猫下载了一个动态链接库sms.dll依据所给案例写了一个运行比较稳定. using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;using System.Runtime.InteropServices;usi

Delphi 的各种错误信息(中英文)

******************************* * 编 译 错 误 信 息 * ******************************* ';' not allowed before 'ELSE' ElSE前不允许有“;” '<clause>' clause not allowed in OLE automation section 在OLE自动区段不允许“<clause>”子句 '<name>' is not a type identifier

错误号:1364 错误信息:Field &#39;platId&#39; doesn&#39;t have a default value

1. 错误描述 错误号:1364 错误信息:Field 'platId' doesn't have a default value insert into `use`.`t_platform_scale` () values () 2.错误原因 由于在建表时,给platId一个not null限制,而且没有给默认值,在插入数据时未插入,导致报错 3.解决办法 (1)修改platId可以为null (2)插入数据时一定要插入platId 版权声明:本文为博主原创文章,未经博主允许不得转载. 错误号

.NET跨平台:在Mac上跟着错误信息一步一步手写ASP.NET 5程序

今天坐高铁时尝试了一种学习ASP.NET 5的笨方法,从空文件夹开始,根据运行dnx . kestrel命令的错误信息,一步一步写代码,直至将一个最简单的ASP.NET程序运行起来. 尝试的具体步骤如下. 新建一个空文件夹HelloCnblogs: mkdir HelloCnblogs && cd $_ 在这个空HelloCnblogs文件夹中运行 dnx . kestrel 命令(基于CoreCLR的dnx),运行结果是如下的出错信息: System.InvalidOperationEx

表单提交时如何将错误信息传递到页面中,并且保存原来提交数据

曾经何时,你还有我或许都在困惑,如何方便的将验证不通过的表单信息再返回到前台页面,例如我注册一个账号,辛辛苦苦填写了N多项,一个格式验证没有通过,一切都需要充填,虽然Ajax可以解决这个问题,但是我们总不能把所有表单提交都弄成ajax,更何况有若干人就是没事把javascript给禁止了.哎哎,好了解决方案来了,下面以用户登录为例,说说我的解决方案. 服务器端用nodejs实现: login.html 简单的提交表单 <form action="" id="loginF

null?对象?异常?到底应该如何返回错误信息

这篇文章记录我的一些思考.在工作了一段时间之后. 问题的核心很简单:到底如何返回错误信息. 学生时代,见到过当时的老师的代码: 1 if (foo() == null) { 2 3 } 当然,这位老师是一位比较擅长c/c++的老程序员,所以他的代码其实使用c写的.但是意思和这段代码类似.当时,我很好奇为什么要对一个方法的返回值是不是null进行判断.现在当然很清楚了:在很多win32的API里面,是通过返回值为null来传递"函数调用失败"这一种信息的. 那么,这么做好吗? 我翻看了很