在 IntelliJ 中使用 Arquillian 进行调试 - 托管容器 [英] Debugging with Arquillian in IntelliJ - Managed Container

查看:16
本文介绍了在 IntelliJ 中使用 Arquillian 进行调试 - 托管容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾多次尝试在托管容器环境中调试测试.

I've tried many times to debug a Test in managed container enviroment.

我收到诸如JDWP 传输错误套接字初始化失败之类的错误.意味着我无法使用以下 property 标签初始化 arquillian.

I get errors like JDWP Transport Error, socket failed to initialize. Means I can not initialize arquillian with the below property tag.

我的 arquillian.xml 文件如下所示:

My arquillian.xml file looks like this:

<arquillian xmlns="http://jboss.org/schema/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://jboss.org/schema/arquillian
http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<engine>
<property name="deploymentExportPath">target/arq.deployments</property>
</engine>

<container qualifier="jboss" default="true">
<protocol type="jmx-as7">
<property name="executionType">MANAGED</property>
</protocol>
<configuration>
<property name="javaVmArguments">-Xrunjdwp:transport=dt_socket,address=55407,server=y,suspend=y -Xmx512m -XX:MaxPermSize=128m</property>
</configuration>
</container>
</arquillian>

我错过了什么吗?

推荐答案

在这种情况下有 3 个 JVM 正在运行.所以这是一个特殊的调试案例.

There are 3 JVM running in this case. So this is a special debug case.

  1. 第一个 JVM-> 由 Arquillian/Junit 启动以执行测试.
  2. 第二个 JVM-> 由 Arquillian 启动以运行托管 Jboss.
  3. 3rd JVM-> 这是一个远程调试配置,必须移植到JVM编号 2 以调试第二个 JVM.查看此博客
  1. 1st JVM-> Started by Arquillian/Junit to perform the tests.
  2. 2nd JVM-> Started by Arquillian to run managed Jboss.
  3. 3rd JVM-> It's a remote debugging configuration that must be ported to JVM number 2 in order to debug 2nd JVM. Check out this blog

所以这是一个想法,运行测试(第二个 JVM 将被挂起,直到附加一个 JVM),然后运行一个新的远程配置,一旦启动,过去的 JVM 将运行.

So this is the idea, Run test (2nd JVM will be suspended until a JVM is attached to it), then run a new remote configuration, as soon as this starts, the past JVM will run.

这有点令人困惑,但有效.

It's a bit confusing but works.

请注意,如果您只有 2 个 JVM 处于简单调试模式,您将调试 arquillian/junit JVM,这不是您感兴趣的.

Note that if you only have 2 JVM in simple debug mode, you will be debugging arquillian/junit JVM, which is not the one you are interested.

这篇关于在 IntelliJ 中使用 Arquillian 进行调试 - 托管容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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