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 ...
随机推荐
- DotNetCore深入了解之一Startup类
一个典型的ASP.NET Core应用程序会包含Program与Startup两个文件.Program类中有应用程序的入口方法Main,其中的处理逻辑通常是创建一个WebHostBuilder,再生成 ...
- ③JSP经典回顾
jsp概述 jsp实际就是一个高级servlet,比servlet容易很多.jsp/servlet在jsp容器中运行.例如,Tomcat就是一个Servlet/jsp容器. 关于tomcat:[传送门 ...
- .Net和C#介绍
一.前言 本文主要针对刚入门以及还需要对基础进行恶补一下的兄弟进行基础介绍,并尽可能的做到客观,如有错误也虚心接受高手门的纠正. 二..Net平台简介 .net即DotNet,首先我先给出微软的定义: ...
- MySQL SQL语句执行顺序
MySQL的语句一共分为11步,如下图所标注的那样,最先执行的总是FROM操作,最后执行的是LIMIT操作.其中每一个操作都会产生一张虚拟的表,这个虚拟的表作为一个处理的输入,只是这些虚拟的表对用户来 ...
- RabbitMQ系列(一)RabbitMQ在Ubuntu上的环境搭建
环境配置 Ubuntu Server 18.04 RabbitMQ 3.6.10 安装之前 我们使用apt-get进行RabbitMQ安装,在安装之前,强烈建议您把apt源换位国内,大大增加下载安装的 ...
- 不规范的json文档 转化成 java 对象的处理
最近练习爬取数据,遇到了json文档中属性名称没有用双引号的情况,内容如下: 标准的json文档,属性名称都是带双引号的 最后写了个方法,替换属性名字 为 两头追加双引号的属性名字, 特别要注意,防止 ...
- 仿照 ButterKnife 的 Android 注解实例
什么是注解 java.lang.annotation,接口 Annotation,在JDK5.0及以后版本引入. 注解处理器是 javac 的一个工具,它用来在编译时扫描和处理注解(Annotatio ...
- Centos-7修改yum源为国内的yum源
以centos7为例 ,以 修改为阿里的yum源 1. 备份本地yum源 [root@localhost yum.repos.d]# cp CentOS-Base.repo CentOS-Base.r ...
- TensorFlow中的Placement启发式算法模块——Placer
背景 [作者:DeepLearningStack,阿里巴巴算法工程师,开源TensorFlow Contributor] 受限于单个Device的计算能力和存储大小,许多深度学习模型都有着使用模型分片 ...
- mysql中的prepare介绍和应用
简单的用set或者declare语句定义变量,然后直接作为sql的表名是不行的,mysql会把变量名当作表名.在其他的sql数据库中也是如此,mssql的解决方法是将整条sql语句作为变量,其中穿插变 ...