Vaadin 7.7.0 only works after including dependency on javax.servlet-api

Hi,

just upgraded to Vaadin 7.7.0 (used together with spring-boot 1.4.0).
Afterwards, I got exceptions during startup:

[code]
2016-09-01 14:04:50.373 ERROR 15896 — [ main]
o.s.boot.SpringApplication : Application startup failed

org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.boot.context.embedded.EmbeddedServletContainerException: Unable to start embedded Tomcat
[/code]Now the release notes for 7.7.0 say:

Vaadin artifacts no longer bring a transitive dependency to javax.servlet:servlet-api.

Therefore I tried to add the following dependency to the pom.xml, which solved the issue:

<dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <scope>provided</scope> </dependency> Does anybody know why this is needed now? Is it supposed to come from some other dependency?[i]

[/i](Note that I currently don’t have a dependency on spring-boot-starter-web, as it wasn’t necessary)

If you test with
http://start.spring.io
and just change vaadin-bom version 7.7.0? Doesn’t it work? For me it does. If you need more detailed help, send your pom.xml. I hope I can help you.

Hi Johannes,
thanks for your support.

Here is my pom file. If I remove the javax.servlet, the startup of tomcat fails:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>myid</groupId>
    <artifactId>myartifact</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>myname</name>
    <description>myapp</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.4.0.RELEASE</version>
        <relativePath />
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>1.8</java.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <vaadin.version>7.7.0</vaadin.version>
        <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
        <vaadin.theme>mytheme</vaadin.theme>
        <geotools.version>14.3</geotools.version>
    </properties>

    <repositories>
        <repository>
            <id>vaadin-addons</id>
            <url>http://maven.vaadin.com/vaadin-addons</url>
        </repository>
        <repository>
            <id>osgeo</id>
            <name>Open Source Geospatial Foundation Repository</name>
            <url>http://download.osgeo.org/webdav/geotools/</url>
        </repository>
    </repositories>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-bom</artifactId>
                <version>${vaadin.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-spring-boot-starter</artifactId>
            <version>1.0.0</version>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

        <dependency>
            <groupId>org.vaadin.addon</groupId>
            <artifactId>v-ol3</artifactId>
            <version>1.1</version>
        </dependency>

        <dependency>
            <groupId>org.vaadin.addons</groupId>
            <artifactId>vaadin-grid-util</artifactId>
            <version>1.0.8</version>
        </dependency>

        <dependency>
            <groupId>org.vaadin</groupId>
            <artifactId>viritin</artifactId>
            <version>1.56</version>
        </dependency>

        <dependency>
            <groupId>org.vaadin.spring.addons</groupId>
            <artifactId>vaadin-spring-addon-i18n</artifactId>
            <version>0.0.7.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client</artifactId>
            <scope>provided</scope>
        </dependency>

          <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-api</artifactId>
            <version>${geotools.version}</version>
        </dependency>
        <dependency>
            <groupId>org.geotools</groupId>
            <artifactId>gt-epsg-hsql</artifactId>
            <version>${geotools.version}</version>
        </dependency>

    </dependencies>


    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>com.vaadin</groupId>
                <artifactId>vaadin-maven-plugin</artifactId>
                <version>${vaadin.plugin.version}</version>
                <configuration>
                    <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                    <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This
                        way compatible with Vaadin eclipse plugin. -->
                    <webappDirectory>${basedir}/src/main/resources/VAADIN/widgetsets/</webappDirectory>
                    <hostedWebapp>${basedir}/src/main/resources/VAADIN/</hostedWebapp>
                    <warSourceDirectory>${basedir}/src/main/resources/</warSourceDirectory>
                    <draftCompile>false</draftCompile>
                    <compileReport>false</compileReport>
                    <style>OBF</style>
                    <strict>true</strict>
                    <persistentunitcachedir>${basedir}/target/gwt-unitCache</persistentunitcachedir>
                    <deploy>${basedir}/target/gwtdirt</deploy>
                    <module>AppWidgetset</module>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>update-theme</goal>
                            <goal>update-widgetset</goal>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

        </plugins>

    </build>

</project>