java.lang.IllegalStateException: Failed to introspect Class

异常详情

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name xxxxx

Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [classA] from ClassLoader [sun.misc.Launcher$AppClassLoader@14dad5dc]

原因

此异常原因是因为classA中使用了项目没有导入的类,从而导致类加载失败。一般来说如果使用了没有依赖的类应该会报ClassNotFindException的错误,但是如果只是导入却没有使用的使用可能就会报此错误。

通常此错误见与使用maven框架配置了第三方类的scope是provided的情况下。笔者在使用spring boot、maven时导致此错误。

解决办法

检查classA类中可能存在的没有依赖的类或者包,将之导入(或者加入maven依赖、或调整依赖的包中的依赖的scope),总之使其类加载器能够在当期classPath找到此类即可。

原文地址:https://blog.csdn.net/huitoukest/article/details/88013763https://blog.csdn.net/huitoukest/article/details/88013763

异常解决:java.lang.IllegalStateException: Failed to introspect Class的更多相关文章

  1. springboot 启动报错 java.lang.IllegalStateException: Failed to introspect annotated methods on class org

    . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ...

  2. java.lang.IllegalStateException: Failed to load ApplicationContext selenium 异常 解决

    WARN <init>, HHH000409: Using org.hibernate.id.UUIDHexGenerator which does not generate IETF R ...

  3. Spring3.x 版本和 JDK1.8 不兼容导致 java.lang.IllegalStateException: Failed to load ApplicationContext

    由于安装了 JDK1.8 的版本,最近在进行整合 Struts2+Spring+Hibernate 框架的时候,不小心导入了之前下载的 Spring 3.2.0 版本的 jar 包. 结果在运行测试用 ...

  4. junit测试时,出现java.lang.IllegalStateException: Failed to load ApplicationContext

    课程设计要求进行junit测试,我是在已经做好的ssh项目上做的测试,测试类代码如下 package com.zhang.web.services; import static org.junit.A ...

  5. java.lang.IllegalStateException: Failed to load ApplicationContext

    1.错误描述 七月 13, 2014 6:34:41 下午 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBean ...

  6. 集成JUnit测试错误java.lang.IllegalStateException: Failed to load ApplicationContext

    1 详细错误信息 java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.t ...

  7. maven单元测试报java.lang.IllegalStateException: Failed to load ApplicationContext

    报这个异常java.lang.IllegalStateException: Failed to load ApplicationContext的时候,通常是因为applicationContent.x ...

  8. 解决java.lang.IllegalStateException: The application’s PagerAdapter changed the adapter’s content

    A界面中有viewpager的动态加载,从界面A跳到界面B,再finish掉B返回A时报出此异常. java.lang.IllegalStateException: The application's ...

  9. Eclipse------使用Debug As时报错java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file:/XXX

    报错信息: java.lang.IllegalStateException: Failed to read Class-Path attribute from manifest of jar file ...

随机推荐

  1. Data Lake Analytics账号和权限体系详细介绍

    一.Data Lake Analytics介绍 数据湖(Data Lake)是时下大数据行业热门的概念:https://en.wikipedia.org/wiki/Data_lake.基于数据湖做分析 ...

  2. 【python之路9】类型定义与转换

    一.整型(int),int的作用 1.创建int类型并赋值 n = 10 或者 n = int(10)   #只要是类名加括号,都会去执行类中的 __init__()方法 n = 10,实际内部会去执 ...

  3. QT应用qmake添加应用图标

    总体解决方案: 1.搜索 [Setting the Application Icon]帮助 2.http://doc.qt.io/qt-5/appicon.html 3.可以在主pro文件中加入如下语 ...

  4. 一次web请求发生的神奇故事

    网络时代来临的时候,一个食指的点击就能解决很多问题! 那么当你的食指点击的时候,都发生了哪些神奇的事情呢?下面从几个角度为你做一个指引 1. 网络角度:一次网络请求是如何实现的 2. 浏览器角度:He ...

  5. Springboot 创建的maven获取resource资源下的文件的两种方式

    Springboot 创建的maven项目 打包后获取resource下的资源文件的两种方式: 资源目录: resources/config/wordFileXml/wordFileRecord.xm ...

  6. tcpdump抓取udp报文

    使用tcpdump命令抓取UDP 2000端口报文,并将报文保存到当前目录下的udp.cap文件,命令如下: tcpdump -i 网络接口名称 udp port 2000 -w ./udp.cap ...

  7. POJ 2078

    16ms 解法: #include <cstdio> //using namespace std; ][]; ][]; ]; ]; int n,min,max; void solve(in ...

  8. python 子类继承父类属性及实例化方法

  9. vuxdemo1

    //main.js import Vue from 'vue' import router from './router' import store from './store' import axi ...

  10. Qt qmake报错(TypeError: Property 'asciify' of object Core::Internal::UtilsJsExtension)

    问题如题. 解决方案: 第一种 用下管理员权限来打开qt creator,再创建工程.有可能是没权限创建出源码工程目录 第二种 打开qt左边的项目上,可以看到这个项目的编译路径,修改成绝对路径,或者设 ...