I suspect Drazen seeing the issue Christian and myself reproduced with DOSGi CXF.

I've just run two separate demos in Karaf, both demos bind to CXF Servlet transport (with alias configured from /cxf to /services) but the actual endpoints have relative addresses, say "/a" & "/b"

So when the first demo is deployed, it creates an endpoint available at say "http://localhost:8080/services/a";

and then next demo creates the endpoint at

"http://localhost:8080/services/b";.

So it is different bundles sharing the same "/services" context.

It works fine - both endpoints can be accessed in random order.

Now, in DOSGi one can actually get a new HTTP context created per every endpoint, even from within the same bundle, so we may have say

"http://localhost:8080/services1/a";
"http://localhost:8080/services2/b";

Note, different contexts "/services1" & "/services2".

And if one calls "/services1" first then "/services2" becomes not available and the other way around.

Drazen, do you work with DOSgi by any chance ? If not can you please indeed provide more info on how the bundles/endpoints are configured ?

thanks, Sergey


On 12/12/12 12:36, Freeman Fang wrote:
Hi,

What's the transport your jaxrs server using? Is it the http-osgi 
transport(relative address) or the standalone http-jetty transport(address 
start with http://)?
Post your configuration here would be more helpful
-------------
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 2012-12-12, at 下午5:38, Dosta wrote:

Hello,


Up until now I was working with a single rest application that registered
multiple resources and started the server using the JAXRSServerFactoryBean
create method.

Problems arose when I introduced a second rest application that used the
same initialization procedures as the  first one (except that the resources
were different along with their registered paths) into the same OSGi
container.

Upon deployment of the second application, first became unreachable (404).
The second is just fine. The log shows that two servers were started and I
suspect that the second server start stopped/deregistered the old
server/application.

What is the correct way to create and register multiple independent
applications using CXF in the same OSGi container (currently using Karaf
2.3.0 and CXF 2.6.3)?
Do I have to create a service that would hold the JAXRSServerFactoryBean and
each application during initialization would get it and only append
resources to already existing ones (with mandatory restart of the server -
bean.start()).

Thanks in advance.


Greetings,
Drazen



--
View this message in context: 
http://cxf.547215.n5.nabble.com/CXF-in-OSGi-Multiple-applications-tp5720093.html
Sent from the cxf-user mailing list archive at Nabble.com.




--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to