ClassNotFoundException: com.vaadin.server.VaadinSession

Hi,

Please forgive me for my bad english, I’m not a native speaker

I want to update my Vaadin Project from 7.1.7 up to the latest stable Version 7.2.4.
I’ve got an Maven Project build with Maven 3.2.1 coded in Eclipse Keplar SP2, running with Tomcat 7 and Java 7.

But with every Project I have and try, I got the following Errormessage:

[code]
Jul 17, 2014 2:57:04 PM org.apache.catalina.core.AprLifecycleListener init
Jul 17, 2014 2:57:05 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
Warnung: [SetPropertiesRule]
{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:m2m-vaadin’ did not find a matching property.
Jul 17, 2014 2:57:05 PM org.apache.coyote.AbstractProtocol init
Information: Initializing ProtocolHandler [“http-bio-8080”]

Jul 17, 2014 2:57:05 PM org.apache.coyote.AbstractProtocol init
Information: Initializing ProtocolHandler [“ajp-bio-8009”]

Jul 17, 2014 2:57:05 PM org.apache.catalina.startup.Catalina load
Information: Initialization processed in 990 ms
Jul 17, 2014 2:57:05 PM org.apache.catalina.core.StandardService startInternal
Information: Starting service Catalina
Jul 17, 2014 2:57:05 PM org.apache.catalina.core.StandardEngine startInternal
Information: Starting Servlet Engine: Apache Tomcat/7.0.32
Jul 17, 2014 2:57:15 PM org.apache.catalina.session.StandardManager doLoad
Schwerwiegend: ClassNotFoundException while loading persisted sessions: java.lang.ClassNotFoundException: com.vaadin.server.VaadinSession
java.lang.ClassNotFoundException: com.vaadin.server.VaadinSession
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:76)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1595)
at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1060)
at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:284)
at org.apache.catalina.session.StandardManager.load(StandardManager.java:204)
at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:491)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Jul 17, 2014 2:57:15 PM org.apache.catalina.session.StandardManager startInternal
Schwerwiegend: Exception loading sessions from persistent storage
java.lang.ClassNotFoundException: com.vaadin.server.VaadinSession
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:76)
at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1595)
at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1060)
at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:284)
at org.apache.catalina.session.StandardManager.load(StandardManager.java:204)
at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:491)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[/code]I think my Code doesn’t matter because this Error occures even by an fresh build Project with

mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=LATEST -Dpackaging=war -DgroupId=package.path -DartifactId=myproject -Dversion=1.0 my pom.xml:

[code]

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


4.0.0
package.path
myapp
war
1.0
Vaadin Web Application

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <vaadin.version>7.2.4</vaadin.version>
    <vaadin.plugin.version>${vaadin.version}</vaadin.plugin.version>
</properties>
<repositories>
    <repository>
        <id>vaadin-addons</id>
        <url>http://maven.vaadin.com/vaadin-addons</url>
    </repository>
    <repository>
        <id>vaadin-snapshots</id>
        <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>vaadin-snapshots</id>
        <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
        <releases>
            <enabled>false</enabled>
        </releases>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>
<dependencies>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-server</artifactId>
        <version>${vaadin.version}</version>
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-client-compiled</artifactId>
        <version>${vaadin.version}</version>
    </dependency>
    <!-- Needed when using the widgetset optimizer (custom ConnectorBundleLoaderFactory). 
        For widgetset compilation, vaadin-client-compiler is automatically added 
        on the compilation classpath by vaadin-maven-plugin so normally there is 
        no need for an explicit dependency. -->
    <!-- <dependency> <groupId>com.vaadin</groupId> <artifactId>vaadin-client-compiler</artifactId> 
        <version>${vaadin.version}</version> <scope>provided</scope> </dependency> -->
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-client</artifactId>
        <version>${vaadin.version}</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-push</artifactId>
        <version>${vaadin.version}</version>
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-themes</artifactId>
        <version>${vaadin.version}</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>3.0.1</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>
        <!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
        <!-- directory is cleaned properly -->
        <plugin>
            <artifactId>maven-clean-plugin</artifactId>
            <version>2.4.1</version>
            <configuration>
                <filesets>
                    <fileset>
                        <directory>src/main/webapp/VAADIN/widgetsets</directory>
                    </fileset>
                </filesets>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.2</version>
            <configuration>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <version>${vaadin.plugin.version}</version>
            <configuration>
                <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                <!-- <runTarget>mobilemail</runTarget> -->
                <!-- We are doing "inplace" but into subdir VAADIN/widgetsets. This 
                    way compatible with Vaadin eclipse plugin. -->
                <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets
                </webappDirectory>
                <hostedWebapp>${basedir}/src/main/webapp/VAADIN/widgetsets
                </hostedWebapp>
                <!-- Most Vaadin apps don't need this stuff, guide that to target -->
                <persistentunitcachedir>${project.build.directory}</persistentunitcachedir>
                <deploy>${project.build.directory}/gwt-deploy</deploy>
                <!-- Compile report is not typically needed either, saves hunreds of 
                    mb disk -->
                <compileReport>false</compileReport>
                <noServer>true</noServer>
                <!-- Remove draftCompile when project is ready -->
                <draftCompile>false</draftCompile>

                <style>OBF</style>
                <strict>true</strict>
                <runTarget>http://localhost:8080/</runTarget>
            </configuration>
            <executions>
                <execution>
                    <configuration>
                        <!-- if you don't specify any modules, the plugin will find them -->
                        <!-- <modules> <module>com.vaadin.demo.mobilemail.gwt.ColorPickerWidgetSet</module> 
                            </modules> -->
                    </configuration>
                    <goals>
                        <goal>clean</goal>
                        <goal>resources</goal>
                        <goal>update-theme</goal>
                        <goal>update-widgetset</goal>
                        <goal>compile-theme</goal>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
        </plugin>
    </plugins>
    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings 
                only. It has no influence on the Maven build itself. -->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>com.vaadin</groupId>
                                    <artifactId>
                                        vaadin-maven-plugin
                                    </artifactId>
                                    <versionRange>
                                        [7.2.4,)
                                    </versionRange>
                                    <goals>
                                        <goal>resources</goal>
                                        <goal>update-widgetset</goal>
                                        <goal>compile</goal>
                                        <goal>update-theme</goal>
                                        <goal>compile-theme</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
            <plugin>
                <artifactId>maven-eclipse-plugin</artifactId>
                <configuration>
                    <wtpversion>2.0</wtpversion>
                    <additionalProjectnatures>
                        <projectnature>com.vaadin.integration.eclipse.widgetsetNature</projectnature>
                    </additionalProjectnatures>
                    <additionalBuildcommands>
                        <buildcommand>com.vaadin.integration.eclipse.widgetsetBuilder</buildcommand>
                        <buildcommand>com.vaadin.integration.eclipse.addonStylesBuilder</buildcommand>
                    </additionalBuildcommands>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
[/code]my web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="3.0"
    xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
      http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
    <display-name>MyApp</display-name>
    <context-param>
        <description>Vaadin production mode</description>
        <param-name>productionMode</param-name>
        <param-value>false</param-value>
    </context-param>

    <servlet>
        <servlet-name>myproject</servlet-name>
        <servlet-class>
            com.vaadin.server.VaadinServlet
        </servlet-class>

        <init-param>
            <param-name>UI</param-name>
            <param-value>package.path.MainUI</param-value>
        </init-param>

        <init-param>
            <description>WidgetSet to Use</description>
            <param-name>widgetset</param-name>
            <param-value>package.path.AppWidgetSet</param-value>
        </init-param>
        <async-supported>true</async-supported>
    </servlet>

    <servlet-mapping>
        <servlet-name>myproject</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
</web-app>

Thank you.

I tryed it with different Vaadin versions (7.1.7, 7.1.15, 7.2.4, 7.4.0.alpha3) and at an fresh installed Windows 7 Ultimate 64bit PC with Eclipse Keplar SP2 and Tomcat 7 and the latest Version of Maven 3.

Same problem every time with old Projects or new buid ones.

I don’t know what I can try now. Any proposal what have to be changed?

The exceptions you are seeing are from Tomcat persistent session reloading and shouldn’t prevent anything else from working, but you can disable persistent sessions as described
here
- probably a good idea in a development environment. (In theory persistent sessions should also work as long as you are not making changes to the classes between Tomcat restarts if everything is ok with the classpath.)

If something else about the application is not working, more details would probably be needed.

Hi,
I was very busy in last time and could not do much with Vaadin, so late reply.

i reinstalled windows a few days ago and installed eclipse yuno (without any add-on), maven 3.2.1 tomcat 7.55 and java 7
I made an vaadin- maven project with the command from the book (https://vaadin.com/book/-/page/getting-started.maven.html)

$ mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=7.3.0 -DgroupId=your.company -DartifactId=project-name -Dversion=1.0 -Dpackaging=war and run

mvn eclipse:eclipse and

mvn package After that, i import the project as existing maven project in eclipse and add an new server with default configuration.
If I start tomcat, there is no errormessage but if I open http://localhost:8080/project-name I get the same error with the same ClassNotFoundException.

Thanks

hmmm… i just tryed to run the project with an installed tomcat, not that one I use for developing.
it works.
has anyone an Idea what the problem could be?

I tryed to build the Application in another way:
first I removed the project from eclipse, than I deleted the project and all projectdata from the file system, than I deleted the folder vaadin in .m2/repository/com/ and generated a new maven project with the posted mvn command. then run the command mvn package and skip the command mvn eclipse:eclipse.
after import the project as existing maven project in eclipse, it wirks.