Use jetty for MAVEN Web project development debugging in Eclipse __web

Source: Internet
Author: User

After the jetty is configured, it's much more fun to develop. The specific configuration is as follows:

First, configure the Pom.xml file, add the following : <plugin>
<groupId>Org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>

</plugin>

Second, a new external tool (reproduced please specify Blog.csdn.net/whuslei)

iii. Configuring MAVEN Paths and jetty execution commands

Four, then you will see the following options on the toolbar

If this is not the case, please add it yourself:

Five, start jetty

If success occurs: Listening for transport Dt_socket at address: * * * *

------- What to do if you want to debug. Then configure:--------------------------------------------

First, modify the contents of the Environment
New A variable, named Maven_opts, with a value of
-xdebug-xnoagent-djava.compiler=none-xrunjdwp:transport=dt_socket,address=4000, Server=y,suspend=n

Second, configure remote debug

In the popup dialog box, select

Set the parameters, note that the ports here must be the same as the previous settings

third, start remote debugging
Start the jetty listener first, the command line appears prompt window

four, remote start jetty

So you can debug, how do you close it?

Set Close jetty shortcut, modify Pom.xml document
<plugin>
<groupId>Org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<configuration>
<stopPort>9966</stopPort><!--Stop Jetty--
<stopKey>foo</stopKey>
</configuration>

</plugin>

Vi. Create a new jetty Stop command, it's simple.

Seven, stop debugging

" tricks "
1, the first to start the jetty listening port in order to start jetty remote debugging.
2. If jetty stop execution fails, the following exception occurs when the listening port is started again:
FATAL ERROR in native method:jdwp No transports initialized, Jvmtierror=agent_error_transport_init (197)
Error:transport error 202:bind failed:address already in use
ERROR:JDWP Transport Dt_socket failed to initialize, Transport_init (510)
JDWP Exit Error Agent_error_transport_init (197): No transports initialized [...] /.. /.. /SRC/SHARE/BACK/DEBUGINIT.C:690]
This is because the listener has not stopped and is still bound to the port. So you just need to find this program.

Just need to find Java.exe (if you have no other Java processes.) ), and end this off.


Original address: http://blog.csdn.net/whuslei/article/details/6647275

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.