Spring boot IllegalStateException:未能内省类
我试图在我的SpringBoot应用程序上实现扩展功能,@ComponentScan应该在类路径中的一个单独的jar中扫描bean定义 @ComponentScan如下所示Spring boot IllegalStateException:未能内省类,spring-boot,websphere-liberty,ibm-jdk,Spring Boot,Websphere Liberty,Ibm Jdk,我试图在我的SpringBoot应用程序上实现扩展功能,@ComponentScan应该在类路径中的一个单独的jar中扫描bean定义 @ComponentScan如下所示 @ComponentScan({"com.myapp.rest","com.mycompany.search.rest"}) 其中包“com.mycompany.search.rest”将出现在外部jar ESExt.jar中 我在WebSphereLiberty服务器的server
@ComponentScan({"com.myapp.rest","com.mycompany.search.rest"})
其中包“com.mycompany.search.rest”将出现在外部jar ESExt.jar中
我在WebSphereLiberty服务器的server.xml
文件中添加了以下配置,以包括用于类路径扫描的外部文件夹
<library id="extention" apiTypeVisibility="+third-party, -api">
<fileset dir="${server.config.dir}/ext" includes="*.jar" scanInterval="5s" />
</library>
<webApplication id="Myapp" location="Myapp.war" type="war" name="Myapp" contextRoot="/resources">
<classloader commonLibraryRef="extention" />
</webApplication>
下面是jar-tf ESExt.jar的输出
META-INF/
META-INF/MANIFEST.MF
com/
com/mycompany/
com/mycompany/search/
com/mycompany/search/rest/
com/mycompany/search/rest/StoreResource.class
此异常
IllegalStateException:Failed to introspect Class
甚至是什么意思?我甚至在互联网上找不到任何关于它的信息。通过如下更改server.xml解决了这个问题
<library id="extension">
<fileset dir="${server.config.dir}/ext" includes="*.jar" scanInterval="5s" />
</library>
<webApplication id="Myapp" location="Myapp.war" type="war" name="Myapp" contextRoot="/resources">
<classloader commonLibraryRef="extension" delegation="parentFirst"/>
</webApplication>
<library id="extension">
<fileset dir="${server.config.dir}/ext" includes="*.jar" scanInterval="5s" />
</library>
<webApplication id="Myapp" location="Myapp.war" type="war" name="Myapp" contextRoot="/resources">
<classloader commonLibraryRef="extension" delegation="parentFirst"/>
</webApplication>