You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Davide Gesino <wi...@libero.it> on 2007/12/20 18:31:14 UTC
Jetty + spring, I am missing a point
I have always been using CXF deployed on tomcat.
Switching to Jetty embedded I have some problems trying to understand some
things.
When I first publish and Endpoint CXF such as:
Endpoint.publish(address, implementor);
CXF loads the cxf.xml file and the Bus and everything else are instantiated,
the jetty server is started and the endpoints get published.
I would like to create everything in a Spring fashion without using
(eventually) the Endpoint.publish, with Spring creating and publishign
magically the endpoints 4 me.
Creating an ApplicationContext explicitly in my code I see almost everthing
to be correctly instantiated, but the Jetty server seems not to be up and
running.
Should I have to start it explicitly?
In this case what should be the proper endpoint address in the cxf file??
4 example assuming:
Object implementor = new GreeterImpl();
String address = "http://localhost:8080/SoapContext/SoapPort";
Endpoint.create(Greeter.class);
what should I have to write in my cxf.xml, something like;
<jaxws:endpoint id="creditEndpoint" address
="http://localhost:9000/SoapContext/SoapPort"
implementor="org.apache.hello_world_soap_http.GreeterImpl" >
</jaxws:endpoint> ??
Where is my fault?
--
View this message in context: http://www.nabble.com/Jetty-%2B-spring%2C-I-am-missing-a-point-tp14440937p14440937.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: Jetty + spring, I am missing a point
Posted by Jim Ma <em...@iona.com>.
Davide Gesino wrote:
> I have always been using CXF deployed on tomcat.
> Switching to Jetty embedded I have some problems trying to understand some
> things.
>
> When I first publish and Endpoint CXF such as:
> Endpoint.publish(address, implementor);
> CXF loads the cxf.xml file and the Bus and everything else are instantiated,
> the jetty server is started and the endpoints get published.
>
> I would like to create everything in a Spring fashion without using
> (eventually) the Endpoint.publish, with Spring creating and publishign
> magically the endpoints 4 me.
> Creating an ApplicationContext explicitly in my code I see almost everthing
> to be correctly instantiated, but the Jetty server seems not to be up and
> running.
> Should I have to start it explicitly?
> In this case what should be the proper endpoint address in the cxf file??
>
> 4 example assuming:
> Object implementor = new GreeterImpl();
> String address = "http://localhost:8080/SoapContext/SoapPort";
> Endpoint.create(Greeter.class);
>
> what should I have to write in my cxf.xml, something like;
>
> <jaxws:endpoint id="creditEndpoint" address
> ="http://localhost:9000/SoapContext/SoapPort"
> implementor="org.apache.hello_world_soap_http.GreeterImpl" >
> </jaxws:endpoint> ??
>
> Where is my fault?
>
>
Did you use this spring configuration to create the ApplicationContext ?
If yes , then you do not need to
start the sever explicitly . Cxf use the spring bean definition parser
to create the Endpoint and publish it
automatically.
The address is also correct in your spring configuration . I do not see
any error . I tired the following junit test code
it works.
@Test
public void testEndpoints() throws Exception {
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(new String[]
{"/org/apache/cxf/systest/spring/tmp.xml"});
Thread.sleep(300*1000);
}
Regards
Jim
Re: Jetty + spring, I am missing a point
Posted by Willem Jiang <wi...@gmail.com>.
You need to create the spring bus first to triage the spring application
context loading.
SpringBusFactory bf = new SpringBusFactory();
Bus bus = bf.createBus();
Or you can take the http-jetty systest as an example[1]
[1]
https://svn.apache.org/repos/asf/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/http_jetty
Willem.
Davide Gesino wrote:
> I have always been using CXF deployed on tomcat.
> Switching to Jetty embedded I have some problems trying to understand some
> things.
>
> When I first publish and Endpoint CXF such as:
> Endpoint.publish(address, implementor);
> CXF loads the cxf.xml file and the Bus and everything else are instantiated,
> the jetty server is started and the endpoints get published.
>
> I would like to create everything in a Spring fashion without using
> (eventually) the Endpoint.publish, with Spring creating and publishign
> magically the endpoints 4 me.
> Creating an ApplicationContext explicitly in my code I see almost everthing
> to be correctly instantiated, but the Jetty server seems not to be up and
> running.
> Should I have to start it explicitly?
>
> In this case what should be the proper endpoint address in the cxf file??
>
> 4 example assuming:
> Object implementor = new GreeterImpl();
> String address = "http://localhost:8080/SoapContext/SoapPort";
> Endpoint.create(Greeter.class);
>
> what should I have to write in my cxf.xml, something like;
>
> <jaxws:endpoint id="creditEndpoint" address
> ="http://localhost:9000/SoapContext/SoapPort"
> implementor="org.apache.hello_world_soap_http.GreeterImpl" >
> </jaxws:endpoint> ??
>
> Where is my fault?
>
>
>
>
>