0

很抱歉我的问题很糟糕,但我正在尝试使用 vaadin7 进行工作 maven 的简单项目,部署到 jboss 7 时出现问题,

这是我的 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">
    <display-name>Student Manager Example</display-name>
    <description>
        This is example for research Maven work with Vaadin
    </description>
    <servlet>
        <servlet-name>StudentManager</servlet-name>
        <servlet-class>servlet.StudentManagerServlet</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>StudentManager</servlet-name>
        <url-pattern>/student</url-pattern>
    </servlet-mapping>
</web-app>

我的小服务程序

@Theme("mytheme")
public class StudentManagerServlet extends UI { 
    private static final long serialVersionUID = 1L;
    @Override
    protected void init(VaadinRequest request) {
         VerticalLayout view = new VerticalLayout();
            view.addComponent(new Label("Hello Vaadin!"));
            setContent(view);
    }

}

这是我在部署 jboos 时的错误

Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: servlet.StudentManagerServlet from [Module "deployment.StudentManager-0.0.1-SNAPSHOT.war:main" from Service Module Loader]
    at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.checkDeclaredApplicationClassAsServlet(JaxrsScanningProcessor.java:290)
    at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scanWebDeployment(JaxrsScanningProcessor.java:155)
    at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.deploy(JaxrsScanningProcessor.java:104)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    ... 5 more
14:19:10,848 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"StudentManager-0.0.1-SNAPSHOT.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"StudentManager-0.0.1-SNAPSHOT.war\".POST_MODULE: Failed to process phase POST_MODULE of deployment \"StudentManager-0.0.1-SNAPSHOT.war\""}}}}

非常感谢您

4

1 回答 1

0

您应该使用完整的包名称和 Servlet 名称,同时在 web.xml 中声明它。servlet.StudentManagerServlet 是您班级的完整路径吗?

<servlet>
  <servlet-name>StudentManager</servlet-name>
  <servlet-class>full.path.to.package.StudentManagerServlet</servlet-class>
</servlet>
于 2013-09-26T11:44:12.350 回答