vaadin - 无法加载应用程序类

时间:2012-08-16 10:09:43

标签: java tomcat vaadin

我收到javax.servlet.ServletException:无法加载应用程序类: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!"));

    }
}

我做错了什么?

您能为我提供逐步部署的手册吗?

P.S。更新。

1 个答案:

答案 0 :(得分:1)

WEB-INF / lib中的vaadin-xx.yy.zz.jar是什么? 它需要。