
spring
敢吹-敢喷-敢随-敢送
自己动手,丰衣足食。
展开
-
ApplicationContext is never closed
最近在学习spring,提出warning,ApplicationCOntext is never closed。感觉对程序执行并没什么影响,不过看着waring不舒服,还是搜索改了一下。ClassPathXmlApplicationContext中就有close了,但是ApplicationContext中并没有ApplicationContext applicationContext=转载 2015-07-16 14:02:10 · 2964 阅读 · 0 评论 -
spring+spring mvc框架(一)
web.xml配置<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xm原创 2017-02-27 17:21:05 · 321 阅读 · 0 评论 -
quartz卡死
这两天遇到个quartz定时任务卡死的问题,记录如下。客户端用quartz 写了几个定时任务(HttpURLConnection),去定时 从服务器 同步消息。但运维的兄弟说,重启了服务器,有两个定时任务死了。查看日志,发现8这一个线程,确实卡死了。其他的则报了请求失败的异常。我打开intellij调试,发现无论我如何停止服务,重启服务器后, 客户端都能自动连上。刚开始 我怀疑原创 2017-02-27 16:42:43 · 4668 阅读 · 0 评论 -
报错:Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
这两天自己搭spingmvc,总是报错,找不到自动注册的beanCould not autowire field: private lf.service.UserService lf.controllers.HelloController.userService; nested exception is org.springframework.beans.factory.NoSuchB原创 2017-02-24 09:32:41 · 50757 阅读 · 9 评论 -
Spring+Mina(六)
最近需要用到网络编程,找了之前的代码,慢慢分析,然后仿写。先看下MINA的配置文件application-mina.xml<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:sch原创 2016-05-25 12:05:35 · 564 阅读 · 0 评论 -
spring+shiro盐加密(五)
直接上代码:先建立一个User类public class User{ private String username; private String password; private String salt; public String getUsername() { return username; } public原创 2016-12-09 10:00:37 · 901 阅读 · 0 评论 -
spring+slf4j+logback(四)
pom.xml里面需要引用相应的jar包 org.slf4j slf4j-api 1.7.10 ch.qos.logback logback-core 1.1.1 jar原创 2017-02-28 09:42:34 · 1073 阅读 · 0 评论 -
spring+PageHelper+mybatis(三)
利用PageHelper可以很方便地对数据库查询结果进行分页pom.xml加入对PageHelper的引用 com.github.pagehelper pagehelper 3.5.0 在spring-db.xml中加入pagehelper插件的引用原创 2017-02-28 09:05:03 · 817 阅读 · 0 评论 -
@Transactional 异常并未回滚
@Transactional今天测试的同学帮忙测试出一个BUG,说是一个函数中的数据库操作执行失败,但是没有回滚。期初我很诧异,我明明加了在类上面加了事务引用,怎么没回滚。查来查去,发现是我对Transactional 了解不够清楚。默认情况下,Exception是不会引起回滚操作的,RuntimeException才会引起回滚操作。半瓶原创 2016-03-18 19:23:18 · 5719 阅读 · 0 评论 -
spring+mybatis(二)
在spring-config.xml加上 数据库的引用srping-db.xml(连接池选用DruidDataSouce)<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="htt原创 2017-02-27 17:22:14 · 263 阅读 · 0 评论