gpt4 book ai didi

java - 部署vaadin应用程序时出错

转载 作者:行者123 更新时间:2023-11-30 03:59:32 34 4
gpt4 key购买 nike

我是 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:run 后遇到的错误:

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)

最佳答案

看起来您的类路径中有一个旧版本 Vaadin 的 jar。尝试删除那个 jar 。

方法 EventRouter.fireEvent() 已在版本 7.1.9 中添加。

关于java - 部署vaadin应用程序时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22302209/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com