Home > Blockchain >  Tomcat deploy : Unable to find a single class implementing AppShellConfigurator
Tomcat deploy : Unable to find a single class implementing AppShellConfigurator

Time:03-09

During the deployment of the vaadin application in tomcat I get the exception:

06-Mar-2022 17:54:53.990 GRAVE [main] org.apache.catalina.startup.HostConfig.deployWAR Error durante el despliegue del archivo [/u01/tomcat/apache-t$
        java.lang.IllegalStateException: Error starting child
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:720)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:690)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
                at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:978)
                at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1849)
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
                at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:773)
                at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:427)
                at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1576)

              at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:366)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:936)
                at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:841)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1384)
                at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1374)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
                at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
                at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:909)
                at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:262)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.StandardService.startInternal(StandardService.java:421)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:930)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                at org.apache.catalina.startup.Catalina.start(Catalina.java:633)
                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:498)
                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:343)
                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:474)
        Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardConte$
                at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:717)
                ... 37 more
        Caused by: com.vaadin.flow.server.InvalidApplicationConfigurationException:

Unable to find a single class implementing `AppShellConfigurator` from the following candidates:
Unable to find a single class implementing `AppShellConfigurator` from the following candidates:
  com.example.application.Application
  com.example.application.views.MainLayout$AppShell

                at com.vaadin.flow.server.AppShellRegistry.setShell(AppShellRegistry.java:140)
                at com.vaadin.flow.server.startup.VaadinAppShellInitializer.lambda$init$1(VaadinAppShellInitializer.java:134)
                at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
                at java.util.stream.SortedOps$SizedRefSortingSink.end(SortedOps.java:352)
                at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:483)
                at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
                at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
                at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
                at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
                at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
                at com.vaadin.flow.server.startup.VaadinAppShellInitializer.init(VaadinAppShellInitializer.java:132)
                at com.vaadin.flow.server.startup.VaadinAppShellInitializer.initialize(VaadinAppShellInitializer.java:79)
                at com.vaadin.flow.server.startup.VaadinServletContextStartupInitializer.process(VaadinServletContextStartupInitializer.java:42)
                at com.vaadin.flow.server.startup.ClassLoaderAwareServletContainerInitializer.lambda$onStartup$2(ClassLoaderAwareServletCo ....

OS : Linux Server : 9.0.30.0 Vaadin : V 22.0.2

With version 14 of vaadin I didn't have that problem.

CodePudding user response:

As noted in the docs,

There must be a single application shell for the entire Vaadin application, so that no more than one class can implement AppShellConfigurator.

Your application has two classes implementing AppShellConfigurator.

Make sure your application has no more than a single class that implements AppShellConfigurator, and move to it the annotations: @Viewport, @PageTitle, @BodySize, @Meta, @Inline, @PWA, and @Push.

  • Related