网站后台开发常见BUG及解决方法
2017-11-21 22:59
330 查看
Bug-01
--------------------------------------------------
C:\Program Files\MariaDB 5.5\bin>mysql -u root -p;
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (
ES)
登录时去掉最后的";"
---------------------------------------------------------------------
Bug-02
启动tomcat 出现如下问题:
java.sql.SQLException:
Access denied for user 'root'@'localhost' (using password: NO)
step01:检测数据库配置文件中url,用户名,密码配置是否正确
假如配置都没有问题,还出现拒绝访问,如何解决?
step02:检测数据库服务器是否已经启动?
可以从mysql的客户端先登录一下试试,假如可以登录,说明服务已经启动
step03:重新执行maven update (强制更新)
重新执行了maven update多次,启动tomcat,还是报拒绝访问问题.
step04: 尝试更新数据库驱动并检测url中的端口号.
---------------------------------------------------------------------
Bug-03
ttm1.0 项目登录以后,页面乱码出现乱码?
解决方案:
1)查询数据库表中内容
2)假如内容是乱码,则重新导入数据
step01: set names utf8
step02: source d:/ttms.sql
--------------------------------------------------------------------
Bug-04
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): cn.tedu.ttms.product.dao.ProjectDao.findObjects
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189)
at org.apache.ibatis.binding.MapperMethod.<init>
检测XxxMapping.xml文件中的内容配置是否有问题
1)namespace(命名空间)
2)resultType(映射结果类型)
3)id(值是否与dao中方法对应)
解决问题的思路:4w+h
1)when (执行什么操作出现的这个问题)
2)what (什么问题)
3)where (哪里的问题,至少要看5行错误)
4)why (为什么会出现这个问题)
5)how (如何解决这个问题)
---------------------------------------------------------------
Bug05
org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: No serializer found for class cn.tedu.ttms.product.entity.Project and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS);
nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class cn.tedu.ttms.product.entity.Project and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
(through reference chain: java.util.ArrayList[0])
at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:299)
at org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:106)
此问题一般是实体对象缺少get方法所导致
------------------------------------------------------------------
Bug-06
HTTP Status 404 - /ttms1.01/WEB-INF/pages/project/doFindObjects.jsp
查找控制层对应方法是否使用了@ResponseBody注解
------------------------------------------------------------------
Bug-07
org.mybatis.spring.MyBatisSystemException:
nested exception is org.apache.ibatis.binding.BindingException: Parameter 'startIndex' not found.
Available parameters are [0, 1, param1, param2]
atorg.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
at com.sun.proxy.$Proxy40.selectList(Unknown Source)
此异常为绑定异常,是在mybatis映射文件中通过#或$去获取startIndex的值时,没有找到这个参数,找到的是[0, 1, param1, param2].
解决方案:
1)在dao中通过@Param定义参数,mapper文件中通过
#{startIndex}或${startIndex}
2)借助#{param1},...等形式在mapper文件中获取参数值
3)借助#{0},#{1},...等形式在mapper文件获取值.
----------------------------------------------------------------------
Bug-08
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE valid=0' at line 1
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE valid=0' at
line 1
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
以后再遇到MySQLSyntaxErrorException时,先检测你的SQL语法.
--------------------------------------------------------------------
Bug-09
浏览器的控制端出现:
Uncaught SyntaxError: unexpected token }
一般是JS代码中多或少了"}"
--------------------------------------------------
C:\Program Files\MariaDB 5.5\bin>mysql -u root -p;
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (
ES)
登录时去掉最后的";"
---------------------------------------------------------------------
Bug-02
启动tomcat 出现如下问题:
java.sql.SQLException:
Access denied for user 'root'@'localhost' (using password: NO)
step01:检测数据库配置文件中url,用户名,密码配置是否正确
假如配置都没有问题,还出现拒绝访问,如何解决?
step02:检测数据库服务器是否已经启动?
可以从mysql的客户端先登录一下试试,假如可以登录,说明服务已经启动
step03:重新执行maven update (强制更新)
重新执行了maven update多次,启动tomcat,还是报拒绝访问问题.
step04: 尝试更新数据库驱动并检测url中的端口号.
---------------------------------------------------------------------
Bug-03
ttm1.0 项目登录以后,页面乱码出现乱码?
解决方案:
1)查询数据库表中内容
2)假如内容是乱码,则重新导入数据
step01: set names utf8
step02: source d:/ttms.sql
--------------------------------------------------------------------
Bug-04
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): cn.tedu.ttms.product.dao.ProjectDao.findObjects
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:189)
at org.apache.ibatis.binding.MapperMethod.<init>
检测XxxMapping.xml文件中的内容配置是否有问题
1)namespace(命名空间)
2)resultType(映射结果类型)
3)id(值是否与dao中方法对应)
解决问题的思路:4w+h
1)when (执行什么操作出现的这个问题)
2)what (什么问题)
3)where (哪里的问题,至少要看5行错误)
4)why (为什么会出现这个问题)
5)how (如何解决这个问题)
---------------------------------------------------------------
Bug05
org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: No serializer found for class cn.tedu.ttms.product.entity.Project and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS);
nested exception is com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class cn.tedu.ttms.product.entity.Project and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS)
(through reference chain: java.util.ArrayList[0])
at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:299)
at org.springframework.http.converter.AbstractGenericHttpMessageConverter.write(AbstractGenericHttpMessageConverter.java:106)
此问题一般是实体对象缺少get方法所导致
------------------------------------------------------------------
Bug-06
HTTP Status 404 - /ttms1.01/WEB-INF/pages/project/doFindObjects.jsp
查找控制层对应方法是否使用了@ResponseBody注解
------------------------------------------------------------------
Bug-07
org.mybatis.spring.MyBatisSystemException:
nested exception is org.apache.ibatis.binding.BindingException: Parameter 'startIndex' not found.
Available parameters are [0, 1, param1, param2]
atorg.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
at com.sun.proxy.$Proxy40.selectList(Unknown Source)
此异常为绑定异常,是在mybatis映射文件中通过#或$去获取startIndex的值时,没有找到这个参数,找到的是[0, 1, param1, param2].
解决方案:
1)在dao中通过@Param定义参数,mapper文件中通过
#{startIndex}或${startIndex}
2)借助#{param1},...等形式在mapper文件中获取参数值
3)借助#{0},#{1},...等形式在mapper文件获取值.
----------------------------------------------------------------------
Bug-08
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE valid=0' at line 1
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'WHERE valid=0' at
line 1
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73)
以后再遇到MySQLSyntaxErrorException时,先检测你的SQL语法.
--------------------------------------------------------------------
Bug-09
浏览器的控制端出现:
Uncaught SyntaxError: unexpected token }
一般是JS代码中多或少了"}"
相关文章推荐
- Android开发常见bug及解决方法 (一)
- asp.net开发与web标准的冲突问题的一些常见解决方法
- SharePoint开发中常见的几种错误类型及解决方法
- 防止IE6出现BUG的十种常见解决方法
- WebMatrix开发的Razor网站发布到IIS后无法访问的解决方法
- WF 自定义活动开发常见问题(进入第二个流程状态,数据传递失败的解决方法)
- asp.net 开发常见问题及解决方法(一)
- ERP,网站开发之后台struts2乱码解决总结大全
- android开发网站无法访问解决方法
- DEDECMS后台空白,dede网站栏目管理空白解决方法
- ios开发常见错误及解决方法
- 网站开发之后台struts2乱码解决总结大全
- 10个常见的IE bug和解决方法
- ArcGIS Engine 10 开发常见问题的解决方法
- asp.net开发与web标准的冲突问题的一些常见解决方法
- [转贴]IE6出现BUG的十种常见解决方法
- 开发某企业网站遇到的问题及解决方法
- MyEclipse 开发 SSH 应用中的两个常见错误的解决方法
- ERP,网站开发之后台struts2乱码解决总结大全
- bug管理工具及bugzilla 安装及常见错误解决方法