Unable to deploy JMIX 2 Application

Hi,
I am trying to deploy JMIX 2 application in my server(Apache Tomcat/10.1.28), i have followed the documentation(Basic Deployment :: Jmix Documentation), below is my main application.

@Push
@Theme(value = "deploy-test")
@PWA(name = "Deploy Test", shortName = "Deploy Test")
@SpringBootApplication
public class DeployTestApplication extends SpringBootServletInitializer implements AppShellConfigurator {

    @Autowired
    private Environment environment;

    public static void main(String[] args) {
        SpringApplication.run(DeployTestApplication.class, args);
    }

    @Profile("!prod")
    @Bean
    @Primary
    @ConfigurationProperties("main.datasource")
    DataSourceProperties dataSourceProperties() {
        return new DataSourceProperties();
    }

    @Profile("!prod")
    @Bean
    @Primary
    @ConfigurationProperties("main.datasource.hikari")
    DataSource dataSource(final DataSourceProperties dataSourceProperties) {
        return dataSourceProperties.initializeDataSourceBuilder().build();
    }

    @Profile("prod")
    @Bean(name = "dataSource")
    @Primary
    DataSource prodDataSource(ApplicationContext context) {
        JndiDataSourceLookup lookup = new JndiDataSourceLookup();
        DataSource dataSource = lookup.getDataSource("java:comp/env/jdbc/deploy");

        // to avoid org.springframework.jmx.export.UnableToRegisterMBeanException:
        for (MBeanExporter mbeanExporter : context.getBeansOfType(MBeanExporter.class).values()) {
            if (JmxUtils.isMBean(((Object) dataSource).getClass())) {
                mbeanExporter.addExcludedBean("dataSource");
            }
        }

        return dataSource;
    }

    @EventListener
    public void printApplicationUrl(final ApplicationStartedEvent event) {
        LoggerFactory.getLogger(DeployTestApplication.class).info("Application started at "
                + "http://localhost:"
                + environment.getProperty("local.server.port")
                + Strings.nullToEmpty(environment.getProperty("server.servlet.context-path")));
    }
}

but i am still getting the following error:

08-Jan-2025 02:57:02.192 INFO [main] org.apache.catalina.core.ApplicationContext.log 1 Spring WebApplicationInitializers detected on classpath
08-Jan-2025 02:57:02.201 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing AtmosphereFramework
08-Jan-2025 02:57:02.431 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [com.vaadin.flow.server.startup.ServletContextListeners]
	java.lang.IllegalStateException: The application Lookup instance is not found in VaadinContext. The instance is supposed to be created by a ServletContainerInitializer. Issues known to cause this problem are:
- A Spring Boot application deployed as a war-file but the main application class does not extend SpringBootServletInitializer
- An embedded server that is not set up to execute ServletContainerInitializers
- Unit tests which do not properly set up the context for the test

		at com.vaadin.flow.server.startup.ApplicationConfiguration.lambda$get$0(ApplicationConfiguration.java:53)
		at com.vaadin.flow.server.VaadinServletContext.getAttribute(VaadinServletContext.java:73)
		at com.vaadin.flow.server.startup.ApplicationConfiguration.get(ApplicationConfiguration.java:47)
		at com.vaadin.flow.server.DeploymentConfigurationFactory.createPropertyDeploymentConfiguration(DeploymentConfigurationFactory.java:75)
		at com.vaadin.flow.server.startup.ServletDeployer$StubServletConfig.createDeploymentConfiguration(ServletDeployer.java:139)
		at com.vaadin.flow.server.startup.ServletDeployer.lambda$getServletConfigurations$0(ServletDeployer.java:198)
		at java.base/java.util.Optional.ifPresent(Optional.java:178)
		at com.vaadin.flow.server.startup.ServletDeployer.getServletConfigurations(ServletDeployer.java:197)
		at com.vaadin.flow.server.startup.ServletDeployer.contextInitialized(ServletDeployer.java:148)
		at com.vaadin.flow.server.startup.ServletContextListeners.contextInitialized(ServletContextListeners.java:44)
		at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3997)
		at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4424)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
		at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:599)
		at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:571)
		at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:654)
		at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:635)
		at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1889)
		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
		at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
		at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:123)
		at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:530)
		at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:421)
		at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1629)
		at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
		at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:109)
		at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:385)
		at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:332)
		at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:776)
		at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:772)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
		at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1203)
		at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1193)
		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
		at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
		at java.base/java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:145)
		at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:749)
		at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:203)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
		at org.apache.catalina.core.StandardService.startInternal(StandardService.java:415)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
		at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:874)
		at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:164)
		at org.apache.catalina.startup.Catalina.start(Catalina.java:757)
		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
		at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
		at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
		at java.base/java.lang.reflect.Method.invoke(Method.java:569)
		at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:345)
		at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)

I have attached the test application for your reference:
deploy-test.zip (1.0 MB)

And below are my tomcat configuration:

<Context>
    <Resource type="javax.sql.DataSource"
              name="jdbc/deploy"
              driverClassName="org.postgresql.Driver"
              url="jdbc:postgresql://localhost/deploy"
              username="postgres"
              password="postgres"
              maxIdle="2"
              maxTotal="20"
              maxWaitMillis="5000"
    />
</Context>

and added the following line in my tomcat/bin/setenv.sh

CATALINA_OPTS="-Dspring.profiles.active=prod"

Hi,

I’ve tested your demo project and it deploys successfully without any changes on Tomcat 10.1.34.

Make sure you don’t have other web apps in Tomcat that could produce this error message.

Also, check Java version that is used by Tomcat.

Regards,
Konstantin