You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Florin Pop <po...@gmail.com> on 2013/04/10 11:33:53 UTC

!! How to publish a cxf endpoint and make it work even if i close eclipse

Hello everybody!

*I would like to publish a cxf endpoint which is configurend in spring. *

<jaxws:endpoint
id="serveru"
implementor="com.pachet.nou.HelloWorldImpl"
address="http://localhost:9003/ws/serviciu"
publishedEndpointUrl="http://localhost:9004/ws/serviciuok">

*I could use the structure below in order to instantiate the bean.*

ApplicationContext context = new ClassPathXmlApplicationContext(
"/com/pachet/nou/server.xml");
  EndpointImpl publishedService = (EndpointImpl) context.getBean("serveru");

*and then*

publishedService.publish();

*This starts jetty behind (i think) and i am able to see the wsdl in
browser. The problem is that when i close eclipse, the server is destroyed.
I would like to make it work all the time regardless of what application is
started or closed. *

*I also tried the code below.*

                HelloWorldImpl implementor = new HelloWorldImpl();
JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
svrFactory.setServiceClass(HelloWorld.class);
svrFactory.setAddress("http://localhost:9005/helloWorld");
svrFactory.setServiceBean(implementor);
svrFactory.create();

*How can i manage this situation? If i use this*

javax.xml.ws.Endpoint jaxwsEndpoint   *to make an endpoint public, it works
all the time until i call jaxwsEndpoint.unpublish(), even if i close
eclipse.*

Can i use the same behaviour with cxf?

Re: !! How to publish a cxf endpoint and make it work even if i close eclipse

Posted by Florin Pop <po...@gmail.com>.
Thank you!!!

You had right. If I publish the endpoint from eclipse, the service is
destroyed when eclipse closes.

10x again!

On Wed, Apr 10, 2013 at 12:47 PM, Freeman Fang <fr...@gmail.com>wrote:

> Hi,
>
> May not answer your question directly, but could you launch the CXF
> service outside eclipse using maven?
> My gut feeling is that if you start in eclipse, it's a sub-process of
> eclipse, so when eclipse is gone, your cxf service is also gone.
> -------------
> Freeman(Yue) Fang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://fusesource.com | http://www.redhat.com/
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: @Freeman小屋
>
> On 2013-4-10, at 下午5:33, Florin Pop wrote:
>
> > Hello everybody!
> >
> > *I would like to publish a cxf endpoint which is configurend in spring. *
> >
> > <jaxws:endpoint
> > id="serveru"
> > implementor="com.pachet.nou.HelloWorldImpl"
> > address="http://localhost:9003/ws/serviciu"
> > publishedEndpointUrl="http://localhost:9004/ws/serviciuok">
> >
> > *I could use the structure below in order to instantiate the bean.*
> >
> > ApplicationContext context = new ClassPathXmlApplicationContext(
> > "/com/pachet/nou/server.xml");
> >  EndpointImpl publishedService = (EndpointImpl)
> context.getBean("serveru");
> >
> > *and then*
> >
> > publishedService.publish();
> >
> > *This starts jetty behind (i think) and i am able to see the wsdl in
> > browser. The problem is that when i close eclipse, the server is
> destroyed.
> > I would like to make it work all the time regardless of what application
> is
> > started or closed. *
> >
> > *I also tried the code below.*
> >
> >                HelloWorldImpl implementor = new HelloWorldImpl();
> > JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
> > svrFactory.setServiceClass(HelloWorld.class);
> > svrFactory.setAddress("http://localhost:9005/helloWorld");
> > svrFactory.setServiceBean(implementor);
> > svrFactory.create();
> >
> > *How can i manage this situation? If i use this*
> >
> > javax.xml.ws.Endpoint jaxwsEndpoint   *to make an endpoint public, it
> works
> > all the time until i call jaxwsEndpoint.unpublish(), even if i close
> > eclipse.*
> >
> > Can i use the same behaviour with cxf?
>
>

Re: !! How to publish a cxf endpoint and make it work even if i close eclipse

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

May not answer your question directly, but could you launch the CXF service outside eclipse using maven?
My gut feeling is that if you start in eclipse, it's a sub-process of eclipse, so when eclipse is gone, your cxf service is also gone.
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-4-10, at 下午5:33, Florin Pop wrote:

> Hello everybody!
> 
> *I would like to publish a cxf endpoint which is configurend in spring. *
> 
> <jaxws:endpoint
> id="serveru"
> implementor="com.pachet.nou.HelloWorldImpl"
> address="http://localhost:9003/ws/serviciu"
> publishedEndpointUrl="http://localhost:9004/ws/serviciuok">
> 
> *I could use the structure below in order to instantiate the bean.*
> 
> ApplicationContext context = new ClassPathXmlApplicationContext(
> "/com/pachet/nou/server.xml");
>  EndpointImpl publishedService = (EndpointImpl) context.getBean("serveru");
> 
> *and then*
> 
> publishedService.publish();
> 
> *This starts jetty behind (i think) and i am able to see the wsdl in
> browser. The problem is that when i close eclipse, the server is destroyed.
> I would like to make it work all the time regardless of what application is
> started or closed. *
> 
> *I also tried the code below.*
> 
>                HelloWorldImpl implementor = new HelloWorldImpl();
> JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
> svrFactory.setServiceClass(HelloWorld.class);
> svrFactory.setAddress("http://localhost:9005/helloWorld");
> svrFactory.setServiceBean(implementor);
> svrFactory.create();
> 
> *How can i manage this situation? If i use this*
> 
> javax.xml.ws.Endpoint jaxwsEndpoint   *to make an endpoint public, it works
> all the time until i call jaxwsEndpoint.unpublish(), even if i close
> eclipse.*
> 
> Can i use the same behaviour with cxf?


Re: !! How to publish a cxf endpoint and make it work even if i close eclipse

Posted by Mark Streit <mc...@gmail.com>.
You might wish to try an approach *outside *of using the Eclipse IDE - I
would suggest the following helpful tutorials by Glen Mazza:

http://www.jroller.com/gmazza/entry/blog_article_index

http://www.jroller.com/gmazza/entry/web_service_tutorial
http://www.jroller.com/gmazza/entry/java_first_web_service
http://www.jroller.com/gmazza/entry/soap_client_tutorial


Hope these help...

Mark

On Wed, Apr 10, 2013 at 5:33 AM, Florin Pop <po...@gmail.com> wrote:

> Hello everybody!
>
> *I would like to publish a cxf endpoint which is configurend in spring. *
>
> <jaxws:endpoint
> id="serveru"
> implementor="com.pachet.nou.HelloWorldImpl"
> address="http://localhost:9003/ws/serviciu"
> publishedEndpointUrl="http://localhost:9004/ws/serviciuok">
>
> *I could use the structure below in order to instantiate the bean.*
>
> ApplicationContext context = new ClassPathXmlApplicationContext(
> "/com/pachet/nou/server.xml");
>   EndpointImpl publishedService = (EndpointImpl)
> context.getBean("serveru");
>
> *and then*
>
> publishedService.publish();
>
> *This starts jetty behind (i think) and i am able to see the wsdl in
> browser. The problem is that when i close eclipse, the server is destroyed.
> I would like to make it work all the time regardless of what application is
> started or closed. *
>
> *I also tried the code below.*
>
>                 HelloWorldImpl implementor = new HelloWorldImpl();
> JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
> svrFactory.setServiceClass(HelloWorld.class);
> svrFactory.setAddress("http://localhost:9005/helloWorld");
> svrFactory.setServiceBean(implementor);
> svrFactory.create();
>
> *How can i manage this situation? If i use this*
>
> javax.xml.ws.Endpoint jaxwsEndpoint   *to make an endpoint public, it works
> all the time until i call jaxwsEndpoint.unpublish(), even if i close
> eclipse.*
>
> Can i use the same behaviour with cxf?
>