Hi!
I have problem with DI in Vaadin Spring project.
InjectedBeanImpl.java
[code]
package pl.xxx.springtest;
import org.springframework.stereotype.Component;
@Component
public class InjectedBeanImpl {
public String doSomething() {
return "INJECTEDBEANIMPL";
}
}
[/code]root-context.xml
[code]
<?xml version="1.0" encoding="UTF-8"?><context:annotation-config />
<context:component-scan base-package="pl.infotower" />
[/code]web.xml
[code]
<?xml version="1.0" encoding="UTF-8"?>
Vaadin Widget Test Application
org.springframework.web.context.ContextLoaderListener
org.springframework.web.context.request.RequestContextListener
contextConfigLocation
/META-INF/root-context.xml
<servlet>
<servlet-name>My Vaadin App</servlet-name>
<servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
<init-param>
<description>Vaadin UI</description>
<param-name>UI</param-name>
<param-value>pl.infotower.MyVaadinUI</param-value>
</init-param>
<init-param>
<param-name>widgetset</param-name>
<param-value>pl.infotower.AppWidgetSet</param-value>
</init-param>
</servlet>
<context-param>
<description>Vaadin production mode</description>
<param-name>productionMode</param-name>
<param-value>false</param-value>
</context-param>
<servlet-mapping>
<servlet-name>My Vaadin App</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
[/code]HelpView.java
[code]
package pl.infotower.views;
import com.vaadin.navigator.View;
import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent;
import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.ui.Notification;
import com.vaadin.ui.VerticalLayout;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import pl.infotower.data.ExampleUtil;
import pl.infotower.models.CalculatorModel;
import pl.infotower.springtest.InjectedBeanImpl;
import pl.infotower.ui.MainMenuComponent;
import pl.infotower.presenters.CalculatorPresenter;
public class HelpView extends VerticalLayout implements View {
@Qualifier("injectedBeanImpl")
@Autowired
public InjectedBeanImpl ib;
public HelpView() {
setSizeFull();
setSpacing(true);
addComponent(new MainMenuComponent());
addComponent(headingLabel());
addComponent(someText());
addComponent(redirectButton());
addComponent(calculator());
}
@Override
public void enter(ViewChangeEvent event) {
Notification.show("Showing view: Help!");
}
private Label headingLabel() {
return new Label("Help");
}
private Label someText() {
Label label = new Label(ExampleUtil.lorem);
label.setContentMode(ContentMode.HTML);
return label;
}
private Button redirectButton(){
Button button = new Button("Calculator", new Button.ClickListener(){
public void buttonClick(Button.ClickEvent event){
Notification.show(ib.doSomething());
}
});
return button;
}
private CalculatorViewImpl calculator() {
CalculatorModel model = new CalculatorModel();
CalculatorViewImpl view = new CalculatorViewImpl();
new CalculatorPresenter(model, view);
return view;
}
}
[/code]
pom.xml
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Infotower</groupId>
<artifactId>InfotowerCRM</artifactId>
<packaging>war</packaging>
<version>1.0-SNAPSHOT</version>
<name>InfotowerCRM</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<vaadin.version>7.3.2</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>
<dependency>
<groupId>org.vaadin.addons</groupId>
<artifactId>dcharts-widget</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>4.1.0.RELEASE</version>
</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.3.2,)
</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>
<resources>
<resource>
<directory>src/main/webapp/VAADIN/images</directory>
</resource>
</resources>
</build>
</project>
When I use a button Calculator then incoming NullPointerEx
[code]
/home/daniel/dev/apache-tomcat-8.0.3/bin/catalina.sh run
Using CATALINA_BASE: /home/daniel/.IntelliJIdea13/system/tomcat/Unnamed_InfotowerCRM
Using CATALINA_HOME: /home/daniel/dev/apache-tomcat-8.0.3
Using CATALINA_TMPDIR: /home/daniel/dev/apache-tomcat-8.0.3/temp
Using JRE_HOME: /usr/local/java/jdk1.8.0_05
Using CLASSPATH: /home/daniel/dev/apache-tomcat-8.0.3/bin/bootstrap.jar:/home/daniel/dev/apache-tomcat-8.0.3/bin/tomcat-juli.jar
[2014-10-23 08:37:52,037]
Artifact InfotowerCRM:war: Server is not connected. Deploy is not available.
23-Oct-2014 20:37:52.511 INFO [main]
org.apache.catalina.core.AprLifecycleListener.init The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: .::/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
23-Oct-2014 20:37:52.775 INFO [main]
org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler [“http-nio-8080”]
23-Oct-2014 20:37:52.793 INFO [main]
org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
23-Oct-2014 20:37:52.796 INFO [main]
org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler [“ajp-nio-8009”]
23-Oct-2014 20:37:52.798 INFO [main]
org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
23-Oct-2014 20:37:52.800 INFO [main]
org.apache.catalina.startup.Catalina.load Initialization processed in 554 ms
23-Oct-2014 20:37:52.831 INFO [main]
org.apache.catalina.core.StandardService.startInternal Starting service Catalina
23-Oct-2014 20:37:52.831 INFO [main]
org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.3
23-Oct-2014 20:37:52.838 INFO [main]
org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [“http-nio-8080”]
23-Oct-2014 20:37:52.844 INFO [main]
org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [“ajp-nio-8009”]
23-Oct-2014 20:37:52.845 INFO [main]
org.apache.catalina.startup.Catalina.start Server startup in 45 ms
Connected to server
[2014-10-23 08:37:53,117]
Artifact InfotowerCRM:war: Artifact is being deployed, please wait…
23-Oct-2014 20:37:53.190 WARNING [RMI TCP Connection(2)-127.0.0.1]
org.apache.tomcat.util.digester.Digester.endElement No rules found matching ‘beans/context:annotation-config’.
23-Oct-2014 20:37:53.190 WARNING [RMI TCP Connection(2)-127.0.0.1]
org.apache.tomcat.util.digester.Digester.endElement No rules found matching ‘beans/context:component-scan’.
23-Oct-2014 20:37:53.191 WARNING [RMI TCP Connection(2)-127.0.0.1]
org.apache.tomcat.util.digester.Digester.endElement No rules found matching ‘beans’.
paź 23, 2014 8:37:55 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: 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.
paź 23, 2014 8:37:55 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
paź 23, 2014 8:37:55 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
paź 23, 2014 8:37:55 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
paź 23, 2014 8:37:55 PM org.springframework.web.context.support.XmlWebApplicationContext prepareRefresh
INFO: Refreshing Root WebApplicationContext: startup date [Thu Oct 23 20:37:55 CEST 2014]
; root of context hierarchy
paź 23, 2014 8:37:55 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource
[/META-INF/root-context.xml]
paź 23, 2014 8:37:56 PM org.springframework.web.context.ContextLoader initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 694 ms
paź 23, 2014 8:37:56 PM org.apache.catalina.util.SessionIdGenerator createSecureRandom
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG]
took [146]
milliseconds.
[2014-10-23 08:37:56,564]
Artifact InfotowerCRM:war: Artifact is deployed successfully
[2014-10-23 08:37:56,564]
Artifact InfotowerCRM:war: Deploy took 3 447 milliseconds
paź 23, 2014 8:37:56 PM com.vaadin.server.DefaultDeploymentConfiguration checkProductionMode
WARNING:
Vaadin is running in DEBUG MODE.
Add productionMode=true to web.xml to disable debug features.
To show debug window, add ?debug to your application URL.
paź 23, 2014 8:37:56 PM org.atmosphere.cpr.AtmosphereFramework addAtmosphereHandler
INFO: Installed AtmosphereHandler com.vaadin.server.communication.PushHandler$1 mapped to context-path: /*
paź 23, 2014 8:37:56 PM org.atmosphere.cpr.AtmosphereFramework addAtmosphereHandler
INFO: Installed the following AtmosphereInterceptor mapped to AtmosphereHandler com.vaadin.server.communication.PushHandler$1
paź 23, 2014 8:37:56 PM org.atmosphere.cpr.AtmosphereFramework doInitParams
WARNING: SessionSupport error. Make sure you define org.atmosphere.cpr.SessionSupport as a listener in web.xml instead
paź 23, 2014 8:37:56 PM org.atmosphere.cpr.AtmosphereFramework autoConfigureService
INFO: Atmosphere is using org.atmosphere.cpr.DefaultAnnotationProcessor for processing annotation
paź 23, 2014 8:37:56 PM org.atmosphere.cpr.DefaultAnnotationProcessor configure
INFO: AnnotationProcessor class org.atmosphere.cpr.DefaultAnnotationProcessor$ServletContainerInitializerAnnotationProcessor being used
paź 23, 2014 8:37:56 PM org.atmosphere.cpr.DefaultAnnotationProcessor fallbackToManualAnnotatedClasses
WARNING: Unable to detect annotations. Application may fail to deploy.
paź 23, 2014 8:37:56 PM org.atmosphere.cpr.AtmosphereFramework autoDetectWebSocketHandler
INFO: Auto detecting WebSocketHandler in /WEB-INF/classes/
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework initWebSocket
INFO: Installed WebSocketProtocol org.atmosphere.websocket.protocol.SimpleHttpProtocol
paź 23, 2014 8:37:57 PM org.atmosphere.container.JSR356AsyncSupport
INFO: JSR 356 Mapping path /{path}
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework configureAtmosphereInterceptor
INFO: Installing Default AtmosphereInterceptor
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.CorsInterceptor : CORS Interceptor Support
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.CacheHeadersInterceptor : Default Response’s Headers Interceptor
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.PaddingAtmosphereInterceptor : Browser Padding Interceptor Support
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.AndroidAtmosphereInterceptor : Android Interceptor Support
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.HeartbeatInterceptor : Heartbeat Interceptor Support
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.SSEAtmosphereInterceptor : SSE Interceptor Support
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.JSONPAtmosphereInterceptor : JSONP Interceptor Support
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.JavaScriptProtocol : Atmosphere JavaScript Protocol
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor : org.atmosphere.interceptor.WebSocketMessageSuspendInterceptor
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.OnDisconnectInterceptor : Browser disconnection detection
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework newAInterceptor
INFO: org.atmosphere.interceptor.IdleResourceInterceptor : org.atmosphere.interceptor.IdleResourceInterceptor
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework configureAtmosphereInterceptor
INFO: Set org.atmosphere.cpr.AtmosphereInterceptor.disableDefaults to disable them.
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Using EndpointMapper class org.atmosphere.util.DefaultEndpointMapper
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Using BroadcasterCache: org.atmosphere.cache.UUIDBroadcasterCache
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Default Broadcaster Class: org.atmosphere.cpr.DefaultBroadcaster
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Broadcaster Polling Wait Time 100
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Shared ExecutorService supported: true
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Messaging Thread Pool Size: Unlimited
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Async I/O Thread Pool Size: 200
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Using BroadcasterFactory: org.atmosphere.cpr.DefaultBroadcasterFactory
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Using WebSocketProcessor: org.atmosphere.websocket.DefaultWebSocketProcessor
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: HttpSession supported: true
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Atmosphere is using DefaultAtmosphereObjectFactory for dependency injection and object creation
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Atmosphere is using async support: org.atmosphere.container.JSR356AsyncSupport running under container: Apache Tomcat/8.0.3 using javax.servlet/3.0 using javax.servlet/3.0 and jsr356/WebSocket API
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework info
INFO: Atmosphere Framework 2.1.2.vaadin5 started.
paź 23, 2014 8:37:57 PM org.atmosphere.cpr.AtmosphereFramework interceptor
INFO: Installed AtmosphereInterceptor Track Message Size Interceptor using | with priority BEFORE_DEFAULT
23-Oct-2014 20:38:02.841 INFO [localhost-startStop-1]
org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /home/daniel/dev/apache-tomcat-8.0.3/webapps/manager
paź 23, 2014 8:38:05 PM com.vaadin.server.DefaultErrorHandler doDefault
SEVERE:
java.lang.NullPointerException
at pl.infotower.views.HelpView$1.buttonClick(HelpView.java:54)
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:483)
at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:508)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:198)
at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:161)
at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:979)
at com.vaadin.ui.Button.fireClick(Button.java:393)
at com.vaadin.ui.Button$1.click(Button.java:57)
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:483)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:168)
at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:118)
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:287)
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:180)
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:93)
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:41)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1402)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:305)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:301)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:503)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:74)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1015)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:652)
at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1575)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1533)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[/code]How should I correctly configure Spring in Vaadin project?