Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7706209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:03:59+00:00 2026-06-01T00:03:59+00:00

We have for all our tests a method which starts a Jetty Server to

  • 0

We have for all our tests a method which starts a Jetty Server to publish and test the Web-Services:

@Before
public void startJettyAndloadWSDL() throws Exception {
    String port = System.getProperty("jetty.port");
    server = new Server(Integer.valueOf(port));
    WebAppContext webapp = new WebAppContext();
    webapp.setSecurityHandler(getSecurityHandler()); // this is a local function in my test
    webapp.setContextPath("/");
    webapp.setWar(System.getProperty("jetty.war"));
    server.setHandler(webapp);
    // Is there an option somewhere to say "start Jetty in Debug mode"?
    server.start();
    service = new MyServiceToTest(new URL("http://127.0.0.1:" + port + "/WS/MyServiceToTest/1?WSDL"), 
        new QName("urn:myservicetotest.services.mycompany.com/1", "MyService")).getMyServicePort();
}

Is there any way to say Jetty to start in Debug Mode in order to put a breakpoint in Eclipse?

The test is run using Maven externally to Eclipse, then perhaps it is better to make a remote debugging in that case?
We do not want to have a big link with Eclipse, then it is why we start the jetty in all JUnits tests.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:04:00+00:00Added an answer on June 1, 2026 at 12:04 am

    We cannot change the embedded Jetty because the continous integration needs it and we will not maintain two version of the JUnit tests (automated or manual).

    The solutions I found are:

    1 – From maven with remote debug:

    Start the test with the following commmand (from maven site):

    mvn -Dmaven.surefire.debug="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 -Xnoagent -Djava.compiler=NONE" test
    

    and then start the Eclipse remote debug on port 8000.
    But this solution is not very clever: as the jetty is embedded, I have to manually start the remote debugging of Eclipse and it needs some synchronisation when I start maven from the command line (maven is not integrated to eclipse in that project).

    The best way we finally use is:

    2 – From Eclipse Junit

    I just execute the Junit Test from Eclipse in debug mode and this is just perfect: the jetty startup method does not need any option for debug mode as it is the JVM which starts in runtime or debug mode.

    I do not need to use the WTP jetty in the Eclipse, I just had to define the properties in the test like:

    ${jetty.port} 
    

    and the breakpoint stops where I want.

    The only configuration is in Eclipse and it will not change our code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a SQL Server 2005 database, and currently all our users are connecting
All of our applications have Debug=False in the web.config and Release DLL's. We have
Our database server is a SQL 2008 server. My colleagues all have XP service
We have an asp app on which people can take tests. On the test
Here is the problem: We have all of our development under subversion, but our
We have a Library Project that we use for all our central reused code
Hi on our dev environment we have show all errors, warnings and notices. I'm
Right now we have AD/Exchange to manage all of our users logins/e-mail on-site at
I have written a Windows service to collect information from all of our SQL
I have a Windows Service written in C# that handles all of our external

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.