
spring
xuforeverlove
在这里希望学到很多知识。。。
展开
-
Spring的定时任务@Scheduled,部署后执行加载两次
最近公司让做定时抓取新闻的一个定时,一切都部署好后,发现每次都加载了两次。配置文件都检查了,也没发现问题。1.注解的配置 <!-- 启用注解定时 --> <task:annotation-driven scheduler="myScheduler"/> <task:scheduler id="myScheduler" pool-size="1...原创 2017-07-18 19:45:49 · 4462 阅读 · 0 评论 -
Quartz-Spring集成Quartz通过XML配置的方式
目录概述Maven依赖步骤1 创建JobDteail2 创建Trigger3 创建Scheduler示例-MethodInvokingJobDetailFactoryBean示例-JobDetailFactoryBean概述Spring为创建Quartzde Scheduler、Trigger和JobDetail提供了方便的FactoryBean类,以便能够...转载 2018-07-19 15:45:17 · 1503 阅读 · 0 评论 -
Error creating bean with name 'convCommentServiceImpl': Unsatisfied dependency expressed through f
2018-07-13 14:11:27.104 [RMI TCP Connection(5)-127.0.0.1] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.UnsatisfiedDependencyE...原创 2018-07-13 15:40:27 · 4469 阅读 · 1 评论 -
Spring获取ApplicationContext的工具类
工具类实现ApplicationContextAware接口,并重写setApplicationContext(ApplicationContext applicationContext)方法,在工具类中使用@Component注解让spring进行管理。spring容器在启动的时候,会调用setApplicationContext()方法将ApplicationContext 对象设置进去。...原创 2018-08-09 16:37:14 · 2471 阅读 · 0 评论 -
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 3 字节的 UTF-8 序列的字节 2 无效。
启动项目报: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring-mvc.xml]; nested exception is com.sun.org.apache.xerces.in...原创 2018-08-24 17:28:06 · 997 阅读 · 0 评论 -
spring的@Autowired 和 @Resource 两种注解的区别
在面试的时候,面试官问我@Autowired 和 @Resource 两种注解的区别,当时懵逼了,虽然是经常用,但具体区别还真是不知道。然后搜百度记录下。。。一、相同点 1. 都是用来装配 Bean,都可以写在字段上,或者写在 setter 方法上。二、不同点 @Autowired是Spring提供的注解,需要导入包org.springframework....原创 2018-10-22 12:08:39 · 289 阅读 · 0 评论 -
java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lan
(1)其他配置都ok的情况下,运行项目报:java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long错误。弄了半天才发现是jar问题。 (2)解决方法 原来jar包版本和M...原创 2018-11-01 18:50:21 · 15396 阅读 · 3 评论