cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CXF-4802) JAXRSServerFactoryBean server does not terminate
Date Fri, 20 Dec 2013 11:02:10 GMT

    [ https://issues.apache.org/jira/browse/CXF-4802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13853861#comment-13853861
] 

Sergey Beryozkin edited comment on CXF-4802 at 12/20/13 11:00 AM:
------------------------------------------------------------------

Hi Andriy, 
I've done the full circle with your patch :-), first I nearly applied it, then I started thinking,
hmm, that may have side-effects, so started modifying DestinationFactoryManager, DestinationFactory,
etc, so that a user can get the manager to get all the factories and then call shutdown on
each of them, and in the end I've discovered that all one needs to do is:

{code:java}
factoryBean.getBus().shutdown(false);
{code}

So, there it is :-).  So, sorry I haven't done the home work before here, but I'm glad we
can resolve this issue as not a problem, major thanks for your help here Andriy.

Cheers, Sergey 


was (Author: sergey_beryozkin):
Hi Andriy, 
I've done the full circle with your patch :-), first I nearly applied it, then I started thinking,
hmm, that may have side-effects, so started modifying DestinationFactoryManager, DestinationFactory,
etc, so that a user can get the manager to get all the factories and then call shutdown on
each of them, and in the end I've discovered that you one needs to do is:

{code:java}
factoryBean.getBus().shutdown(false);
{code}

So, there it is :-).  So, sorry I haven't done the home work before here, but I'm glad we
can resolve this issue as not a problem, major thanks for your help here Andriy.

Cheers, Sergey 

> JAXRSServerFactoryBean server does not terminate
> ------------------------------------------------
>
>                 Key: CXF-4802
>                 URL: https://issues.apache.org/jira/browse/CXF-4802
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.2
>         Environment: Windows 7, Eclipse Juno 
> java version "1.6.0_33"
> Java(TM) SE Runtime Environment (build 1.6.0_33-b05)
> Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)
>            Reporter: Andrew J. Macbeth
>            Priority: Minor
>         Attachments: patch-server-shutdown.txt
>
>
> When running from main(), the server process created from JAXRSServerFactoryBean does
not terminate when main() does.
> 		JAXRSServerFactoryBean factoryBean = new JAXRSServerFactoryBean();
> 		factoryBean.setResourceClasses(MyService.class);
> 		factoryBean.setResourceProvider(MyService.class,
> 				new SingletonResourceProvider(myService));
> 		factoryBean.setAddress("http://localhost:8080/info");
> 		factoryBean.setStart(false);
> 		Server server = factoryBean.create();
> 		server.start();
> 		try {
> 			System.out.print("Press ENTER to stop: ");
> 			System.in.read();
> 			server.stop();
> 			server.destroy();
> 			server = null;
> 		}
> This all dependencies in pom.xml:
> <dependency>
> 	<groupId>org.apache.cxf</groupId>
> 	<artifactId>cxf-rt-frontend-jaxrs</artifactId>
> 	<version>2.7.2</version>
> </dependency>
> <dependency>
> 	<groupId>org.apache.cxf</groupId>
> 	<artifactId>cxf-rt-transports-http-jetty</artifactId>
> 	<version>2.7.2</version>
> </dependency>



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Mime
View raw message