org.jboss.as.server.deployment.DeploymentUnitProcessingException:无法解析"/WEB-INF/web.xml"在[6,1] [英] org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to parse "/WEB-INF/web.xml" at [6,1]

查看:77
本文介绍了org.jboss.as.server.deployment.DeploymentUnitProcessingException:无法解析"/WEB-INF/web.xml"在[6,1]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用PrimeFaces 3.4和JSF 2.1创建简单的应用程序.当我在JBoss AS 7.0中部署应用程序时,遇到以下错误

I create simple app with PrimeFaces 3.4 and JSF 2.1. When I deploy the application in my JBoss AS 7.0, I encounter the following error

18:55:27,684 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "Getting-started-with-Primefaces.war"
18:55:29,480 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."Getting-started-with-Primefaces.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."Getting-started-with-Primefaces.war".PARSE: Failed to process phase PARSE of deployment "Getting-started-with-Primefaces.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [:1.7.0_79]
    at java.lang.Thread.run(Thread.java:745) [:1.7.0_79]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to parse "/C:/Users/marcos/Downloads/jboss-as-web-7.0.2.Final/jboss-as-web-7.0.2.Final/standalone/deployments/Getting-started-with-Primefaces.war/WEB-INF/web.xml" at [6,1]
    at org.jboss.as.web.deployment.WebParsingDeploymentProcessor.deploy(WebParsingDeploymentProcessor.java:70)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.0.2.Final.jar:7.0.2.Final]
    ... 5 more

我的pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.itcuties.examples.webapps.simplejsf</groupId>
  <artifactId>simple-jsf2-with-primefaces</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>simple-jsf2</name>
  <url>http://maven.apache.org</url>



  <dependencies>
    <!-- Primefaces -->  
    <dependency>
        <groupId>org.primefaces</groupId>
        <artifactId>primefaces</artifactId>
        <version>3.4</version>
    </dependency>
    <!-- JSF 2 API -->
    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.2.0-m07</version>
    </dependency>
  </dependencies>
  <repositories>
      <repository>
          <id>primefaces-repository</id>
          <name>Primefaces repository</name>
          <url>http://repository.primefaces.org</url>
      </repository>
  </repositories>
  <build>
    <finalName>jsf2</finalName>
    <plugins>
        <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
            <source>1.7</source>
            <target>1.7</target>
        </configuration>
    </plugin>
    </plugins>

  </build>
</project>

更新:根据要求,我的web.xml:

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
                        http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
                        version="3.0">
<web-app>
    <display-name>Simple JSF2 Application with Primefaces</display-name>

    <!-- 
        Current project stage. When it is set to 'Development' Primefaces give a lot of debug information on the screen.
     -->
    <context-param>
        <param-name>javax.faces.PROJECT_STAGE</param-name>
        <param-value>Development</param-value>
    </context-param>

    <welcome-file-list>
        <welcome-file>index.xhtml</welcome-file>
    </welcome-file-list>

    <!-- Staring JSF -->
    <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <!-- JSF URL mapping -->
    <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>

</web-app>

原因"的问题在"web-app"标签的[6,1]行中,但我不明白.

The problem in cause by, is in line [6,1] in the tag "web-app", but I do not understand.

任何想法可能是什么问题?

Any idea what could be the problem?

推荐答案

万一遇到异常,请始终从最底层的"Cause by"部分中查找所有麻烦的根本原因.

In case you're getting exceptions, always head to the bottommost "Caused by" part for the root cause of all the trouble.

由以下原因引起:org.jboss.as.server.deployment.DeploymentUnitProcessingException:无法解析"/C:/Users/marcos/Downloads/jboss-as-web-7.0.2.Final/jboss-as-web- 7.0.2.最终/独立/部署/Primefaces.war/WEB-INF/web.xml入门[6,1]

Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to parse "/C:/Users/marcos/Downloads/jboss-as-web-7.0.2.Final/jboss-as-web-7.0.2.Final/standalone/deployments/Getting-started-with-Primefaces.war/WEB-INF/web.xml" at [6,1]

您会看到,一个很好的例外情况和信息通常已经是整个答案本身了.服务器在解析第6行和字符1处的webapp的web.xml文件时阻塞了.

You see, a good exception and message is usually already the whole answer at its own. The server choked while parsing the webapp's web.xml file at line 6 and character 1.

您的web.xml看起来像这样:

1    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
2        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
4                            http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
5                            version="3.0">
6    <web-app>
7        <display-name>Simple JSF2 Application with Primefaces</display-name>
.
.        ...
.
.    </web-app>

第6行有一个重复的<web-app>声明.摆脱它.

At line 6 there's a duplicate <web-app> declaration. Get rid of it.

这篇关于org.jboss.as.server.deployment.DeploymentUnitProcessingException:无法解析"/WEB-INF/web.xml"在[6,1]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆