【问题标题】:How debug web application with maven Eclipse and glassfish?如何使用 maven Eclipse 和 glassfish 调试 Web 应用程序?
【发布时间】:2013-06-11 20:49:48
【问题描述】:

我将简单的 Web 应用程序创建为 maven 项目。运行 mvn eclipse:eclipse 并将其导入 Eclipse 工作空间。我还有一条玻璃鱼。我运行 maven 目标“全新安装”并添加属性:

maven.compilet.debug=true
maven.compilet.debuglevel=lines,vars,sources

我使用 Eclipse 中的属性运行此目标并获取战争存档。接下来,我将战争导入工作区,然后在 glassfish 上单击“添加和删除”,在“发布到 Glassfish”过程项目中我得到错误:

Unable to install breakpoint SomeClass s_ss_WeldSubdass due to missing line number attributes. Modify compiler options to generate line number attributes.

Reason:
Absent Line Number Information

我还检查了网络服务器属性:

-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9009

并从管理控制台检查在 9009 端口上启用了调试。

有什么问题?

P.S.可以创建一个断点,但调试会在未知行中。

【问题讨论】:

  • 尝试在编译阶段添加调试选项?对于 javac,它是 -g
  • 什么意思?运行javac?我想使用 Maven 构建。
  • 您确定您的物业名称正确吗?
  • 您的 glassfish 是本地的还是远程的?

标签: java eclipse debugging maven glassfish


【解决方案1】:

您可以尝试在您的 Maven 编译器插件配置中添加调试选项。默认情况下,它的值为 true,但可能您对 maven 编译器插件的配置不是很好。应该是这样的,

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>${java.version}</source>
                <target>${java.version}</target>
                <debug>true</debug>
            </configuration>
        </plugin>

【讨论】:

    猜你喜欢
    • 2012-01-26
    • 2016-03-02
    • 2012-12-15
    • 1970-01-01
    • 1970-01-01
    • 2012-08-04
    • 2015-09-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多