You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Benson Margulies <bi...@gmail.com> on 2011/05/01 15:17:04 UTC

confused about web.xml servlet config versus JAX-RS versus static pages

It dawns on me very belatedly that I do not understand
servlet-mapping. In the following, I'm expecting this to result in
urls like http://localhost:port/APPNAME/services/whatever being
available in CXF.

(web.xml)

<servlet-mapping>
 <servlet-name>cxf</servlet-name>
 <url-pattern>/services/*</url-pattern>
</servlet-mapping>

(Spring config)

<jaxrs:server id="services" address="/services">

The following exemplifies the fact that this isn't so. Are the cxf
services substituted in at the *?

2011-05-01 09:13:50,393 [http-9167-1] WARN
org.apache.cxf.transport.servlet.ServletController - Can't find the
the request for
http://localhost:9167/lsh/services/admin/system-config's Observer

Re: confused about web.xml servlet config versus JAX-RS versus static pages

Posted by Sergey Beryozkin <sb...@gmail.com>.
Request URI has to match a given servlet mapping, and then whatever is
left after the match, in your case it is
"/admin/system-config" is matched against available destination
addresses, such as "/services" so it does not work.
Thus you have few options for jaxrs:address: "/", "/admin" (but this
implies 'admin' should be removed from a corresponding root resource
@Path), etc

Cheers, Sergey

On Sun, May 1, 2011 at 2:22 PM, Benson Margulies <bi...@gmail.com> wrote:
> Oh, D'uh, the truth suddenly dawns. I want 'address="/"' in my Spring.
>
> On Sun, May 1, 2011 at 9:17 AM, Benson Margulies <bi...@gmail.com> wrote:
>> It dawns on me very belatedly that I do not understand
>> servlet-mapping. In the following, I'm expecting this to result in
>> urls like http://localhost:port/APPNAME/services/whatever being
>> available in CXF.
>>
>> (web.xml)
>>
>> <servlet-mapping>
>>  <servlet-name>cxf</servlet-name>
>>  <url-pattern>/services/*</url-pattern>
>> </servlet-mapping>
>>
>> (Spring config)
>>
>> <jaxrs:server id="services" address="/services">
>>
>> The following exemplifies the fact that this isn't so. Are the cxf
>> services substituted in at the *?
>>
>> 2011-05-01 09:13:50,393 [http-9167-1] WARN
>> org.apache.cxf.transport.servlet.ServletController - Can't find the
>> the request for
>> http://localhost:9167/lsh/services/admin/system-config's Observer
>>
>



-- 
Sergey Beryozkin

Application Integration Division of Talend
http://sberyozkin.blogspot.com

Re: confused about web.xml servlet config versus JAX-RS versus static pages

Posted by Benson Margulies <bi...@gmail.com>.
Oh, D'uh, the truth suddenly dawns. I want 'address="/"' in my Spring.

On Sun, May 1, 2011 at 9:17 AM, Benson Margulies <bi...@gmail.com> wrote:
> It dawns on me very belatedly that I do not understand
> servlet-mapping. In the following, I'm expecting this to result in
> urls like http://localhost:port/APPNAME/services/whatever being
> available in CXF.
>
> (web.xml)
>
> <servlet-mapping>
>  <servlet-name>cxf</servlet-name>
>  <url-pattern>/services/*</url-pattern>
> </servlet-mapping>
>
> (Spring config)
>
> <jaxrs:server id="services" address="/services">
>
> The following exemplifies the fact that this isn't so. Are the cxf
> services substituted in at the *?
>
> 2011-05-01 09:13:50,393 [http-9167-1] WARN
> org.apache.cxf.transport.servlet.ServletController - Can't find the
> the request for
> http://localhost:9167/lsh/services/admin/system-config's Observer
>