栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

SpringBoot引入第三方jar包

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SpringBoot引入第三方jar包

SpringBoot引入第三方jar包
  • resources目录下新建一个lib包
  • 将第三方jar包放进去
  • 配置pom
  
        
            dingtalk
            dingtalk
            1.0
            system
            ${project.basedir}/src/main/resources/lib/taobao-sdk-java-auto_1479188381469-20211014.jar
            
        

  • 刷新maven 本地可以运行 部署就报错
Caused by: java.lang.IllegalStateException: Failed to introspect Class [com.itts.project.dingtalk.util.DingTalkUtil] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@2e0fa5d3]
	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:481)
	at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:321)
	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:267)
	... 26 common frames omitted
Caused by: java.lang.NoClassDefFoundError: com/dingtalk/api/DingTalkClient
	at java.lang.Class.getDeclaredMethods0(Native Method)
	at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
	at java.lang.Class.getDeclaredMethods(Class.java:1975)
	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:463)
	... 28 common frames omitted
Caused by: java.lang.ClassNotFoundException: com.dingtalk.api.DingTalkClient
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:92)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	... 32 common frames omitted
解决方案

        ${project.artifactId}
        
            
                org.springframework.boot
                spring-boot-maven-plugin
                
                    自己的class主启动类名
                    
                    true
                
                
        
    
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/354065.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号