编程错误
小猴子的技术笔记
这个作者很懒,什么都没留下…
展开
-
SpringBoot项目使用JAP查询数据,SQL没有问题,但是查询结果不正确
问题描述1.在公司有个项目使用的是SpringBoot的项目搭建的,对数据层使用的是JPA。在查询数据的时候发现有个记录查询出来的结果和预想的结果不一样,于是就在项目运行的时候把SQL打印出来去数据库查看,但是SQL查询出来的结果明明是正确的,可是偏偏就是在页面展示的时候不是正确的。2.具体问题是这样的:两条记录,金额是不一样的,但是页面展示的确是同一条数据。解决过程1.在刚开始的时候以为...原创 2020-01-10 20:55:57 · 1685 阅读 · 1 评论 -
关于Linux下Nginx服务启动,通过浏览器无法访问的问题
1.通过Linux查看Linux服务是否启动。可以看到服务成功启动,但是在浏览器上还是无法访问。解决办法:添加 80 段端口配置firewall-cmd --zone=public --add-port=80/tcp --permanent重启防火墙systemctl restart firewalld.service结果:...原创 2018-07-25 13:54:41 · 8184 阅读 · 8 评论 -
URL输入正确,但是访问却是404
问题:解决办法:把 manager 前缀更改一下,这个manager容易和tomcat冲突。原创 2018-07-23 16:27:18 · 7059 阅读 · 0 评论 -
关于MySQL主键自增获取到为null值得问题
在学习springBoot做项目的时候遇到了数据库表字段明明是自增但是取到的结果却是null的问题。情况如下:没有正确取到id,而是为null解决办法:在“insert”后中添加如下字段<insert id="insert" useGeneratedKeys="true" keyProperty="id"> insert into order_info</insert&...原创 2018-06-26 23:57:08 · 4180 阅读 · 2 评论 -
nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘userId‘ not found. Availa
今天在使用springBoot开发项目的时候遇到了“nested exception is org.apache.ibatis.binding.BindingException: Parameter 'userId' not found. Available parameters are [goodsId, arg0, param1, param2]”的问题。问题原因:参数没有绑定成功解决办法:找...原创 2018-06-25 23:28:47 · 8805 阅读 · 0 评论 -
Handler dispatch failed; nested exception is java.lang.StackOverflowError
springBoot项目遇到了“Handler dispatch failed; nested exception is java.lang.StackOverflowError”的错误。总结一哈:StackOverflowError通常情况下是死循环或者是循环依赖了。Caused by: java.lang.StackOverflowError at com.hry.seckill.servi...原创 2018-06-25 18:46:20 · 71991 阅读 · 16 评论 -
springBoot:Invalid bound statement (not found): com.hry.seckill.mapper.GoodsMapper.getGoodsVoList
在学习springBoot做秒杀项目的时候遇到了“Invalid bound statement (not found): com.hry.seckill.mapper.GoodsMapper.getGoodsVoList”的错误。错误提示:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found...原创 2018-06-25 18:40:10 · 4461 阅读 · 0 评论 -
org.springframework.web.multipart.MultipartException: The current request is not a multi
关于“org.springframework.web.multipart.MultipartException: The current request is not a multipart request”问题解决办法。大招:1.查看springMVC配置文件添加上传文件配置<!-- 上传文件 --><bean id="multipartResolver" class="o...原创 2018-06-07 11:01:23 · 7208 阅读 · 1 评论 -
Result Maps collection already contains value for com.hry.igoods.mapper.TbAreaMapper.BaseResultMap
在像往常一样编写ssm项目的时候遇到了“Result Maps collection already contains value for com.hry.igoods.mapper.TbAreaMapper.BaseResultMap”的问题。解决办法:1.检查逆向工程配置是否有重复的表2.删除之前生成的逆向生成的mybatis配置文件,再次生成...原创 2018-06-13 23:58:05 · 1230 阅读 · 1 评论 -
WARNING in configuration The ‘mode‘ option has not been set, webpack will fallback to ‘production‘ f
小弟初学webpack 在安装初始化的时候遇到了一些问题“WARNING in configuration The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to en...原创 2018-08-11 20:28:24 · 12988 阅读 · 0 评论 -
关于Navicat连接阿里云MySQL拒绝访问的问题
1.配置阿里云添加规则2.解决办法:修改权限GRANTALLPRIVILEGESON*.*TO'root'@'%'IDENTIFIEDBY'密码'WITHGRANTOPTION;原创 2018-08-16 08:21:09 · 2975 阅读 · 0 评论 -
springboot发送邮件问题总结
springboot内部集成了spring的邮件发送功能,所以在使用springboot进行邮件发送的时候需要在maven中加入以下依赖。<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail&...原创 2018-09-12 08:47:25 · 1873 阅读 · 0 评论 -
关于使用contains判断一个元素是否在集合中存在总是返回false的问题记录
问题描述由于项目中需要使用到一个集合,并在集合中存进一些元素。然后根据一个值去判断是否在集合中,测试结果总是返回false而导致业务无法正常进行。示例虽然我的CheckAccountTerminal实体类中只有一个字段,用如下方法获取的也是一个集合。List<CheckAccountTerminal> list = new ArrayList();list.contains(...原创 2019-07-23 13:08:36 · 2837 阅读 · 0 评论 -
kafka-踩坑
1 环境搭建我是学习,只在阿里云服务器上搭建了一个独立的kafka,在搭建环境的时候遇到的一些坑如下:kafka server.properties 配置文件中的:listeners=PLAINTEXT://IP:9092这里我尝试了 IP设置成外网和localhost,就是通过IP访问阿里云的外网IP,然后运行结果会报错,起不来kafka。查阅资料说的是设置成本机的IP, 使用ifco...原创 2019-07-09 13:24:08 · 411 阅读 · 0 评论 -
关于重复jar包引发的栈溢出问题-Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotat
一个很奇怪的问题,就是项目在本地没有问题,但是到生产机器上就报错:Caused by: java.lang.IllegalStateException: Unable to complete the scan for annotations for web application [] due to a StackOverflowError. Possible root causes inc...原创 2019-07-08 16:28:35 · 1690 阅读 · 0 评论 -
springboot集成rabbitmq——采坑
1.我是在CentOS7下面安装的rabbitmq,通过浏览器访问的时候记得关闭防火墙2.配置application.properties 的时候记得写对配置(测试通过配置如下) 注意:不要把ip地址加上前缀,如“http://192.168.52.133” 端口号是“5672” 不是管控台的“15672”spring.rabbitmq.host=192.168.52.133s...原创 2018-10-16 09:30:07 · 942 阅读 · 1 评论 -
关于代码进行排序查询,模糊查询,结果为空,不能正常展示排序问题总结
使用springboot进行商品模糊查询和选择排序查询,遇到了一下问题。1.查询出来结果为空:我是最先使用的是在业务层拼接好模糊查询的语句 也就是“ '%nam%' ” 我把这个这个整体当做参数传进接口,然后再mapper.xml里面获取,原本以为能获取到,但是查询的结果却是空。后来解决办法是使用一下代码:like concat('%',#{keyword},'%')原因就是把“...原创 2018-09-13 16:51:20 · 648 阅读 · 0 评论 -
java.lang.NoSuchMethodException: com.hry.store.vo.CategoryVo.<init>(java.lang.Integer, java.lang.Int
之前在写项目的时候都是使用的mybatis逆向工程来生成的mapper 和 mapper.xml 今天使用spring boot写项目的时候,遇到了需要自己填写的mapper。错误:java.lang.NoSuchMethodException: com.hry.store.vo.CategoryVo.<init>(java.lang.Integer, java.lang.I...原创 2018-09-17 15:33:57 · 1131 阅读 · 1 评论 -
关于图片服务器明明有图片,但是去无法通过img标签获取的问题
我自己写了图片上传的工具,把用到的图片上传到地址服务器,然后在编写项目的时候也能够从数据库获取到图片地址信息,但是图片就是不显示,我把地址复制出来粘贴到浏览器也能够访问到,可就是在“img”标签中无法访问,仔细检查,发现以下问题。错误:http:地址服务器xxxxxxx.png -----<img src="http:地址服务器xxxxxxx.png"/> ---------...原创 2018-09-12 15:13:32 · 3591 阅读 · 0 评论 -
关于SpringBoot单元测试遇到的问题
使用SpringBoot进行一些单元测试,会遇到一些比较低级的错误,希望记录此文章以备日后学习和警醒。1.首先检查是否加上了正确的注解。@RunWith(SpringRunner.class)@SpringBootTest2.是否加入“@Test”注解在方法上。3.如果引用了Dao层的依赖,需要看看Dao层是否被Spring扫描,也就是说,看看Mapper接口上是否加了注解。...原创 2018-09-06 16:29:26 · 827 阅读 · 2 评论 -
关于c:forEach标签的使用以及出现表达式的问题总结
我使用的是maven+ssm框架做的案例。1.首先资源映射配置好<!-- 资源映射 --> <mvc:resources location="/WEB-INF/css/" mapping="/css/**"/> <mvc:resources location="/WEB-INF/js/" mapping="/js/**"/> <原创 2018-05-13 10:26:49 · 2124 阅读 · 0 评论 -
Type class com.hry.pojo.User is not known to the MapperRegistry.
关于mybatis批量插入出现“org.apache.ibatis.binding.BindingException: Type class com.hry.pojo.User is not known to the MapperRegistry.”的问题解决办法。1.配置spring <bean id="sqlSessionTemplate" class="org.mybatis.spri...原创 2018-05-10 12:38:12 · 1789 阅读 · 0 评论 -
myEclipse 中使用maven命令 Tomcat:run没有任何反应,控制台console也没有输出任何语句
myEclipse 中使用maven命令 Tomcat:run没有任何反应,控制台console也没有输出任何语句原创 2017-12-18 00:22:45 · 2012 阅读 · 0 评论 -
HTTP Status 500 - id to load is required for loading的原因解决办法
HTTP Status 500 - id to load is required for loading的原因解决办法.The server encountered an internal error that prevented it from fulfilling this request.原创 2017-11-27 20:11:50 · 1020 阅读 · 0 评论 -
Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xm
在编写ssh框架项目的时候出现了“Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from inpu原创 2017-11-27 18:01:51 · 666 阅读 · 0 评论 -
HTTP Status 500 - attempt to create saveOrUpdate event with null entity的错误及解决办法
HTTP Status 500 - attempt to create saveOrUpdate event with null entity的错误及解决办法原创 2017-12-03 15:30:54 · 3716 阅读 · 6 评论 -
Exception occurred during processing request: null 的错误原因以及解决办法
Exception occurred during processing request: null 的错误原因以及解决办法原创 2017-12-01 23:59:44 · 37678 阅读 · 3 评论 -
Exception occurred during processing request: com.hry.shop.user.action.UserAction.findByName()
Exception occurred during processing request: com.hry.shop.user.action.UserAction.findByName()的原因和解决办法。原创 2017-11-22 17:54:35 · 642 阅读 · 0 评论 -
关于ssh 项目Could not parse mapping document from input stream的错误提示
Could not parse mapping document from input stream的完美解决办法。原创 2017-11-22 11:29:46 · 2415 阅读 · 0 评论 -
关于ssh web 项目出现 No result defined for action comindex.action and result success解决办法
关于ssh web 项目出现 No result defined for action comindex.action and result success解决办法,有可能是真的没有定义返回值,但是定义过返回值的情况下就要看看方法名了。原创 2017-11-18 00:08:19 · 3210 阅读 · 1 评论 -
关于通过http请求访问Linux下的ftp的问题以及解决办法
今天在学习ssm商城的时候安装好了虚拟机,装好了CentOS,配置好了NGINX服务器,也配置好了Linux自带的ftp,但是通过http访问的时候却不能实现。情况如下:我使用的“FileZilla”工具访问:但是从网页上就是不能够访问。解决办法:1.首先进入到NGINX配置文件下面:然后继续往下:其中 “server_name”表示的是本机IP 也可设置成 “localhost”,“locati...原创 2018-03-06 19:07:10 · 6363 阅读 · 1 评论 -
MyBatis-模糊查询控制台不报错,但是得到的结果集合确是0的问题解决办法
1.今天在学习MyBatis框架的时候遇到一个问题,就是控制台不报错得到的结果集合确是0,下面用图片详细描述下问题:查询语句:测试语句:数据库数据:运行之后控制台语句:通过上面可以看到日志输出的控制语句,然后把MyBatis拼接好的sql语句放到数据库中,用来检查是不是语句的错误,得到的结果------不是。解决办法:修改数据库连接的URL。修改前:"jdbc:mysql://localhost:...原创 2018-02-13 21:36:28 · 1102 阅读 · 3 评论 -
There is no getter for property named 'UserCustom' in 'class com.hry.pojo.UserQueryVo'
1.在练习使用mybatis的时候出现了“There is no getter for property named 'UserCustom' in 'class com.hry.pojo.UserQueryVo'”的错误。一开始我按照提示以为是没有提供“get()”方法,可是检查了一遍确实有get方法,那么问题 出在哪里呢?2.这个时候就需要检查mybatis中的sql语句拼写了,仔细观察下面两...原创 2018-02-15 12:56:40 · 1604 阅读 · 0 评论 -
关于springMVC使用@RequestMapping()无法访问url,报404的问题
今天在写项目的时候,遇到了明明加了注解“@RequestMapping()”而且url写的没有一点点点点点错误,但是请求的时候还是报了404错误。解决办法:找到spring-mvc配置文件并加上:<mvc:annotation-driven /><mvc:annotation-driven /> :使用这个配置会自动注册DefaultAnnotationHandlerMap...原创 2018-04-07 23:15:18 · 16102 阅读 · 0 评论 -
关于IntelliJ IDEA开发时jsp无法访问css的问题
在使用IntelliJ IDEA进行web开发的时候遇到了一个很是奇怪的问题,就是不管我css,images文件夹放在web目录下还是WEB-INF下jsp页面都不能够访问到设定好的样式。解决办法:找到spring-mvc配置文件,在文件中加上:<!-- 资源映射 --><mvc:resources location="/WEB-INF/css/" mapping="/css/...原创 2018-04-07 23:03:00 · 5128 阅读 · 0 评论 -
redis.clients.jedis.exceptions.JedisConnectionException: java.net.SocketTimeoutException: connect ti
话不多说,直接看方法:1.确定redis服务开启2.vi /etc/sysconfig/iptables 检查端口号是否开启-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT-A INPUT -p icmp -j ACCEPT-A INPUT -i lo -j ACCEPT-A INPUT -m state --state NEW ...原创 2018-03-19 22:17:10 · 745 阅读 · 0 评论 -
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘searchContro
今天在学习项目的时候遇到了问题如下:“nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field:”org.springframework.beans.factory.BeanCreationException: Error creating bean w...原创 2018-03-18 11:11:50 · 578 阅读 · 0 评论 -
ssm-后台有数据,代码没有错误,得到的集合为null
在学习ssm进行后台查询的时候,框架结合没有错误,也有输出记录但是得到结果却是“null”。把输出的语句放到数据库中查询,也能够查询到结果。那么问题到底出在哪里了呢?这个时候就要检查下“mapper.xml”配置文件了错误:<!-- 商品列表查询 --> <!-- parameterType传入包装对象(包装查询条件) resultType建议使用扩展对象...原创 2018-02-21 17:57:43 · 1484 阅读 · 0 评论 -
ssm出现Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/applic
在学习ssm项目整合框架的时候出现了“Error creating bean with name 'sqlSessionFactory' defined in class path resource [spring/applicationContext-dao.xml]: Invocation of init method failed; nested exception is java.io.F...原创 2018-02-21 16:59:28 · 2879 阅读 · 1 评论 -
No mapping found for HTTP request with URI [/item/536563] in DispatcherServlet with name ‘taotao-man
我在学习ssm项目的时候出现了“No mapping found for HTTP request with URI [/item/536563] in DispatcherServlet with name 'taotao-manager'”的错误提示,一开始百度了好多种方法都没有找到原因。错误代码如下:2018-02-28 20:05:01,439 [http-bio-8080-exec-7]...原创 2018-02-28 20:12:03 · 1050 阅读 · 0 评论