Bean named '...' is expected to be of type [...] but was actually of type [com.sun.proxy.$Proxy7解决方法
报错
三月 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解决方法的更多相关文章
- The return type is incompatible with JspSourceDependent.getDependants():JasperException问题分析与解决方法
Linux下基于JSP的报表集成到项目中后,显示不出来,查看tomcat的日志.有例如以下报错信息: The return type is incompatible with JspSourceDep ...
- 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- ...
- Type.GetType()在跨程序集反射时返回null的解决方法
在开发中,经常会遇到这种情况,在程序集A.dll中需要反射程序集B.dll中的类型.如果使用稍有不慎,就会产生运行时错误.例如使用Type.GetType("BNameSpace.Class ...
- 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" ...
- 关于在调用JAVAFX相关包时遇到Access restriction: The type 'Application' is not API (restriction on required library)的解决方法
点击工具栏的Project->Properties->Java Build Path->Libraries-> 双击第一项 点击Add添加允许javafx 然后就不会报错了
- variable '' of type '' referenced from scope '', but it is not defined 异常解决方法
最近在做一个功能,通过拼接lamdba表达试来实现的功能,但测试时总是出现一个错误,如下图所示,网上也找不到答案,差点都放弃了.. 如上图图所示,我是想通过一个lamdba表达式(上图的IdField ...
- 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 ...
- 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 ...
- 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 ...
随机推荐
- Java 并发编程-NIO 简明教程
问题来源 在传统的架构中,对于客户端的每一次请求,服务器都会创建一个新的线程或者利用线程池复用去处理用户的一个请求,然后返回给用户结果,这样做在高并发的情况下会存在非常严重的性能问题:对于用户的每一次 ...
- eclipse使用maven打包的时候发现静态资源没包含进去
今天在打包的时候,发现传上去的包里没有配置静态资源. (右键项目--->Run As ---> 8 Maven install ) 后来发现是因为在pom.xml里没有配置打包静态资源的 ...
- Perl列表相关函数
内置的列表函数有: grep, join, map, qw//, reverse, sort, unpack join:将多个元素使用给定字符串联起来join grep:从列表中筛选符合条件的元素执行 ...
- python可变对象和不可变对象的解释
数据类型分为可变.不可变.可变对象表示可以原处修改该数据对象,不可变对象表示必须创建新对象来保存修改后的数据. 在基础数据类型中: 数值.字符串.元组.frozenset是不可变对象 列表.set.d ...
- 关于 Uboot 中有趣的 0xdeadbeef 填充
在 Uboot 的 Start.S 中存在以下源码: .globl _start _start: b start_code ldr pc, _undefined_instruction ldr pc, ...
- CoreJava(一)—— Java迭代语句
本文介绍一些关于迭代语句的一些相关技巧以及Java8中的迭代语句的使用方法. public class TestBreak { public static void main(String[] arg ...
- .NET CORE实践(1)--Ubuntu下的Hello World
准备工作 使用Hyper-V安装Ubuntu16.04桌面版 因为是作为类似日记的记录,所以写的时候事无巨细,稍显啰嗦. 打开微软.NET官网 apt-get install 打开dotnetcore ...
- 第一册:lesson seventy nine.
原文: Carol's shopping list. What are you doing Carol? I'm making a shopping list Tom. What do we need ...
- 第一册:lesson seventy five。
原文: Uncomfortable Shoes. Do you have any shoes like this? What size? Size five. What color? Black. I ...
- vuex 、store、state (转载)
vuex 文档 https://vuex.vuejs.org/zh/guide/state.html