Cannot import org.h2.server.web.WebServlet

I had the same problem, probably running the same example. Had the correct maven pom.xml dependency but for some reason had to download the h2 driver jar directly from Maven. Then the code above worked. Taking away "runtime" element will default to compile.

    <!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
    <dependency>
        <groupId>com.h2database</groupId>
        <artifactId>h2</artifactId>
        <version>1.4.192</version>
    </dependency>

Shouldn't h2 be a compile (instead of runtime) dependency?