一、该问题的重现步骤是什么?
1. bladex 4.1.0版本,最近公司的的产品需要用国产化组件,我们的项目原来使用的是springboot内置的tomcat,需要用tongweb做替换。使用的是TongWeb_V8.0嵌入式版
2. 问下是否存在兼容性问题
3.
二、你期待的结果是什么?实际看到的又是什么?
报错:
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
com.tongweb.springboot.starter.TongWebStarter.onStartup(TongWebStarter.java:31)
The following method did not exist:
'void org.springframework.boot.web.servlet.ServletContextInitializer.onStartup(javax.servlet.ServletContext)'
The calling method's class, com.tongweb.springboot.starter.TongWebStarter, was loaded from the following location:
jar:file:/D:/jars/repository/com/tongweb/springboot/tongweb-spring-boot-starter-2.x/8.0.E.2/tongweb-spring-boot-starter-2.x-8.0.E.2.jar!/com/tongweb/springboot/starter/TongWebStarter.class
The called method's class, org.springframework.boot.web.servlet.ServletContextInitializer, is available from the following locations:
jar:file:/D:/jars/repository/org/springframework/boot/spring-boot/3.2.7/spring-boot-3.2.7.jar!/org/springframework/boot/web/servlet/ServletContextInitializer.class
The called method's class hierarchy was loaded from the following locations:
org.springframework.boot.web.servlet.ServletContextInitializer: file:/D:/jars/repository/org/springframework/boot/spring-boot/3.2.7/spring-boot-3.2.7.jar
Action:
Correct the classpath of your application so that it contains compatible versions of the classes com.tongweb.springboot.starter.TongWebStarter and org.springframework.boot.web.servlet.ServletContextInitializer
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
java.util.concurrent.ExecutionException: com.tongweb.container.LifecycleException: Failed to start component [StandardEngine[TongWeb].StandardHost[localhost].TongWebEmbedContext[]]
at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:na]
at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[na:na]
at com.tongweb.container.core.ContainerBase.startInternal(ContainerBase.java:741) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.core.StandardHost.startInternal(StandardHost.java:705) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.util.LifecycleBase.start(LifecycleBase.java:155) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.core.ContainerBase$StartChild.call(ContainerBase.java:1188) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.core.ContainerBase$StartChild.call(ContainerBase.java:1178) ~[tongweb-embed-core-8.0.E.2.jar:na]
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264) ~[na:na]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java) ~[na:na]
at com.tongweb.web.util.threads.InlineExecutorService.execute(InlineExecutorService.java:59) ~[tongweb-embed-core-8.0.E.2.jar:na]
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145) ~[na:na]
at com.tongweb.container.core.ContainerBase.startInternal(ContainerBase.java:734) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.core.StandardEngine.startInternal(StandardEngine.java:195) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.util.LifecycleBase.start(LifecycleBase.java:155) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.core.StandardService.startInternal(StandardService.java:399) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.util.LifecycleBase.start(LifecycleBase.java:155) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.core.StandardServer.startInternal(StandardServer.java:862) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.util.LifecycleBase.start(LifecycleBase.java:155) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.startup.ServletContainer.start(ServletContainer.java:425) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.springboot.starter.TongWebServer.initialize(TongWebServer.java:88) ~[tongweb-spring-boot-starter-2.x-8.0.E.2.jar:na]
at com.tongweb.springboot.starter.TongWebServer.
at com.tongweb.springboot.starter.TongWebServletWebServerFactory.getTongWebServer(TongWebServletWebServerFactory.java:886) ~[tongweb-spring-boot-starter-2.x-8.0.E.2.jar:na]
at com.tongweb.springboot.starter.TongWebServletWebServerFactory.getWebServer(TongWebServletWebServerFactory.java:273) ~[tongweb-spring-boot-starter-2.x-8.0.E.2.jar:na]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.createWebServer(ServletWebServerApplicationContext.java:188) ~[spring-boot-3.2.7.jar:3.2.7]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.onRefresh(ServletWebServerApplicationContext.java:162) ~[spring-boot-3.2.7.jar:3.2.7]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:618) ~[spring-context-6.1.10.jar:6.1.10]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.2.7.jar:3.2.7]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.2.7.jar:3.2.7]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.2.7.jar:3.2.7]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) ~[spring-boot-3.2.7.jar:3.2.7]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:149) ~[spring-boot-3.2.7.jar:3.2.7]
at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:59) ~[blade-core-launch-4.1.0.RELEASE.jar:4.1.0.RELEASE]
at org.springblade.auth.AuthApplication.main(AuthApplication.java:44) ~[classes/:na]
Caused by: com.tongweb.container.LifecycleException: Failed to start component [StandardEngine[TongWeb].StandardHost[localhost].TongWebEmbedContext[]]
at com.tongweb.container.util.LifecycleBase.handleSubClassException(LifecycleBase.java:403) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.util.LifecycleBase.start(LifecycleBase.java:170) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.core.ContainerBase$StartChild.call(ContainerBase.java:1188) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.core.ContainerBase$StartChild.call(ContainerBase.java:1178) ~[tongweb-embed-core-8.0.E.2.jar:na]
at java.base/java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:264) ~[na:na]
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java) ~[na:na]
at com.tongweb.web.util.threads.InlineExecutorService.execute(InlineExecutorService.java:59) ~[tongweb-embed-core-8.0.E.2.jar:na]
at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145) ~[na:na]
at com.tongweb.container.core.ContainerBase.startInternal(ContainerBase.java:734) ~[tongweb-embed-core-8.0.E.2.jar:na]
... 30 common frames omitted
Caused by: java.lang.NoSuchMethodError: 'void org.springframework.boot.web.servlet.ServletContextInitializer.onStartup(javax.servlet.ServletContext)'
at com.tongweb.springboot.starter.TongWebStarter.onStartup(TongWebStarter.java:31) ~[tongweb-spring-boot-starter-2.x-8.0.E.2.jar:na]
at com.tongweb.container.core.StandardContext.startInternal(StandardContext.java:4422) ~[tongweb-embed-core-8.0.E.2.jar:na]
at com.tongweb.container.util.LifecycleBase.start(LifecycleBase.java:155) ~[tongweb-embed-core-8.0.E.2.jar:na]
... 37 common frames omitted
四、请提供详细的错误堆栈信息,这很重要。
五、若有更多详细信息,请在下面提供。
你需要把你的详细配置列出来,否则我们无法重现
东风通好像是付费的,你们有license.dat不,我的license.dat不知道能不能给啊
你们可以先在一个基础的springboot原生工程(不引入bladex),集成他试试,如果成功了,再用同样的配置集成到bladex。如果基础工程集成遇到问题,应该是可以找他们的技术人员协助的。
我改了自己写的业务模块是可以的,按照通用的方法改认证模块不行。看报错有点像兼容性问题,我也同步在咨询东风通的技术
bladex默认是排除掉了tomcat然后引入了undertow,你看看是不是有依赖没排除干净
有没有pom文件中的
<dependency>
用来排除undertow
在根目录这样配置排除然后引入东方通
还是一样的报错
已处理,是兼容性问题,东方通的3.x版本和springboot3.2.7兼容。我刚刚用的东方通的2.x版本
扫一扫访问 Blade技术社区 移动端