1

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

这是堆栈跟踪:(完整)

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!"));

    }
}

我做错了什么?

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

PS更新。

4

1 回答 1

1

vaadin-xx.yy.zz.jar 在 WEB-INF/lib 中吗?它需要。

于 2012-08-16T10:41:04.787 回答