- 浏览: 2493698 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Trouble Shooting(1)AOP Configuration
Today, once I configured AOP around to my spring project. It gives me this kind of error message.
Error Message:
java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
Solution:
Mostly, this is because of the parameters error. I put 3 parameters in my around method. But I only got 2 in the configuration file. That is the root cause. After I changed my configuration, my files are as follow:
<aop:aspect ref="advisor_catalogControllerImpl_search">
<aop:pointcut id="catalogControllerImpl_search" expression="execution(* com.sillycat.graphite.web.controller.impl.CatalogControllerImpl.search(..)) and args(request,response,..)"/>
<aop:before pointcut-ref="catalogControllerImpl_search" method="adviceBefore"/>
<aop:around pointcut-ref="catalogControllerImpl_search" method="adviceAround"/>
<aop:after-returning pointcut-ref="catalogControllerImpl_search" returning="modelAndView" method="adviceAfterReturning"/>
</aop:aspect>
<bean id="advisor_catalogControllerImpl_search" class="com.sillycat.graphite.web.customization.CustomCabelasCatalogController_search"/>
public class CustomCabelasCatalogController_search extends
ControllerAdvisorBase {
…snip…
}
public class ControllerAdvisorBase {
public void runBefore(HttpServletRequest request, HttpServletResponse response) {
// Need to be customized by store
}
public void runAfterReturning(HttpServletRequest request, HttpServletResponse response, ModelAndView modelAndView) {
// Need to be customized by store
}
public Object runAround(ProceedingJoinPoint joinPoint, HttpServletRequest request, HttpServletResponse response) throws Throwable {
// Need to be customized by store
return joinPoint.proceed();
}
public final void adviceBefore(JoinPoint jp, HttpServletRequest request, HttpServletResponse response) {
log("Entering", jp, null);
runBefore(request, response);
}
public final void adviceAfterReturning(JoinPoint jp, HttpServletRequest request, HttpServletResponse response, ModelAndView modelAndView) {
log("Exiting", jp, modelAndView);
runAfterReturning(request, response, modelAndView);
}
public final Object adviceAround(ProceedingJoinPoint jp, HttpServletRequest request, HttpServletResponse response) throws Throwable {
log("Around", jp, null);
return runAround(jp, request, response);
}
private void log(String prefix, JoinPoint jp, ModelAndView modelAndView) {
StringBuilder sb = new StringBuilder();
sb.append(prefix).append(" ").append(jp.toString());
if (logger.isDebugEnabled()) {
Object[] args = jp.getArgs();
if (args != null && args.length != 0) {
sb.append(" with ").append(args.length).append(" args.\n");
for (int i = 0; i < args.length; ++i)
sb.append("args[").append(i).append("]: ").append(args[i]).append("\n");
}
if (modelAndView != null)
sb.append("Returned ").append(modelAndView);
logger.debug(sb.toString());
} else
logger.info(sb.toString());
}
...snip...
}
references:
http://forum.springsource.org/showthread.php?62460-Formal-unbound-in-pointcut
Today, once I configured AOP around to my spring project. It gives me this kind of error message.
Error Message:
java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
Solution:
Mostly, this is because of the parameters error. I put 3 parameters in my around method. But I only got 2 in the configuration file. That is the root cause. After I changed my configuration, my files are as follow:
<aop:aspect ref="advisor_catalogControllerImpl_search">
<aop:pointcut id="catalogControllerImpl_search" expression="execution(* com.sillycat.graphite.web.controller.impl.CatalogControllerImpl.search(..)) and args(request,response,..)"/>
<aop:before pointcut-ref="catalogControllerImpl_search" method="adviceBefore"/>
<aop:around pointcut-ref="catalogControllerImpl_search" method="adviceAround"/>
<aop:after-returning pointcut-ref="catalogControllerImpl_search" returning="modelAndView" method="adviceAfterReturning"/>
</aop:aspect>
<bean id="advisor_catalogControllerImpl_search" class="com.sillycat.graphite.web.customization.CustomCabelasCatalogController_search"/>
public class CustomCabelasCatalogController_search extends
ControllerAdvisorBase {
…snip…
}
public class ControllerAdvisorBase {
public void runBefore(HttpServletRequest request, HttpServletResponse response) {
// Need to be customized by store
}
public void runAfterReturning(HttpServletRequest request, HttpServletResponse response, ModelAndView modelAndView) {
// Need to be customized by store
}
public Object runAround(ProceedingJoinPoint joinPoint, HttpServletRequest request, HttpServletResponse response) throws Throwable {
// Need to be customized by store
return joinPoint.proceed();
}
public final void adviceBefore(JoinPoint jp, HttpServletRequest request, HttpServletResponse response) {
log("Entering", jp, null);
runBefore(request, response);
}
public final void adviceAfterReturning(JoinPoint jp, HttpServletRequest request, HttpServletResponse response, ModelAndView modelAndView) {
log("Exiting", jp, modelAndView);
runAfterReturning(request, response, modelAndView);
}
public final Object adviceAround(ProceedingJoinPoint jp, HttpServletRequest request, HttpServletResponse response) throws Throwable {
log("Around", jp, null);
return runAround(jp, request, response);
}
private void log(String prefix, JoinPoint jp, ModelAndView modelAndView) {
StringBuilder sb = new StringBuilder();
sb.append(prefix).append(" ").append(jp.toString());
if (logger.isDebugEnabled()) {
Object[] args = jp.getArgs();
if (args != null && args.length != 0) {
sb.append(" with ").append(args.length).append(" args.\n");
for (int i = 0; i < args.length; ++i)
sb.append("args[").append(i).append("]: ").append(args[i]).append("\n");
}
if (modelAndView != null)
sb.append("Returned ").append(modelAndView);
logger.debug(sb.toString());
} else
logger.info(sb.toString());
}
...snip...
}
references:
http://forum.springsource.org/showthread.php?62460-Formal-unbound-in-pointcut
发表评论
-
Update Site will come soon
2021-06-02 04:10 1619I am still keep notes my tech n ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 383Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 383Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 338Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 407VPN Server 2020(2)Docker on Cen ... -
Nginx Deal with OPTIONS in HTTP Protocol
2020-02-15 01:33 307Nginx Deal with OPTIONS in HTTP ... -
PDF to HTML 2020(1)pdftohtml Linux tool or PDFBox
2020-01-29 07:37 349PDF to HTML 2020(1)pdftohtml Li ... -
Elasticsearch Cluster 2019(2)Kibana Issue or Upgrade
2020-01-12 03:25 606Elasticsearch Cluster 2019(2)Ki ... -
Spark Streaming 2020(1)Investigation
2020-01-08 07:19 236Spark Streaming 2020(1)Investig ... -
Hadoop Docker 2019 Version 3.2.1
2019-12-10 07:39 260Hadoop Docker 2019 Version 3.2. ... -
MongoDB 2019(3)Security and Auth
2019-11-16 06:48 208MongoDB 2019(3)Security and Aut ... -
MongoDB 2019(1)Install 4.2.1 Single and Cluster
2019-11-11 05:07 255MongoDB 2019(1) Follow this ht ... -
Monitor Tool 2019(1)Monit Installation and Usage
2019-10-17 08:22 291Monitor Tool 2019(1)Monit Insta ... -
Ansible 2019(1)Introduction and Installation on Ubuntu and CentOS
2019-10-12 06:15 276Ansible 2019(1)Introduction and ... -
Timezone and Time on All Servers and Docker Containers
2019-10-10 11:18 298Timezone and Time on All Server ... -
Kafka Cluster 2019(6) 3 Nodes Cluster on CentOS7
2019-10-05 23:28 242Kafka Cluster 2019(6) 3 Nodes C ... -
K8S Helm(1)Understand YAML and Kubectl Pod and Deployment
2019-10-01 01:21 292K8S Helm(1)Understand YAML and ... -
Rancher and k8s 2019(5)Private Registry
2019-09-27 03:25 330Rancher and k8s 2019(5)Private ... -
Jenkins 2019 Cluster(1)Version 2.194
2019-09-12 02:53 410Jenkins 2019 Cluster(1)Version ... -
Redis Cluster 2019(3)Redis Cluster on CentOS
2019-08-17 04:07 339Redis Cluster 2019(3)Redis Clus ...
相关推荐
7702-010 trouble shooting guide
HP-UX Trouble shooting 课程的PPT.各版本通用
ITM trouble shooting
DB Issue Trouble Shooting Guideline 很经典的数据结构资料
Mailrouting Trouble shooting lotus domino 8
tas58x5 trouble shooting
trouble shooting java performance 英文原版带书签。
HANA 2.0 trouble shooting guide. HANA调优可以参考此文档。
NULL 博文链接:https://aga.iteye.com/blog/298106
西门子双源CT维修手册
Akamai Techincal Trouble Shooting Sharing copy.pdf
try this doc,. it has great detail of MPLS trouble shotting techniques
这是第二部分,详细以trouble shooting为主。方便想看原版的朋友
PI问题解决文档,包括各个组件资料。文档内容详细...
weblogic 常见问题 TROUBLE_SHOOTING
数字钼靶机MAMMOMAT Novation_Trouble_shooting
arp spoofer.it is help ful for trouble shooting network
Modbus expalnation pdf boook rs485 20 words a a d f
Trouble_Shooting_JavaScript