You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Rice Yeh <ri...@gmail.com> on 2011/01/30 09:58:21 UTC
[JAXRS, OSGi] registering CXFNonSpringServlet to alias "/" causes
problem when running on pax-web
Hi,
I just find that registering CXFNonSpringSerlvet to alias "/" will cause
problem when running on Pax Web. The problem is that the method
getBaseAddress(Message) in org.apache.cxf.jaxrs.utils.HttpUtils class will
wrongly return the the request address ("a/b/c") appended with "/", that is
("a/b/c/"), instead of the correct servlet path ("/"). I think that this is
more likely a bug of Pax Web. What will you think?
Rice
Re: [JAXRS, OSGi] registering CXFNonSpringServlet to alias "/"
causes problem when running on pax-web
Posted by Jason Downey <js...@gmail.com>.
Hello,
Ran a quick test in my Apache CXF JAX-RS OSGI environment:
* Both Pax Web 0.7.4 & 0.8.1 displayed the issue (running on Apache Felix)
* Apache Felix HTTP 2.0.4 did not display the issue (running on Apache
Felix)
* org.eclipse.equinox.http.jetty_2.0.0.v20100503 did not display the issue
(running on Equinox 3.6.1)
It's most likely bug in Pax Web. If you do need to run in Pax Web, you could
create your own Servlet that extends CXFNonSpringJaxrsServlet, overriding
createServletController so that your ServletController calculates getBaseURL
however you desire.
-jd
--
View this message in context: http://cxf.547215.n5.nabble.com/JAXRS-OSGi-registering-CXFNonSpringServlet-to-alias-causes-problem-when-running-on-pax-web-tp3363287p3363934.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: [JAXRS, OSGi] registering CXFNonSpringServlet to alias "/" causes
problem when running on pax-web
Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi
On Sun, Jan 30, 2011 at 8:58 AM, Rice Yeh <ri...@gmail.com> wrote:
> Hi,
> I just find that registering CXFNonSpringSerlvet to alias "/" will cause
> problem when running on Pax Web. The problem is that the method
> getBaseAddress(Message) in org.apache.cxf.jaxrs.utils.HttpUtils class will
> wrongly return the the request address ("a/b/c") appended with "/", that is
> ("a/b/c/"), instead of the correct servlet path ("/"). I think that this
> is
> more likely a bug of Pax Web. What will you think?
>
> Can you please give a bit more info ? Can you please start from
HttpUtils.getPathToMatch() and see how the wrong value gets produced in the
end ?
When you register CXFJaxrsNon/cSpringSerlvet on "/", what happens with
request URIs such as http://localhost:8080/a/b/c ?
Do you rely by any chance on the CXF http osgi transport ? If yes then could
be some issues there re handling "/".
cheers, Sergey
> Rice
>