![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
开发问题记录
文章平均质量分 98
bestcxx
向外思考,向上生长
展开
-
WARNING YOU USE DEPRECATED / UNKNOWN CONSTA- struts2+spring
在Maven中调试 SSH框架的时候,发现项目启动的时候控制台显示下面的警告,尽管没有对项目的运行造成实质性的影响,最后一探究竟发现是struts2的版本太低的缘故,使用maven中央仓库中最新的版本就没有这个问题了。 1、问题DEBUG - ***********************************************************************...原创 2016-11-20 22:31:26 · 1216 阅读 · 0 评论 -
Java反射机制在开发工作中的一个应用-通过反射调用一个类中的非黑名单方法
文章目录前言需求需求分析常规开发多想一步:防止系统意外,提供一个集中调用的方法技术实现常规写法:在总方法中一一罗列调用子方法多想一步:用反射来解决这个问题回忆反射机制实际应用最佳实践:Spring 不支持 本类自己注入自己前言体能状态先于精神状态,习惯先于决心,聚焦先于喜好需求博主近期处理一个需求,将使用 Spring Quartz 跑批的定时任务改造为对外暴露的接口.需求分析这...原创 2019-05-07 20:34:31 · 276 阅读 · 0 评论 -
关于访问微信安全域名认证txt文件访问的通用解决方案
文章目录前言需求描述问题解决思路代码访问例子说明前言体能状态先于精神状态,习惯先于决心,聚焦先于喜好。需求描述微信开发中会遇到一个安全域名的问题,微信要求将其提供的txt文件放到指定服务器,然后可以通过 http://域名/项目名/文件名.txt 来进行请求访问成功的话,可以得到一个字符串,通过浏览器可以看到这个字符串问题解决参考来网上提供的一些方法,最后发现有两种思路第...原创 2019-04-08 14:12:24 · 4504 阅读 · 0 评论 -
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
缺少 commons-logging-api-1.1.jar ,只要引入struts2 的基础jar包就可以避免此类问题 java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactoryat org.springframework.context.support.AbstractApplicationConte...原创 2016-09-09 13:59:11 · 5912 阅读 · 0 评论 -
Description Resource Path Location Type The prefix “p” for attribute “p:sessionFactory-ref” associat
Description Resource Path Location Type The prefix “p” for attribute “p:sessionFactory-ref” associated with an element type “beans:bean” is not bound在xml配置文件中加入xmlns:p="http://www.springframework....原创 2015-12-25 09:56:06 · 3688 阅读 · 0 评论 -
expected at least 1 bean which qualifies as autowire candidate for this depe
expected at least 1 bean which qualifies as autowire candidate for this depe spring中配置文件缺少配置原创 2015-12-08 10:21:26 · 9721 阅读 · 4 评论 -
org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before
org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): com.sinosoft.ebusiness.paymentplatform.model.PayInfo 就是在saveorupdate的时候,没有定...原创 2016-01-23 17:47:54 · 629 阅读 · 0 评论 -
Spring Bean相互注入 java.lang.StackOverflowError Requested bean is currently in creation: Is there an u
总述:Spring 相互引用注入会报错不要构建成bean1引用bean2,然后bean2直接引用bean1或者间接引用bean1的情况,Spring 会报错,会造成bean的调用形成死循环如果使用构造器注入,Requested bean is currently in creation: Is there an unresolvable circular reference?如果...原创 2017-06-16 16:17:58 · 14054 阅读 · 0 评论 -
SpringMVC Resource interpreted as Script but transferred with MIME type application/octet-stream:
Spring MVC 页面加载 js文件的时候,Chrome 浏览器的console提示意思是说,本来浏览器请求的是Script文件,即js文件,但是服务器返回的是文本文件 Resource interpreted as Script but transferred with MIME type application/octet-stream: 具体截图尽管不影响...原创 2017-02-19 23:16:18 · 3598 阅读 · 0 评论 -
Element type "bean" must be followed by either attribute specifications, ">"
报错Multiple annotations found at this line:- Start tag of element <bean>- Element type "bean" must be followed by either attribute specifications, ">" 这个问题不应该写一篇文章,但是的确是细节很重要。 这...原创 2017-09-15 10:49:25 · 8970 阅读 · 0 评论 -
INSERT 语句 增加条件,条件成立插入,否则不插入
问题描述:遇到一个sql插入的场景,就是在sql插入新数据的时候,直接在sql中判断条件是否满足,如果条件不满足则不插入新数据,某则插入新数据。这里的场景是给用户发放金币,那么就有两个问题是需要注意的1、用户可以领取的金币总数有限制2、总共发送出去的金币总数有限制问题解决:·业务问题的本质先从业务场景中提取出一般性的问题,即 insert 语句中增加一些条件语句。...原创 2017-06-07 03:09:29 · 56979 阅读 · 14 评论 -
代码编写技巧
1、update/insert 方法使用技巧update执行完毕后要判断是否执行成功,即update的条数是否符合预期,如果不符合则主动抛出异常,throws Exception方法体 throws Exception 具体update或者insert int num= demoDao.updateDemoVo(demoVo); i...原创 2017-06-04 10:35:08 · 570 阅读 · 0 评论 -
遇到的经典问题+不断积累
目录java.lang.NoSuchMethodError: org.springframework.util.Assert.isTrue(ZLjReferences to interface static methods are allowed only at source level 1.8org.springframework.web.HttpMediaType...原创 2017-12-12 16:40:09 · 9073 阅读 · 0 评论 -
常用技术代码或问题快现-不断更新中
常用技术代码快现-不断更新中1、struts2的actionSupport获取web.xml中的配置参数第一步:web.xml设置 <context-param> <param-name>getURL</param-name> <param-value>https://www.baidu.com</param-...原创 2016-12-16 10:22:22 · 3204 阅读 · 0 评论 -
分期利息计算——考虑免息日期和多利率设定的思路设计和代码实现
文章目录前言需求描述思路描述前言利息计算是一种常见的需求,尤其在现在这种分期还款场景比较常见的情况下。需求描述用户可以分期归还利息多期,每一期利率不同,天数不同利息计算以本金为基准,不设置利滚利可以设置免息日,免息日内不计算利息第一期和免息日起始时间是同一天思路描述为分期利率设置数据结构import org.apache.commons.lang.builder...原创 2019-02-12 22:30:01 · 1085 阅读 · 0 评论