0

I developed a web application(spring) using maven and used jetty server. I want to debug that application using eclipse. entry for the jetty plugin in the pom.xml is

              `<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>`

I start this sever from the ant task as

<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>

Now to put the debug points I set the debugger in eclipse using the steps given in this tutorial steps to enable debugger wiht jetty sever

But I am getting following error

Listening for remote VM connection failed Address already in use: JVM_Bind

How can this problem resolved.

Thanks

2 Answers2

0

It looks like something is already using the port that the JVM is trying to use to enable remote debug. It looks like you are trying to use 8009. Try changing that to something else.

CodeChimp
  • 8,016
  • 5
  • 41
  • 79
0

you can issue the follwoing command from command prompt. mvnDebug jetty:run-exploded antrun:run Then you wil come to know on which port your jetty is listening to after that go to run->debug configuration from there you can debug your server. In debug configuration you can find the option Remote Java Application here create one new debug configuration for new Remote java Application and also here you can define your new server again mvnDebug jetty:run-exploded now you should see your new port.

ankit
  • 4,919
  • 7
  • 38
  • 63