Jetty 密封了 javax.naming

发布于 2024-11-24 05:18:52 字数 2201 浏览 4 评论 0原文

我有一个使用struts 1 和torque 的遗留应用程序。上周我努力对其进行了一些重构,并尝试解耦一些类组并引入了单元测试。由于我无法通过单元测试来测试应用程序的所有区域,因此我想添加 HtmlUnit 测试。

为此,我将 maven-failsafe-plugin 和 jetty 添加到我的项目中,如下所示:

<build>
...
  <plugins>
  ...
  <plugin>
      <artifactId>maven-failsafe-plugin</artifactId>
      <version>2.6</version>
      <executions>
           <execution>
               <goals>
                   <goal>integration-test</goal>
                   <goal>verify</goal>
                </goals>
            </execution>
      </executions>
  </plugin>

  <plugin>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>maven-jetty-plugin</artifactId>
      <version>6.1.16</version>
      <configuration>
          <scanIntervalSeconds>10</scanIntervalSeconds>
          <stopPort>8005</stopPort>
          <stopKey>STOP</stopKey>
          <contextPath>/</contextPath>
      </configuration>
      <executions>
          <execution>
              <id>start-jetty</id>
              <phase>pre-integration-test</phase>
              <goals>
                  <goal>run</goal>
              </goals>
              <configuration>
                  <scanIntervalSeconds>0</scanIntervalSeconds>
                  <daemon>true</daemon>
              </configuration>
          </execution>
          <execution>
              <id>stop-jetty</id>
              <phase>post-integration-test</phase>
              <goals>
                  <goal>stop</goal>
              </goals>
          </execution>
      </executions>
  </plugin>
  </plugins>
</build>

问题是,当我运行 mvn verify 时,出现以下异常:

java.lang.SecurityException: sealing violation: can't seal package javax.naming: already loaded

我在某些类中使用 javax.naming,但可以找不到任何覆盖 javax.naming 的依赖项!

有人知道如何解决这个问题吗?

I have a legacy application using struts 1 and torque. I have made an effort last week to refactor it a bit and tried to decouple some groups of classes and introduced unit tests. As I can not test all areas of the application through unit tests, I wanted to add HtmlUnit tests.

To to this, I added the maven-failsafe-plugin and jetty to my project, like so:

<build>
...
  <plugins>
  ...
  <plugin>
      <artifactId>maven-failsafe-plugin</artifactId>
      <version>2.6</version>
      <executions>
           <execution>
               <goals>
                   <goal>integration-test</goal>
                   <goal>verify</goal>
                </goals>
            </execution>
      </executions>
  </plugin>

  <plugin>
      <groupId>org.mortbay.jetty</groupId>
      <artifactId>maven-jetty-plugin</artifactId>
      <version>6.1.16</version>
      <configuration>
          <scanIntervalSeconds>10</scanIntervalSeconds>
          <stopPort>8005</stopPort>
          <stopKey>STOP</stopKey>
          <contextPath>/</contextPath>
      </configuration>
      <executions>
          <execution>
              <id>start-jetty</id>
              <phase>pre-integration-test</phase>
              <goals>
                  <goal>run</goal>
              </goals>
              <configuration>
                  <scanIntervalSeconds>0</scanIntervalSeconds>
                  <daemon>true</daemon>
              </configuration>
          </execution>
          <execution>
              <id>stop-jetty</id>
              <phase>post-integration-test</phase>
              <goals>
                  <goal>stop</goal>
              </goals>
          </execution>
      </executions>
  </plugin>
  </plugins>
</build>

The problem is, that when I run mvn verify, I get the following exception:

java.lang.SecurityException: sealing violation: can't seal package javax.naming: already loaded

I am using javax.naming in some classes, but can't find any dependency that overrides javax.naming!

Does anybody have a clue about how to figure this problem out?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文