Error deploying jar to tomcat8

Hi I’m trying to deploy my Vaadin project to tomcat8.

This is my first project with tomcat and vaddin.

I’ve attached my pom file.

Any help would be greatly appreciated.

Thank you in advance,
Sid.

The following is the error I’m seeing in my tomcat logs:

09-Apr-2017 08:09:37.757 INFO [http-nio-8080-exec-24]
 org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Apr 09, 2017 8:09:37 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing AtmosphereFramework
Apr 09, 2017 8:09:37 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class com.vaadin.server.communication.JSR356WebsocketInitializer
java.lang.UnsupportedClassVersionError: com/vaadin/server/communication/JSR356WebsocketInitializer : Unsupported major.minor version 52.0 (unable to load class com.vaadin.server.communication.JSR356WebsocketInitializer)
    at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2570)
    at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:859)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1302)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:518)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:499)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4775)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5314)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1284)
    at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:666)
    at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:217)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:136)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:616)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:509)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1104)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1524)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1480)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"

         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>com.bytegrillstudios</groupId>

    <artifactId>easypick.life</artifactId>

    <packaging>war</packaging>

    <version>1.0-SNAPSHOT</version>

    <name>easypick.life</name>




    <prerequisites>

        <maven>3</maven>

    </prerequisites>




    <properties>

        <vaadin.version>8.0.4</vaadin.version>

        <vaadin.plugin.version>8.0.4</vaadin.plugin.version>

        <jetty.plugin.version>9.3.9.v20160517</jetty.plugin.version>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <maven.compiler.source>1.8</maven.compiler.source>

        <maven.compiler.target>1.8</maven.compiler.target>

        <!-- If there are no local customisations, this can also be "fetch" or "cdn" -->

        <vaadin.widgetset.mode>local</vaadin.widgetset.mode>

    </properties>




    <repositories>

        <repository>

            <id>vaadin-addons</id>

            <url>http://maven.vaadin.com/vaadin-addons</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>mysql</groupId>

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

            <version>6.0.6</version>

        </dependency>

        <dependency>

            <groupId>javax.servlet</groupId>

            <artifactId>javax.servlet-api</artifactId>

            <version>3.0.1</version>

            <scope>provided</scope>

        </dependency>

        <dependency>

            <groupId>com.vaadin</groupId>

            <artifactId>vaadin-server</artifactId>

        </dependency>

        <dependency>

            <groupId>com.vaadin</groupId>

            <artifactId>vaadin-push</artifactId>

        </dependency>

        <dependency>

            <groupId>com.vaadin</groupId>

            <artifactId>vaadin-client-compiled</artifactId>

        </dependency>

        <dependency>

            <groupId>com.vaadin</groupId>

            <artifactId>vaadin-themes</artifactId>

        </dependency>

        <dependency>

            <groupId>javax.mail</groupId>

            <artifactId>mail</artifactId>

            <version>1.5.0-b01</version>

        </dependency>




        <dependency>

            <groupId>org.springframework</groupId>

            <artifactId>spring-context-support</artifactId>

            <version>4.2.4.RELEASE</version>

        </dependency>

    </dependencies>




    <build>

        <plugins>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-war-plugin</artifactId>

                <version>3.0.0</version>

                <configuration>

                    <failOnMissingWebXml>false</failOnMissingWebXml>

                    <!-- Exclude an unnecessary file generated by the GWT compiler. -->

                    <packagingExcludes>WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>

                </configuration>

            </plugin>

            <plugin>

                <groupId>com.vaadin</groupId>

                <artifactId>vaadin-maven-plugin</artifactId>

                <version>${vaadin.plugin.version}</version>

                <executions>

                    <execution>

                        <goals>

                            <goal>update-theme</goal>

                            <goal>update-widgetset</goal>

                            <goal>compile</goal>

                            <!-- Comment out compile-theme goal to use on-the-fly theme compilation -->

                            <goal>compile-theme</goal>

                        </goals>

                    </execution>

                </executions>

            </plugin>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-clean-plugin</artifactId>

                <version>3.0.0</version>

                <!-- Clean up also any pre-compiled themes -->

                <configuration>

                    <filesets>

                        <fileset>

                            <directory>src/main/webapp/VAADIN/themes</directory>

                            <includes>

                                <include>**/styles.css</include>

                                <include>**/styles.scss.cache</include>

                            </includes>

                        </fileset>

                    </filesets>

                </configuration>

            </plugin>




            <!-- The Jetty plugin allows us to easily test the development build by

                running jetty:run on the command line. -->

            <plugin>

                <groupId>org.eclipse.jetty</groupId>

                <artifactId>jetty-maven-plugin</artifactId>

                <version>${jetty.plugin.version}</version>

                <configuration>

                    <scanIntervalSeconds>2</scanIntervalSeconds>

                </configuration>

            </plugin>

        </plugins>

    </build>




    <profiles>

        <profile>

            <!-- Vaadin pre-release repositories -->

            <id>vaadin-prerelease</id>

            <activation>

                <activeByDefault>false</activeByDefault>

            </activation>




            <repositories>

                <repository>

                    <id>vaadin-prereleases</id>

                    <url>http://maven.vaadin.com/vaadin-prereleases</url>

                </repository>

                <repository>

                    <id>vaadin-snapshots</id>

                    <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>

                    <releases>

                        <enabled>false</enabled>

                    </releases>

                    <snapshots>

                        <enabled>true</enabled>

                    </snapshots>

                </repository>

            </repositories>

            <pluginRepositories>

                <pluginRepository>

                    <id>vaadin-prereleases</id>

                    <url>http://maven.vaadin.com/vaadin-prereleases</url>

                </pluginRepository>

                <pluginRepository>

                    <id>vaadin-snapshots</id>

                    <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>

                    <releases>

                        <enabled>false</enabled>

                    </releases>

                    <snapshots>

                        <enabled>true</enabled>

                    </snapshots>

                </pluginRepository>

            </pluginRepositories>

        </profile>

    </profiles>

</project>

31927.xml (7.04 KB)

Hi,
seems like your tomcat is not running with java 8

HTH
Marco

I see … Ill just check it… thank )

Hi Maro,

You were right, thank you!

I’ve got another stupid question if I may, my apologies in advance, I have no expereince deploying to tomcat.

This is my log output:

[code]
==> /var/log/tomcat8/catalina.2017-04-09.log <==
09-Apr-2017 16:34:00.502 INFO [http-nio-8080-exec-16]
org.apache.catalina.core.StandardContext.reload Reloading Context with name
[/easypick.life-1.0-SNAPSHOT] is completed

==> /var/log/tomcat8/catalina.out <==
09-Apr-2017 16:34:00.502 INFO [http-nio-8080-exec-16]
org.apache.catalina.core.StandardContext.reload Reloading Context with name
[/easypick.life-1.0-SNAPSHOT] is completed

==> /var/log/tomcat8/manager.2017-04-09.log <==
09-Apr-2017 16:34:00.502 INFO [http-nio-8080-exec-16]
org.apache.catalina.core.ApplicationContext.log HTMLManager: list: Listing contexts for virtual host ‘localhost’
[/code]But now I have no idea how to access the server in a browser. I’ve been developing on my localmachine. This deployment is to a server with a domain. example.com:8080/xxx not sure how to get to easypick.life )

Please help )

From your log I would say you have to access the webapp at
http://domain. example.com:8080/easypick.life-1.0-SNAPSHOT/

HTH
Marco

when I go to that address I get a 404.

I rebuilt the project and loaded it up as a war via the /manager/html, it kinda loaded with the “Disable cookies band”, but then I added an (edit: I meant) META-INF/contents.xml and up loaded again, now I’m back at the 404.

A few questions just to better understand:

  • what’s the content of the context.xml? Have you specified the path attribute?
  • what’s the actual name of the war file you are deploying?

AT the moment I’m stuck at the “Cookies Disabled” black band.

Works OK deploying locally via jetty.

I haven’t specified the path attribute, unless it’s soemthing that was auto configured by Intellij.

The war file is called ‘tracker-1.0-SNAPSHOT.war’
Contents of my WEB-INF/context.xml

<?xml version="1.0" encoding="UTF-8"?>
<Context cookies="true" useHttpOnly="true"/>

This is the contents of my pom.xml at the moment:

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"

         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>com.bytegrillstudios</groupId>

    <artifactId>tracker</artifactId>

    <packaging>war</packaging>

    <version>1.0-SNAPSHOT</version>

    <name>tracker</name>




    <prerequisites>

        <maven>3</maven>

    </prerequisites>




    <properties>

        <vaadin.version>8.0.5</vaadin.version>

        <vaadin.plugin.version>8.0.5</vaadin.plugin.version>

        <jetty.plugin.version>9.3.9.v20160517</jetty.plugin.version>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <maven.compiler.source>1.8</maven.compiler.source>

        <maven.compiler.target>1.8</maven.compiler.target>

        <!-- If there are no local customisations, this can also be "fetch" or "cdn" -->

        <vaadin.widgetset.mode>local</vaadin.widgetset.mode>

    </properties>




    <repositories>

        <repository>

            <id>vaadin-addons</id>

            <url>http://maven.vaadin.com/vaadin-addons</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>javax.mail</groupId>

            <artifactId>mail</artifactId>

            <version>1.5.0-b01</version>

        </dependency>




        <dependency>

            <groupId>org.springframework</groupId>

            <artifactId>spring-context-support</artifactId>

            <version>4.2.4.RELEASE</version>

        </dependency>

        <dependency>

            <groupId>mysql</groupId>

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

            <version>6.0.6</version>

        </dependency>

        <dependency>

            <groupId>javax.servlet</groupId>

            <artifactId>javax.servlet-api</artifactId>

            <version>3.0.1</version>

            <scope>provided</scope>

        </dependency>

        <dependency>

            <groupId>com.vaadin</groupId>

            <artifactId>vaadin-server</artifactId>

        </dependency>

        <dependency>

            <groupId>com.vaadin</groupId>

            <artifactId>vaadin-push</artifactId>

        </dependency>

        <dependency>

            <groupId>com.vaadin</groupId>

            <artifactId>vaadin-client-compiled</artifactId>

        </dependency>

        <dependency>

            <groupId>com.vaadin</groupId>

            <artifactId>vaadin-themes</artifactId>

        </dependency>

    </dependencies>




    <build>

        <plugins>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-war-plugin</artifactId>

                <version>3.0.0</version>

                <configuration>

                    <failOnMissingWebXml>false</failOnMissingWebXml>

                    <!-- Exclude an unnecessary file generated by the GWT compiler. -->

                    <packagingExcludes>WEB-INF/classes/VAADIN/widgetsets/WEB-INF/**</packagingExcludes>

                </configuration>

            </plugin>

            <plugin>

                <groupId>com.vaadin</groupId>

                <artifactId>vaadin-maven-plugin</artifactId>

                <version>${vaadin.plugin.version}</version>

                <executions>

                    <execution>

                        <goals>

                            <goal>update-theme</goal>

                            <goal>update-widgetset</goal>

                            <goal>compile</goal>

                            <!-- Comment out compile-theme goal to use on-the-fly theme compilation -->

                            <goal>compile-theme</goal>

                        </goals>

                    </execution>

                </executions>

            </plugin>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-clean-plugin</artifactId>

                <version>3.0.0</version>

                <!-- Clean up also any pre-compiled themes -->

                <configuration>

                    <filesets>

                        <fileset>

                            <directory>src/main/webapp/VAADIN/themes</directory>

                            <includes>

                                <include>**/styles.css</include>

                                <include>**/styles.scss.cache</include>

                            </includes>

                        </fileset>

                    </filesets>

                </configuration>

            </plugin>




            <!-- The Jetty plugin allows us to easily test the development build by

                running jetty:run on the command line. -->

            <plugin>

                <groupId>org.eclipse.jetty</groupId>

                <artifactId>jetty-maven-plugin</artifactId>

                <version>${jetty.plugin.version}</version>

                <configuration>

                    <scanIntervalSeconds>2</scanIntervalSeconds>

                </configuration>

            </plugin>

        </plugins>

    </build>




    <profiles>

        <profile>

            <!-- Vaadin pre-release repositories -->

            <id>vaadin-prerelease</id>

            <activation>

                <activeByDefault>false</activeByDefault>

            </activation>




            <repositories>

                <repository>

                    <id>vaadin-prereleases</id>

                    <url>http://maven.vaadin.com/vaadin-prereleases</url>

                </repository>

                <repository>

                    <id>vaadin-snapshots</id>

                    <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>

                    <releases>

                        <enabled>false</enabled>

                    </releases>

                    <snapshots>

                        <enabled>true</enabled>

                    </snapshots>

                </repository>

            </repositories>

            <pluginRepositories>

                <pluginRepository>

                    <id>vaadin-prereleases</id>

                    <url>http://maven.vaadin.com/vaadin-prereleases</url>

                </pluginRepository>

                <pluginRepository>

                    <id>vaadin-snapshots</id>

                    <url>https://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>

                    <releases>

                        <enabled>false</enabled>

                    </releases>

                    <snapshots>

                        <enabled>true</enabled>

                    </snapshots>

                </pluginRepository>

            </pluginRepositories>

        </profile>

    </profiles>




</project>

Have you tried to remove useHttpOnly attribute from context.xml? (or setting it to false)

Yes I did try, without but I’m not so sure it took/kept the changes, as the META-INF directory has disappeard. I’ve been developing locally as well.

In the attached scren shot, I’m not sure if this has anyting to do with the META-INF directory disappearing. Is there something I should fill in for ‘Main Class’ and/or ‘Class Path’.

31928.png