Adding mpr-07 for Vaadin 14 migration fails, NullPointerException

I have followed [videos]
(http://https://vaadin.com/learn/training/v10-migration-mpr) and [documents]
(http://https://vaadin.com/docs/v14/mpr/Overview.html) on migrating a Vaadin 7 app to Vaadin 14 and believe I’ve set up my project correctly.
When I add the mpr-07 dependency, it compiles and the frontend builds when I start Tomcat, but an error message appears and the server does not start up. Following is the Java stack trace, but there is no source code with a line number 69 at com.vaadin.mpr.core.MprServletService, so I cannot even begin to understand the problem.

Dec 15, 2020 9:28:26 AM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet [com.vaadin.mpr.MprServlet]
 in web application 
[/sales] threw load() exception
java.lang.NullPointerException
	at com.vaadin.mpr.core.MprServletService.<init>(MprServletService.java:69)
	at com.vaadin.mpr.core.AbstractMprServlet.createServletService(AbstractMprServlet.java:183)
	at com.vaadin.server.VaadinServlet.init(VaadinServlet.java:228)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1134)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1089)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:983)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4864)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5173)
	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.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:738)
	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:342)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:473)

I have atatched the project pom.xml, in case there is something that I have wrong.
Quite possibly related, but removing mpr-07 and attempting to run my project as a Vaadin 14 project (like the following) as my entry point fails;

@Route(value = "")
public class MainView extends Div {

    private static final long serialVersionUID = 5146357729882260093L;
    private Logger logger = LogManager.getLogger();
    
    public MainView() {
        logger.info("Main View...");
    }
}

This makes me believe Tomcat or a servlet hanging off of it is re-directing. But I’m yet to work that one out.
If anyone has some ideas, or experience with mpr issues, greatly appreciated.
Any other info you might need, please let me know.

18495791.xml (24.9 KB)

Based on the source code the NPE is thrown, because Vaadin 7 servlet is not found. There is actually assertation for that, so if you run the app with jvm -ea parameter, it should trigger. Thus for me it sounds like some minor problem in your setup.

Thanks Tata. I’ll run that jvm switch and see what shows up.

Running with the -ea switch gives me the following;

Dec 18, 2020 9:01:20 AM org.apache.catalina.core.ApplicationContext log
SEVERE: Servlet.init() for servlet [com.vaadin.mpr.MprServlet]
 threw exception
java.lang.AssertionError: ServletRegistration shouldn't be null
	at com.vaadin.mpr.core.MprServletService.<init>(MprServletService.java:68)
	at com.vaadin.mpr.core.AbstractMprServlet.createServletService(AbstractMprServlet.java:183)
	at com.vaadin.server.VaadinServlet.init(VaadinServlet.java:228)
	...

I’ve worked out it’s the way servlets are configured in the legacy app. I’ve commented them all out of web.xml, which gets the app to load in tomcat, but errors when URL is called. I’m now going back through to address them one at a time to work out if still required, or need customising.
Thanks, that has got me going forward.