gpt4 book ai didi

java - vaadin - 无法加载应用程序类

转载 作者:行者123 更新时间:2023-11-28 22:22:13 25 4
gpt4 key购买 nike

我收到 javax.servlet.ServletException: Failed to load application class: com.example.App当我尝试在本地 Tomcat 7 应用程序服务器上运行它时。

这是堆栈跟踪:(完整)

javax.servlet.ServletException: Failed to load application class: com.example.App
com.vaadin.terminal.gwt.server.ApplicationServlet.init(ApplicationServlet.java:71)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1001)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
java.lang.Thread.run(Thread.java:722)

这是我的 web.xml:

    <?xml version="1.0" encoding="UTF-8"?>
<web-app 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/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet>
<servlet-name>ApplicationServlet</servlet-name>
<servlet-class>com.vaadin.terminal.gwt.server.ApplicationServlet</servlet-class>
<init-param>
<param-name>application</param-name>
<param-value>com.example.App</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>ApplicationServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>

</web-app>

App.class 位于 WEB-INF/classes/com/example/中:

package com.example;

import com.vaadin.Application;
import com.vaadin.ui.Label;
import com.vaadin.ui.Window;

public class App extends Application {

@Override
public void init() {
Window main = new Window("Hello");
setMainWindow(main);
main.addComponent(new Label("Hello, world!"));

}
}

我做错了什么?

你能给我任何分步部署的手册吗?

附言更新。

最佳答案

vaadin-xx.yy.zz.jar在WEB-INF/lib中吗?这是必须的。

关于java - vaadin - 无法加载应用程序类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11984972/

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