0

我使用 maven 开发了一个 web 应用程序(spring)并使用了码头服务器。我想使用 Eclipse 调试该应用程序。pom.xml 中 jetty 插件的条目是

              `<plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
            <version>8.1.5.v20120716</version>
            <configuration>
              <scanIntervalSeconds>0</scanIntervalSeconds>
                <webAppSourceDirectory>${webappDirectory}</webAppSourceDirectory>
                <contextPath>/admin</contextPath>
                <stopPort>9967</stopPort>
                <stopKey>foo</stopKey>

                <connectors>
                    <connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
                        <port>${httpPort}</port>
                        <maxIdleTime>60000</maxIdleTime>
                    </connector>
                    <connector implementation="org.eclipse.jetty.server.ssl.SslSelectChannelConnector">
                        <port>${httpsPort}</port>
                        <keystore>${webappDirectory}/WEB-INF/blc-example.keystore</keystore>
                        <keyPassword>broadleaf</keyPassword>
                        <password>broadleaf</password>
                    </connector>
                </connectors>
            </configuration>
        </plugin>`

我从蚂蚁任务开始这个服务器

<target name="jetty-demo" depends="start-db">
    <delete dir="war/WEB-INF/lib"/>
    <artifact:mvn mavenHome="${maven.home}" fork="true">
        <jvmarg value="-XX:MaxPermSize=256M" />
        <jvmarg value="-Xmx512M" />
        <jvmarg value="-Xdebug" />
        <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8009,server=y,suspend=n" />
        <jvmarg value="-Xdebug"/>
        <arg value="compile"/>
        <arg value="war:exploded"/>
        <arg value="jetty:run"/>
    </artifact:mvn>
</target>

现在要放置调试点,我使用本教程 步骤中给出的步骤在 eclipse 中设置调试器,以启用带有码头服务器的调试器

但我收到以下错误

侦听远程 VM 连接失败地址已在使用中:JVM_Bind

这个问题怎么解决。

谢谢

4

2 回答 2

0

看起来有些东西已经在使用 JVM 试图用来启用远程调试的端口。看起来您正在尝试使用 8009。尝试将其更改为其他内容。

于 2013-02-22T13:57:02.577 回答
0

您可以从命令提示符发出以下命令。mvnDebug jetty:run-exploded antrun:run 然后你会知道你的码头正在监听哪个端口,然后从那里运行->调试配置,你可以调试你的服务器。在调试配置中,您可以在此处找到远程 Java 应用程序选项为新的远程 Java 应用程序创建一个新的调试配置,您还可以在这里再次定义您的新服务器mvnDebug jetty:run-exploded 现在您应该看到您的新端口。

于 2013-05-03T07:01:14.487 回答