2013-02-22 282 views
0

我使用maven和使用的码头服务器开发了一个Web应用程序(spring)。我想使用eclipse来调试该应用程序。对于在pom.xml码头插件项使用码头服务器,远程服务器进行调试

   `<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中调试点在本教程中 steps to enable debugger wiht jetty sever

但我得到以下错误

听FO r远程虚拟机连接失败 已在使用的地址:JVM_Bind

该问题如何解决。

感谢

+0

在这里看到我的答案如何调试码头服务器 ankit 2013-04-25 09:37:48

回答

0

它看起来像是已经使用了JVM试图用它来实现远程调试的端口。它看起来像你试图使用8009.尝试改变它到别的东西。

0

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