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 8366459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:55:28+00:00 2026-06-09T12:55:28+00:00

I have a console application which can be briefly described with this code: public

  • 0

I have a console application which can be briefly described with this code:

public static void main(String[] args) throws InterruptedException {
    JAXRSServerFactoryBean sfb = new JAXRSServerFactoryBean();
    sfb.setResourceClasses(DummyService.class);
    sfb.setResourceProvider(DummyService.class, new SingletonResourceProvider(new DummyServiceImpl()));
    sfb.setProvider(new JacksonJaxbJsonProvider());
    sfb.setAddress("http://0.0.0.0:9000/");
    BindingFactoryManager manager = sfb.getBus().getExtension(BindingFactoryManager.class);
    JAXRSBindingFactory bindingFactory = new JAXRSBindingFactory();
    bindingFactory.setBus(sfb.getBus());
    manager.registerBindingFactory(JAXRSBindingFactory.JAXRS_BINDING_ID, bindingFactory);
    Server server = sfb.create();       
    server.stop(); // here
}

I run this program from Eclipse and I expect it to finish immediately, because I have server.stop() right in the end. This line of code is executed by application remains alive, so I have to shutdown it manually. Here’s the log CXF prints to the console:

Aug 13, 2012 10:51:10 PM org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be http://0.0.0.0:9000/
2012-08-13 22:51:10.598:INFO:oejs.Server:jetty-7.5.3.v20111011
2012-08-13 22:51:10.646:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:9000 STARTING
2012-08-13 22:51:10.662:INFO:oejsh.ContextHandler:started o.e.j.s.h.ContextHandler{,null}
2012-08-13 22:51:10.663:INFO:oejsh.ContextHandler:stopped o.e.j.s.h.ContextHandler{,null}

After a call to server.stop() application is still running, but server doesn’t respond any requests, so it feels like I need to shutdown something else.

What is a proper way to stop it?

Update

server.stop();
server.destroy();

Also doesn’t work.

Update

<dependency>
  <groupId>org.apache.cxf</groupId>
  <artifactId>cxf-bundle-jaxrs</artifactId>
  <version>2.6.1</version>
</dependency>
  • 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-09T12:55:30+00:00Added an answer on June 9, 2026 at 12:55 pm

    Fixed with

    server.stop();
    server.destroy();
    sfb.getBus().shutdown(true)
    

    Feels like dirty hack.

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

Sidebar

Related Questions

I have a console application which can also open winform under certain conditions.Processing(its a
I have a console application from which I create a window. I can render
In my console application have an abstract Factory class Listener which contains code for
I have a (C#) console application which maintains a state. The state can be
I have a C# console application AAA.exe which can return an integer to indicate
I have written small C++ console application and this is source code : #include<stdio.h>
I have a console application which is parsing HTML documents via the WebRequest method
I have a console application which has target .NET 2.0 It is very short
I have a c++ console application which I would like to publish using clickonce.
I have the sample console application which is supposed to be executed in the

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.