vaadin / vaadin/spring

Make the error message to be more informative

Open
#724 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
186
Forks
98
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
If you configure a starter project from start.vaadin.com to produce a war and deploy it to Tomcat 8, you get

25-Feb-2021 10:16:32.356 INFO [localhost-startStop-3] org.apache.catalina.core.ApplicationContext.log 1 Spring WebApplicationInitializers detected on classpath
25-Feb-2021 10:16:32.363 INFO [localhost-startStop-3] org.apache.catalina.core.ApplicationContext.log Initializing AtmosphereFramework
25-Feb-2021 10:16:32.698 SEVERE [localhost-startStop-3] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [com.vaadin.flow.server.startup.ServletContextListeners]
        java.lang.NullPointerException
                at com.vaadin.flow.server.startup.ApplicationConfiguration.lambda$get$0(ApplicationConfiguration.java:52)
                at com.vaadin.flow.server.startup.ApplicationConfiguration$$Lambda$14512/13359214.get(Unknown Source)
                at com.vaadin.flow.server.VaadinServletContext.getAttribute(VaadinServletContext.java:73)
                at com.vaadin.flow.server.startup.ApplicationConfiguration.get(ApplicationConfiguration.java:49)
                at com.vaadin.flow.server.DeploymentConfigurationFactory.createPropertyDeploymentConfiguration(DeploymentConfigurationFactory.java:82)
                at com.vaadin.flow.server.startup.ServletDeployer$StubServletConfig.createDeploymentConfiguration(ServletDeployer.java:184)
                at com.vaadin.flow.server.startup.ServletDeployer.lambda$getServletConfigurations$0(ServletDeployer.java:291)
                at com.vaadin.flow.server.startup.ServletDeployer$$Lambda$14511/25690887.accept(Unknown Source)
                at java.util.Optional.ifPresent(Optional.java:159)
                at com.vaadin.flow.server.startup.ServletDeployer.getServletConfigurations(ServletDeployer.java:290)
                at com.vaadin.flow.server.startup.ServletDeployer.contextInitialized(ServletDeployer.java:208)
                at com.vaadin.flow.server.startup.ServletContextListeners.contextInitialized(ServletContextListeners.java:42)
                at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4699)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5165)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
                at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:970)
                at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1841)
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                at java.lang.Thread.run(Thread.java:745)

To Reproduce
Steps to reproduce the behavior:

git clone https://github.com/Artur-/test-war-deployment.git
cd test-war-deployment
mvn clean install -Pproduction
cp target/*.war tomcat/webapps/

Expected behavior
The app is deployed.

Versions

  • Tomcat: 8.5.46 on Linux
  • Vaadin platform version: 19.0.0.beta4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the WAR deployment with the listed git clone, Maven, and Tomcat steps, then inspect ApplicationConfiguration.java:52 and the surrounding startup path named in the stack trace. Done means the deployment no longer fails with an uninformative NullPointerException and provides a more informative error when configuration is invalid.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring, spring-boot
Domain
backend, devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.