【问题标题】:Glassfish incremental deployment failes when including Selenium包含 Selenium 时 Glassfish 增量部署失败
【发布时间】:2015-01-08 14:06:22
【问题描述】:

我有一个打算在 Glassfish 4.1 上运行的 Java EE 项目。我想使用 Selenium 从某些网页收集信息,即我需要在部署中包含 Selenium(不仅仅是用于测试)。

我正在使用Eclipse IDE,并且之前使用过Eclipse 中的增量部署功能来自动将所有已保存的更改部署到项目中。但是当我包含(使用 Maven)时,Selenium 增量部署的依赖项停止工作。该项目仍然可以部署到 Glassfish,但我必须在每次更改之间重新启动 Glassfish。我在 Eclipse 中收到以下错误:

Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: com.sun.faces.config.ConfigurationException: Unable to parse document 'bundle://136.0:1/com/sun/faces/jsf-ri-runtime.xml': DTD factory class org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl does not extend from DTDDVFactory.. Please see server.log for more details.

org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl 包含在 Selenium 作为传递依赖项 (xerces:xercesImpl:2.11.0)。

这是我的 Maven 依赖项:

<dependency>
  <groupId>org.jboss.arquillian.selenium</groupId>
  <artifactId>selenium-bom</artifactId>
  <version>2.44.0</version>
  <type>pom</type>
  <scope>import</scope>
</dependency>
<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-htmlunit-driver</artifactId>
</dependency>

我希望有一个解决方案,但在阅读了 Jens Schauder 在Dealing with "Xerces hell" in Java/Maven? 的回复后,恐怕可能没有。有人吗?

【问题讨论】:

    标签: maven jakarta-ee selenium glassfish xerces


    【解决方案1】:

    我目前无法通过一个简单的项目重现该问题,您是否确保没有任何其他依赖项正在导入另一个版本的 xercesImpl

    您可以尝试将 xercesImpl-2.11.0.jar 和传递依赖项 xml-apis-1.4.01.jar 放在 Glassfish 域的 lib 文件夹中,并将其从依赖项中排除,如下所示:

    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-htmlunit-driver</artifactId>
      <version>2.44.0</version>
      <exclusions>
        <exclusion>
            <artifactId>xercesImpl</artifactId>
            <groupId>xerces</groupId>
        </exclusion>
      </exclusions>
    </dependency>  
    

    另请参阅:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-12-02
      • 1970-01-01
      相关资源
      最近更新 更多