Spring Messaging消息支持与Aop 其一

前天两个坑:

1.org.aspectj.apache.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18

网上说web.xml 文件里 version 升级到 3.0 并加入 metadata-complete=”true” 设置,然而并没有什么效果。升级 aspectjweaver 的版本也不管用

 

2.自定义注解对controller不生效

https://www.iteye.com/blog/phoenixfu-2037598

ContextLoaderListener加载applicationContext.xml一般是持久层和业务层的spring配置文件是父容器,DispatcherServlet加载springmvc配置文件是子容器,子容器可以获取父容器的bean对象,父容器不可获取子容器的bean。而aop要想切入controller层就要把aop配置放到Springmvc配置文件中,但这样service,dao层又切不到了,只好在Spring配置文件再复制一遍。。。嗯,不太优雅,暂时也没有更好解决方法

一个个大坑走过来项目可以使用自定义注解,当然也可以不用aop用拦截器也是一样没试过但应该差不多。

然鹅问题来了如果不是通过http访问,比如说其他线程比如说tcp这该怎么办 

为什么Autowired 为什么能注入controller 而使用@Component 使用@Autowired注入不了

 

Spring整合activemq 由于版本比较高的activemq-all的jar包中包含了spring的一些包,这会引起包的冲突 需要分别导入

类似于NoSuchMethodError这种错误,最有可能的就是jar包引入版本的问题,或者是jar包冲突

java.lang.NoSuchMethodError:org.springframework.aop.framework.AopProxyUtils.getSingletonTarget(Ljava/lang/Object;)Ljava/lang/Object;

 

自己写的activemq demo注解能生效也织入了,但是公司项目使用mqtt加线程次从activemq取数据,不出意外的没有反应。看来还是要深入源码才行,加油

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Spring Boot Messaging: Messaging APIs for Enterprise and Integration Solutions by Felipe Gutierrez English | 5 Jun. 2017 | ISBN: 1484212258 | 196 Pages | PDF | 6.36 MB Build messaging applications using the power of Spring Boot; use Spring application events over the Web; use WebSocket, SockJS, and STOMP messaging with Spring MVC; and use Spring JMS, Redis Pub/Sub and Spring AMQP for reliable messaging solutions. This book covers all the Spring Messaging APIs using Spring Boot. Written by a Pivotal engineer, Spring Boot Messaging is an authoritative guide to the many messaging APIs and how to use these for creating enterprise and integration solutions. You will learn and integrate these messaging APIs with more complex enterprise and cloud applications: for example, you will see how to use Spring Cloud Stream for creating message-driven and cloud native microservices. In addition, you’ll discover the new Spring Integration DSL and use it with Spring Cloud Stream to build integration solutions using every enterprise integration pattern. Finally, you’ll see Spring Reactor and Spring Cloud to take your application to the next level. After reading this book, you will come away with a case study application walk-through and will be able to use it as a template for building your own Spring messaging applications or messaging features within your enterprise or cloud application. What You'll Learn Use the main Spring messaging APIs with Spring Framework 5 Build messaging applications over the Web Use WebSocket, SockJS, and STOMP messaging Integrate Spring JMS and Spring AMQP into your applications Work with Spring Cloud Stream and microservices Who This Book Is For Enterprise Java developers who have at least some previous experience with the Spring Framework and/or the Spring platform.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值