报错:Failed to start bean ‘webServerStartStop‘; nested exception is java.lang.NoClassDefFoundError:

报错:Failed to start bean ‘webServerStartStop’; nested exception is java.lang.NoClassDefFoundError: org/wildfly/common/net/CidrAddressTable

启动项目报错如下:

在这里插入图片描述


报错:

2022-09-08 11:49:29 [main] INFO  c.b.d.d.DynamicRoutingDataSource
 - dynamic-datasource all closed success,bye
2022-09-08 11:49:29 [main] ERROR o.s.boot.SpringApplication
 - Application run failed
org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is java.lang.NoClassDefFoundError: org/wildfly/common/net/CidrAddressTable
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181)
	at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:54)
	at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356)
	at org.springframework.context.support.DefaultLifecycleProcessor$$Lambda$1341/7788116.accept(Unknown Source)
	at java.lang.Iterable.forEach(Iterable.java:75)
	at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:155)
	at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:123)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:935)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:771)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:763)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:438)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:339)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1329)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1318)
	at com.skeqi.SQApplication.main(SQApplication.java:16)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:64)
Caused by: java.lang.NoClassDefFoundError: org/wildfly/common/net/CidrAddressTable
	at org.xnio.XnioWorker$Builder.<init>(XnioWorker.java:1040)
	at org.xnio.Xnio.createWorkerBuilder(Xnio.java:430)
	at org.xnio.Xnio.createWorker(Xnio.java:477)
	at org.xnio.Xnio.createWorker(Xnio.java:463)
	at org.xnio.Xnio.createWorker(Xnio.java:450)
	at io.undertow.Undertow.start(Undertow.java:125)
	at org.springframework.boot.web.embedded.undertow.UndertowWebServer.start(UndertowWebServer.java:130)
	at org.springframework.boot.web.servlet.context.WebServerStartStopLifecycle.start(WebServerStartStopLifecycle.java:43)
	at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:178)
	... 21 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.wildfly.common.net.CidrAddressTable
	at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 30 common frames omitted

Process finished with exit code 1


原因分析:

分析猜想:1、pom文件缺少依赖 2、找不到webServerStartStop的bean

全局搜org.wildfly.common 发现在pom文件中,其被排除了;奇怪,我没有手动加exclusions,噢,可能是因为之前选中想要忽略的类右键->Mark Derictory as -> excluded时,idea自动加了exclusion


解决方案:

提示:这里填写该问题的具体解决方案:

在pom.xml中注释或者删除exclusions:

<!--            <exclusions>-->
<!--                <exclusion>-->
<!--                    <artifactId>wildfly-common</artifactId>-->
<!--                    <groupId>org.wildfly.common</groupId>-->
<!--                </exclusion>-->
<!--            </exclusions>-->
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值