Fork me on GitHub

错误日志

注意:所有文章除特别说明外,转载请注明出处.

1. Caused by: org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 5

解:该错误时因为查询到的记录是多条,而返回的类型值允许是一条或者没有,所以出错。所以在数据返回的时候将返回类型变为List集合,那么就能正确执行。

2.Zero date value prohibited; nested exception is java.sql.SQLException: Zero date value prohibited

解:在数据库连接的URL之后加上 &zeroDateTimeBehavior=convertToNull。这种方法的值一共有三种:

1.exception:默认值,会抛出异常。
2.CONVERT_TO_NULL:将出错的那个0000-00-00字段的值转为null
3.round:转成0001-01-01 14:00:00

或者将数据表中对应的值将其改成null

3.Cause: java.sql.SQLIntegrityConstraintViolationException: Column ‘email’ in where clause is ambiguous

这里表示数据查询过程中查询的列重复了,没有指定哪个表的中的列被查询,指定之后就不会出现这样的错误。

或者在服务实现时候,用正确的列名替换错误的列名。

org.springframework.beans.factory.BeanCreationException

出现此类异常的情况有很多:

1.可能是你的数据库类名称引用错误。

maven jetty启动很慢的问题 报错:Timeout scanning annotations

原因:

The Jetty8 have to scan all the jar files to search those "Servlet3" features (web-fragment / annotations ... etc ) 

解决:

1.在web.xml中的<web-app>末尾加上metadata-complete="true",此段程序一般没有效果。

2.1 创建一个文件jetty-context.xml文件,将之放置到java路径下的resources文件目录下。

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure.dtd">
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
    <Call name="setAttribute">
        <Arg>org.eclipse.jetty.server.webapp.WebInfIncludeJarPattern</Arg>
        <Arg>.*/.*jsp-api-[^/]\.jar$|./.*jsp-[^/]\.jar$|./.*taglibs[^/]*\.jar$
        </Arg>
    </Call>
</Configure>

2.2 然后将pom.xml中的jetty依赖换掉

<plugin>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-maven-plugin</artifactId>
  <version>9.3.10.v20160621</version>
  <configuration>
    <contextXml>src/main/resources/jetty-contexts.xml</contextXml>
    <webAppConfig>
      <defaultsDescriptor>src/main/resources/jetty-contexts.xml</defaultsDescriptor>
      <contextPath>/solr</contextPath>
    </webAppConfig>
  </configuration>
</plugin>

2.3 然后重启jetty-run就可以啦

jetty:run -Dorg.eclipse.jetty.annotations.maxWait=120

这里表示的是在maven jetty:run 启动命令之后追加参数。

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0’: Initialization of bean failed;

解决:在springmvc.xml中在mvc:default-servlet-handler/添加上在web.xml中的效果如下:
<mvc:default-servlet-handler default-servlet-name=”SpringMVC”/>

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘configController’: Injection of autowired dependencies failed;

解决:因为在Service实现类里面没有添加@Service标签,发生这种错误的原因要么是注解问题,要么是配置文件多写什么或者少写什么。

No mapping found for HTTP request with URI [/teacher/teacher/exam/export] in DispatcherServlet with name ‘B’

解决:原因是因为Controller没有加载到资源,没有找到资源,原因可能是配置文件没有配置扫描到对应的controller或者是web.xml中没有配置,然后还有一种情况就是在Controller中的对应的方法路径写错。

java.lang.ArrayIndexOutOfBoundsException 数据下标越界错误

解决:查看为什么会数组下标越界,一般都是最后面的一个元素访问的时候访问了本不存在的数组下标值的元素。

can not be referenced from a static context 此错误表示不能在静态上下文引用类

解决:此时是因为没有在static方法中声明类对象,然后在声明类对象之后再引用该声明对象的方法就能够使用该方法啦。

### Error querying database. Cause: java.sql.SQLSyntaxErrorException: Unknown column ‘name’ in ‘field list’

解决:

javax.servlet.ServletException: Could not resolve view with name

解决:此问题可能是因为在写springmvc的时候少写一些东西导致的问题。认真检查springmvc的程序是否正确。

### Error updating database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘course_section = ‘1-2’

解决:此错误可能是因为mapper.xml中的文件少写了一些东西,比如:逗号,名称与主体或者数据库里面的名称不一致导致。此时应该注意检查xml文件的问题。

Cannot determine value type from string ‘B楼#114’; nested exception is java.sql.SQLDataException: Cannot determine value type from string ‘B楼#114’

解决:可能是因为xml文件的字段拼写或者是语法错误,认真检查。

org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

解决:要么是接口或者xml文件找不到,要么是两者之间不匹配

### Error updating database. Cause: java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘)VALUES(‘胡邦金’,’ at line 34

解决:这样的错误可能是因为在sql语句中逗号的原因,所以使用关键字解决。

org.springframework.beans.InvalidPropertyException: Invalid property ‘courseTeacher[]’ of bean class [cn.edu.xidian.see.entity.AppointmentCourse]: Property referenced in indexed property path ‘courseTeacher[]’ is neither an array nor a List nor a Map; returned value was []

解决:对于这样的错误可能是因为在数据库表中设置该字段的值不为空,然后前台传参进去是为空的,所以导致两者不一致而产生错误。所以检查前台或者数据库表中字段值是否设置得当。

### Error updating database. Cause: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry ‘14020310013’ for key ‘u_sno’

解决:确保在开发过程中索引唯一性,也就是在插入数据的时候,具有唯一性约束条件的列的值有重复。

echarts.js:11954 Uncaught Error: series.type should be specified.

解决:这里需要自己加载option,就是自己定义的option。 majorChart.setOption(optionMajor);然后就不会报错了。

1054 - Unknown column ‘雷达信号处理国家重点实验室’ in ‘where clause’

解决:需要注意的是该列是字符串类型,需要加上单引号。双引号解析为字段变量或关键字,单引号解析为字段的值。

; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: Unknown column ‘电路CAD研究所’ in ‘where clause’

解决:将最后的字段用单引号括起来。

后台在查询数据库之后输出值为空的情况可能是mybatis中没有返回resultMap类型,将其设置为resultMap类型返回的话,后台就有值了

使用datatables分页数据的时候报错413 full head

解决:这里是因为请求的实体过大的缘故,将请求方式get改为post。

注意:在为了避免此错误出现,尽量减少请求主体的大小。

Property referenced in indexed property path ‘columns[0][data]’ is neither a

解决:这里是因为在datatable中没有设置datatable的声明类。在配置文件中要配置其声明类DataTableArgumentResolver。

Failed to execute goal org.mortbay.jetty:maven-jetty-plugin:6.1.25

解决:使用jetty:run-war

在导入的mysql数据文件出现中文乱码时候,在mysql.sql源文件中设置编码 set names ‘utf8’; 问题解决。

time_zone 错误,直接在数据库链接后面加上 ?serverTimezone=UTC 即可。

解决:jdbc.url=jdbc:mysql://127.0.0.1:3306/bilibili?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=UTC

Failed to execute goal org.mortbay.jetty:maven-jetty-plugin:6.1.25:run (default-cli) on project BodyCheck: Failure

解决:根据错误日志可以知道是因为项目端口号被占用,换用其它端口号或者停掉当前端口号。

416 Requested Range Not Satisfiable

解决:这个错误一般出现在断点续传中,含义是请求范围错误,例如:

一个文件的大小是10000000 byte,你请求起始点大于或等于10000000 时,即会返回416

<form action="" method="post" class="form-horizontal" enctype="application/x-www-form-urlencoded" >

在页面上加入上面的程序,请求的链接的页面会解决416错误。

416错误还是没有解决,上面的解决方式可能只是凑巧一会儿就好了,但是到后面还是会报错。

解决:利用其它服务器,获取其它服务器的视频位置,然后在ckplayer视频路径下添加上,视频能够正常播放。

HTTP 400错误 一般来说是因为前后台之间传递参数不一致所导致的

解决:这里我要解决的是前台传递一个List<对象>到后台,所以在使用ajax传递之前需要将这样一个List对象转换成String类型,然后将Stirng类型通过ajax方式传递给后台。在后台通过@RequestBody注解接收,还需要类型是List<对象>类型。

如何解决在mybatis中加入java.util.List类型的数据

报错 jetty server exiting

解决:将Java虚拟机停掉重新启动项目便可。

PreparedStatementCallback; uncategorized SQLException for SQL Incorrect integer value: ‘’ for column ‘payment_status’ at row 1

解决:将数据表里面的对应的Integer类型转换成varchar类型。报错消失。

DataTables插件不能正常使用的时候,排查前端是否写对。中是否包含<#list>

Truncated incorrect DOUBLE value: ‘2019-12-13 15:52:20’

解决:将UPDATE teacher_employment_post_feedback SET ctime = “2019-12-13 15:52:20” and utime = “2020-01-03 15:43:20”语句中的and改为’,’

nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘condition’ in ‘class com.llq.DataTables.condition.DTCondition’

解决:在写程序的时候出现错误,在传递的参数中没有condition变量,也就是在.xml文件中不用condition.where这样的来引用。直接${where}来引用即可。

本文标题:错误日志

文章作者:Bangjin-Hu

发布时间:2019年10月15日 - 09:22:26

最后更新:2020年03月30日 - 08:13:35

原始链接:http://bangjinhu.github.io/undefined/错误日志/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。

Bangjin-Hu wechat
欢迎扫码关注微信公众号,订阅我的微信公众号.
坚持原创技术分享,您的支持是我创作的动力.