【问题标题】:Deploying my GWT Application on Tomcat Server在 Tomcat 服务器上部署我的 GWT 应用程序
【发布时间】:2011-08-10 11:53:54
【问题描述】:

我想在我的本地 Tomcat 服务器中设置一个具有许多依赖项的 GWT 应用程序(版本 2.0.0)。我开始编写一个用于部署和打包应用程序的 maven2 构建脚本。

我编写了一个 maven2 脚本,在我看来它工作得很好,但是当我尝试在我的 tomcat 上部署即将到来的战争时出现错误。

2011-04-21 18:14:13,951 ERROR org.apache.catalina.startup.ContextConfig - Parse error in application web.xml file at jndi:/localhost/quickfinder.ui-1.0-SNAPSHOT/WEB-INF/web.xml org.xml.sax.SAXParseException: The markup declarations contained or pointed to by the document type declaration must be well-formed.

web.xml 如下所示: here 我的 maven2 脚本如下所示: here

在编译和链接以及其他内容之后,我的“部署”目录(名为 war)如下所示:

|-AnswerPanel.css
|-common.css
|-DomainListPanel.css
|-glossary.css
|-glossary.html
|-images
|-META-INF
|-MulitpleChoiceEditPanel.css
|-MultipleChoiceDisclosurePanel.css
|-NaviPanel.css
|-QuestionnairePanel.css
|-quickfinder
|-Quickfinder.css
|-Quickfinder.html
|-quickfinderportlet
|-QuickfinderPortlet.html
|-styles-css2.css
|-styles-css3.css
|-WEB-INF
|--lib
在 WEB-INF 目录下的 lib 下,所有需要的库都可用。该项目有一些 RPC 调用等等。

使用mvn compile war:war 在/target 下创建一个.war 文件和一个名为#artifactId#-SNAPSHOT-1.00 的文件夹。

tomcat这个错误表单不知道怎么处理,还是pom.xml中有逻辑错误。

BR, 我的贝克

【问题讨论】:

    标签: gwt tomcat maven-2


    【解决方案1】:

    您的 web.xml 格式不正确:修复以下部分

    <!DOCTYPE web-app
        PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd" [
    <!ENTITY GlossaryWebXml SYSTEM "glossary.web.xml"> -->
     ]>
    

    【讨论】:

    • 哦,我已经更正了。但是仍然没有变化,重新编译后,部署我仍然得到同样的错误。
    • 你做了干净的构建吗?并检查是否打包/部署了正确的 web.xml
    • 是的,我完成了mvn clean 并检查了输出目录中的 web.xml 文件,它们的内容都相同。
    • 我会说,你需要仔细检查部署的 web.xml,因为它似乎失败是因为它的格式不正确
    • 正确格式化 web.xml 后,问题是,我使用的一些依赖项存在于 mvn 存储库中低于应用程序需要的版本中。该应用程序不是由我编写的,我只想创建构建脚本。
    【解决方案2】:

    我建议将maven-xml-plugin 添加到您的validate 阶段。它会自动检查你的web.xml。

    【讨论】:

      猜你喜欢
      • 2020-07-18
      • 1970-01-01
      • 2012-06-23
      • 1970-01-01
      • 1970-01-01
      • 2018-06-07
      • 2011-08-31
      • 2019-06-14
      • 1970-01-01
      相关资源
      最近更新 更多