我是Vaadin应用程序开发的初学者。我的应用程序是与Maven集成的Vaadin应用程序。
我正在尝试创建自己的自定义页面:
@SuppressWarnings("serial")
public class MainPage extends UI {
public void markAsDirty() {
// TODO Auto-generated method stub
}
FilesystemContainer docs = new FilesystemContainer(new File(
"D:/Users/etantaou/Desktop/alfresco-developer-series-master/actions/tutorial"));
Table doclist = new Table("Documents", docs);
DocEditor docView = new DocEditor();
@Override
protected void init(VaadinRequest request) {
HorizontalSplitPanel split = new HorizontalSplitPanel();
setContent(split);
split.addComponent(doclist);
split.addComponent(docView);
doclist.setSizeFull();
doclist.addListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent event) {
// TODO Auto-generated method stub
docView.setPropertyDataSource(new TextFileProperty((File) event.getProperty().getValue()));
}
});
doclist.setImmediate(true);
doclist.setSelectable(true);
}
}
这是我的web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>display-name>Vaadin Web Application</display-name>
<context-param>
<description>Vaadin production mode</description>
<param-name>productionMode</param-name>
<param-value>false</param-value>
</context-param>
<servlet>
<servlet-name>Vaadin Application Servlet</servlet-name>
<servlet-class>com.vaadin.server.VaadinServlet</servlet-class>
<init-param>
<description>
Vaadin application class to start</description>
<param-name>UI</param-name>
<param-value>com.delta.UI.MainPage</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Vaadin Application Servlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
这是我在运行tomcat后遇到的错误:运行:
mars 10, 2014 2:47:22 PM org.atmosphere.cpr.AtmosphereFramework interceptor
INFO: Installed AtmosphereInterceptor Track Message Size Interceptor using |.
mars 10, 2014 2:47:22 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet Vaadin Application Servlet threw exception
java.lang.NoSuchMethodError: com.vaadin.event.EventRouter.fireEvent(Ljava/util /EventObject;Lcom/vaadin/server/ErrorHandler;)V
at com.vaadin.server.VaadinService.onVaadinSessionStarted(VaadinService.java:783)
at com.vaadin.server.VaadinService.createAndRegisterSession(VaadinService.java:740)
at com.vaadin.server.VaadinService.doFindOrCreateVaadinSession(VaadinService.java:696)
at com.vaadin.server.VaadinService.findOrCreateVaadinSession(VaadinService.java:637)
at com.vaadin.server.VaadinService.findVaadinSession(VaadinService.java:501)
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1376)
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:238)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:722)
答案 0 :(得分:2)
看起来你在类路径中有一个旧版本的Vaadin的jar。尝试删除那个罐子。
方法EventRouter.fireEvent()
已在7.1.9版本中添加。