报错


三月 07, 2017 8:09:52 下午 org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
信息: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@41cf53f9: startup date [Tue Mar 07 20:09:52 CST 2017]; root of context hierarchy
三月 07, 2017 8:09:52 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
信息: Loading XML bean definitions from class path resource [beans.xml]
Exception in thread "main" org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'helloface' is expected to be of type [com.ij34.service.Hello] but was actually of type [com.sun.proxy.$Proxy7]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:378)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1082)
at com.ij34.bean.test.main(test.java:12)



package com.ij34.aspect;

import org.aspectj.lang.annotation.*;

@Aspect
public class Autoaspect {
@Before("execution(* com.ij34.service.*.*(..))")
public void authority()
{
System.out.println("模拟执行权限检查");
}
}

解决方法:去掉 .serivce

因为这路径还没有把com.ij34.inferfaces包含在内

或者把<aop:aspectj-autoproxy/> 修改成<aop:aspectj-autoproxy proxy-target-class="true"/>

Bean named '...' is expected to be of type [...] but was actually of type [com.sun.proxy.$Proxy7解决方法的更多相关文章

  1. The return type is incompatible with JspSourceDependent.getDependants():JasperException问题分析与解决方法

    Linux下基于JSP的报表集成到项目中后,显示不出来,查看tomcat的日志.有例如以下报错信息: The return type is incompatible with JspSourceDep ...

  2. error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 解决方法

    在VS2012中生成时出错:error C4430: missing type specifier - int assumed. Note: C++ does not support default- ...

  3. Type.GetType()在跨程序集反射时返回null的解决方法

    在开发中,经常会遇到这种情况,在程序集A.dll中需要反射程序集B.dll中的类型.如果使用稍有不慎,就会产生运行时错误.例如使用Type.GetType("BNameSpace.Class ...

  4. Dynamics CRM2015 The plug-in type does not exist in the specified assembly问题的解决方法

    在用插件工具PluginProfiler调试时,报"The plug-in type  xxxx  does not exist in the specified assembly" ...

  5. 关于在调用JAVAFX相关包时遇到Access restriction: The type 'Application' is not API (restriction on required library)的解决方法

    点击工具栏的Project->Properties->Java Build Path->Libraries-> 双击第一项 点击Add添加允许javafx 然后就不会报错了

  6. variable '' of type '' referenced from scope '', but it is not defined 异常解决方法

    最近在做一个功能,通过拼接lamdba表达试来实现的功能,但测试时总是出现一个错误,如下图所示,网上也找不到答案,差点都放弃了.. 如上图图所示,我是想通过一个lamdba表达式(上图的IdField ...

  7. Spring错误之org.springframework.beans.factory.BeanNotOfRequiredTypeException: Bean named 'bookService' is expected to be of type 'pw.fengya.tx.BookService' but was actually of type 'com.sun.proxy.$Proxy1

    org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cas ...

  8. Bean named 'XXX' is expected to be of type [XXX] but was actually of type [com.sun.proxy.$Proxy7

    AOP原理 <aop:aspectj-autoproxy />声明自动为spring容器中那些配置@aspectJ切面的bean创建代理,织入切面. <aop:aspectj-aut ...

  9. Springboot2.x 启动报错:Bean named 'xxxService'... but was actually of type 'com.sun.proxy.$Proxy82'

    Springboot 2.0.5 搭建一个新项目启动后报错:Bean named 'xxxService'... but was actually of type 'com.sun.proxy.$Pr ...

随机推荐

  1. ZOJ Problem Set - 3713

    题意:给定一个字符串,用字符串ASC2码16进制数输出 ,并在前面输出字符串长度的16进制,输出长度的规则是 先输出长度的二进制数的后七位的十六进制(如果左边还有1 则这在后七位前面加上个1再输出  ...

  2. 关于EF的三种分类----CodeFirst

    新建StudentInfo.cs using System; using System.Collections.Generic; using System.ComponentModel.DataAnn ...

  3. java正则表达式的忽略大小写

    (?i)abc 表示abc都忽略大小写  a(?i)bc 表示bc忽略大小写  a((?i)b)c 表示只有b忽略大小写

  4. jvm详情——3、JVM基本垃圾回收算法回收策略

    JVM基本垃圾回收算法回收策略 引用计数(Reference Counting):比较古老的回收算法.原理是此对象有一个引用,即增加一个计数,删除一个引用则减少一个计数.垃圾回收时,只用收集计数为0的 ...

  5. webmagic 的 helloworld

    <dependency> <groupId>us.codecraft</groupId> <artifactId>webmagic-core</a ...

  6. vmware-vcsa6.5 基本管理

    这章介绍的是创建数据中心集群等操作 一.创建数据中心 创建数据中心 添加主机 创建集群 #配置ntp,上一章已经配置 #许可证,上一章已经添加,这章就不介绍了 统一存储,方便后面的识别和管理 1.创建 ...

  7. MySQL行转列

    IF(expr1,expr2,expr3) 如果 expr1 是TRUE (expr1 <> 0 and expr1 <> NULL),则 IF()的返回值为expr2; 否则 ...

  8. iOS 快速排序

    一.快速排序概念及其思想 快速排序(QuickSort),又称为交换排序,是分治算法的一种,快速排序采用分治的策略. 1.分治法的基本思想: 将原问题分解为若干个规模更小但结构和原问题相似的子问题.递 ...

  9. 小型音乐播放器插件APlayer.js的简单使用例子

      本篇博客将会给出一个小型音乐播放器插件APlayer.js的使用例子.关于APlayer.js的具体介绍和Github地址,可以参考: https://github.com/MoePlayer/A ...

  10. C#调用C++(QT5.5.1项目)的C++/CLI(CLR项目)项目技术笔记

    导航 1.编译环境 2.项目配置 1.设置附加包含目录 2.设置附加库目录 3.设置附加依赖项 3.CLR中各种定义 1.接口定义 2.类定义 3.枚举定义 4.属性定义 4.CLR中各种使用 1.类 ...