SEVERE: Unable to deploy collapsed ear in war StandardEngine[Catalina].StandardHost[localhost].StandardContext[/demo]
org.apache.openejb.OpenEJBException: Creating application failed: C:\tomee\tomee-3dspace(CAS)\webapps\demo: javax.validation.spi.ConfigurationState.getParameterNameProvider()Ljavax/validation/ParameterNameProvider;
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:843)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:677)
at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1261)
at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5472)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1091)
at org.apache.catalina.startup.HostConfig D e p l o y W a r . r u n ( H o s t C o n f i g . j a v a : 1980 ) a t j a v a . u t i l . c o n c u r r e n t . E x e c u t o r s DeployWar.run(HostConfig.java:1980) at java.util.concurrent.Executors DeployWar.run(HostConfig.java:1980)atjava.util.concurrent.ExecutorsRunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NoSuchMethodError: javax.validation.spi.ConfigurationState.getParameterNameProvider()Ljavax/validation/ParameterNameProvider;
at org.hibernate.validator.internal.engine.ValidatorFactoryImpl.(ValidatorFactoryImpl.java:146)
at org.hibernate.validator.HibernateValidator.buildValidatorFactory(HibernateValidator.java:38)
at org.apache.bval.jsr303.ConfigurationImpl.doPrivBuildValidatorFactory(ConfigurationImpl.java:252)
at org.apache.bval.jsr303.util.SecureActions$5.run(SecureActions.java:131)
at org.apache.bval.jsr303.util.SecureActions$5.run(SecureActions.java:129)
at org.apache.bval.jsr303.ConfigurationImpl.run(ConfigurationImpl.java:337)
at org.apache.bval.jsr303.ConfigurationImpl.buildValidatorFactory(ConfigurationImpl.java:244)
at org.apache.openejb.assembler.classic.ValidatorBuilder.buildFactory(ValidatorBuilder.java:77)
at org.apache.openejb.assembler.classic.ValidatorBuilder.buildFactory(ValidatorBuilder.java:47)
at org.apache.openejb.assembler.classic.LazyValidatorFactory.ensureDelegate(LazyValidatorFactory.java:53)
at org.apache.openejb.assembler.classic.LazyValidatorFactory.getFactory(LazyValidatorFactory.java:62)
at org.apache.openejb.assembler.classic.Assembler.bindValidators(Assembler.java:891)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:785)
… 18 moreSEVERE: ContainerBase.removeChild: destroy:
org.apache.catalina.LifecycleException: An invalid Lifecycle transition was attempted ([before_destroy]) for component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/demo]] in state [STARTING_PREP]
at org.apache.catalina.util.LifecycleBase.invalidTransition(LifecycleBase.java:401)
at org.apache.catalina.util.LifecycleBase.destroy(LifecycleBase.java:291)
at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:1038)
at org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1537)
at org.apache.tomee.catalina.TomcatWebAppBuilder.undeploy(TomcatWebAppBuilder.java:1518)
at org.apache.tomee.catalina.TomcatWebAppBuilder.undeployWebApps(TomcatWebAppBuilder.java:762)
at org.apache.openejb.assembler.classic.Assembler.destroyApplication(Assembler.java:1982)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:839)
at org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:677)
at org.apache.tomee.catalina.TomcatWebAppBuilder.startInternal(TomcatWebAppBuilder.java:1261)
at org.apache.tomee.catalina.TomcatWebAppBuilder.configureStart(TomcatWebAppBuilder.java:1100)
at org.apache.tomee.catalina.GlobalListenerSupport.lifecycleEvent(GlobalListenerSupport.java:130)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5472)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1091)
at org.apache.catalina.startup.HostConfig D e p l o y W a r . r u n ( H o s t C o n f i g . j a v a : 1980 ) a t j a v a . u t i l . c o n c u r r e n t . E x e c u t o r s DeployWar.run(HostConfig.java:1980) at java.util.concurrent.Executors DeployWar.run(HostConfig.java:1980)atjava.util.concurrent.ExecutorsRunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
这个错误通常表示在销毁组件时发生了无效的生命周期转换。出现这个错误可能有多种原因,以下是一些可能的解决方法:
Tomcat 7不是原生支持Spring Boot的,但你可以使用适当的配置和调整来在Tomcat 7上部署Spring Boot应用程序。以下是一些版本兼容性的建议:
请注意,尽管你可以在Tomcat 7上部署Spring Boot应用程序,但建议使用Tomcat 8或更高版本,以获得更好的性能和更好的兼容性。
这个错误通常是由于javax.validation.spi.ConfigurationState类的版本不兼容引起的。这个类是用于验证框架的一部分,但在你的环境中找不到或版本不匹配。
要解决这个问题,可以尝试以下几个步骤:
1、确认你的应用程序中使用的验证框架版本与Tomcat 7兼容。检查你的应用程序的依赖项配置文件(如pom.xml或build.gradle)中的验证框架版本,并确保与Tomcat 7兼容。
2、检查你的应用程序是否有多个验证框架的依赖项。如果你的应用程序中有多个验证框架的依赖项(如Hibernate Validator和Apache BVal),请确保它们的版本兼容,并且没有冲突。
3、确保你的应用程序中的验证框架依赖项已正确配置。检查你的应用程序的依赖项配置文件,并确保验证框架的依赖项已正确声明,并且没有遗漏或错误的版本。
4、检查你的Tomcat 7是否有其他验证框架的冲突。有时,Tomcat 7本身可能有一些验证框架的依赖项
在spring-boot-starter-web这个依赖中包含hibernate-validator,这是一个验证框架的依赖项,需将其排除掉即可部署成功
<dependency>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-webartifactId>
<exclusions>
<exclusion>
<groupId>org.hibernategroupId>
<artifactId>hibernate-validatorartifactId>
exclusion>
exclusions>
dependency>
部署可能依然不成功,原因可能是springboot版本过高,因为tomcat7版本较低,对高版本springboot并不支持
降低springboot版本
<parent>
<groupId>org.springframework.bootgroupId>
<artifactId>spring-boot-starter-parentartifactId>
<version>1.5.0.RELEASEversion>
<relativePath/>
parent>