Skip to content

DBlog 常见问题

yadong.zhang edited this page May 22, 2018 · 2 revisions

1.项目编译报错

问题描述

git clone DBlog后,ide打开提示编译报错,发现实体类中缺少setter和getter方法,这是因为DBlog中使用了lombok插件所致,只需要安装对应的lombok插件即可。

解决方案:

eclipse安装lombok

idea安装lombok: file->settings->plugins->Browse Repositories->输入lombok,点击搜索->选中lombok点击install->安装完成后重启idea

2. SQL异常

问题描述

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Expression #20 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'c.commentCount' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
...
...

解决方案

注意,异常提示中的 sql_mode=only_full_group_by ,这是MySQL 5.7.9版本sql_mode=only_full_group_by问题,请参考以下文章:

https://www.cnblogs.com/jim2016/p/6322703.html https://www.cnblogs.com/grimm/p/5751911.html

3. Redis异常

问题描述

org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
	at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.fetchJedisConnector(JedisConnectionFactory.java:204)
	at org.springframework.data.redis.connection.jedis.JedisConnectionFactory.getConnection(JedisConnectionFactory.java:348)
	at org.springframework.data.redis.core.RedisConnectionUtils.doGetConnection(RedisConnectionUtils.java:129)
	at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:92)
	at org.springframework.data.redis.core.RedisConnectionUtils.getConnection(RedisConnectionUtils.java:79)
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:194)
	at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:169)
	at org.springframework.data.redis.core.RedisTemplate.hasKey(RedisTemplate.java:658)
...
...

解决方案

DBlog博客依赖于Redis,请参考【DBlog-项目说明】中的2.4(配置项目-修改(resources/application.yml)配置文件)的说明修改配置

4. 页面图片加载404

问题描述

如图: 输入图片说明 输入图片说明

造成这种问题有两种原因:

  1. sys_config表中的qiniu_base_path字段内容未修改
  2. 七牛云Bucket中未添加相关的“图片样式”

解决方案

  1. 修改sys_config表中的qiniu_base_path字段为自己七牛云Bucket提供的路径
  2. 在七牛云中添加相对应的“图片样式”。设置方式,参考下图 输入图片说明

其他问题

如在使用过程中遇到其他问题,可以提交Issue,或者进QQ群讨论:190886500