You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by rangeli nepal <ra...@gmail.com> on 2010/05/17 23:52:27 UTC

Path problem.

I have a custom filter and my application was working nice and fine. I had
a configuration as shown in beginning section. My class declaration was
something like following:

  Later on  since I have to use this filter in many  my service, I changed
my configuration as shown in end section. Now I get errors like


17:25:52,663 WARNING [JAXRSInInterceptor] No root resource matching request
path /login/ has been found.
17:25:52,678 WARNING [WebApplicationExceptionMapper] WebApplicationException
has been caught : no cause is available
17:37:07,811 WARNING [JAXRSInInterceptor] No root resource matching request
path /login has been found.
17:37:07,811 WARNING [WebApplicationExceptionMapper] WebApplicationException
has been caught : no cause is available
17:38:31,257 WARNING [JAXRSInInterceptor] No root resource matching request
path /users/ has been found.
17:38:31,258 WARNING [WebApplicationExceptionMapper] WebApplicationException
has been caught : no cause is available

Any clue will be highly appreciated.
Thank you.
Santos








beginning:

<jaxrs:server id="myService" address="/">
 25         <jaxrs:serviceBeans>
 26             <ref bean="serviceImpl" />
 27         </jaxrs:serviceBeans>
 28
 29         <jaxrs:providers>
 30            <ref bean="authorizationFilter" />
 31          </jaxrs:providers>
 32
 33
 34         <jaxrs:extensionMappings>
 35             <entry key="xml" value="application/xml" />
 36         </jaxrs:extensionMappings>
 37     </jaxrs:server>


@Path("/myservice/")
  @Produces("application/xml")
  public class ServiceImpl implements ServiceDefn {


      @GET
      @Path("/users")
      public UserCollection getUsers() {
          return new UserCollection(users.values());
      }

end:

<jaxrs:server id="myService" address="/myservice">
        <jaxrs:serviceBeans>
            <ref bean="serviceImpl" />
        </jaxrs:serviceBeans>

        <jaxrs:providers>
           <ref bean="authorizationFilter" />
         </jaxrs:providers>


        <jaxrs:extensionMappings>
            <entry key="xml" value="application/xml" />
        </jaxrs:extensionMappings>
    </jaxrs:server>

    <jaxrs:server id="loginService" address="/loginservice">
        <jaxrs:serviceBeans>
            <ref bean="loginImpl" />
        </jaxrs:serviceBeans>

        <jaxrs:providers>
           <ref bean="authorizationFilter" />
         </jaxrs:providers>

        <jaxrs:extensionMappings>
            <entry key="xml" value="application/xml" />
        </jaxrs:extensionMappings>
    </jaxrs:server>

Re: Path problem.

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

if you have jaxrs:server/@address= "/myservice" then you'd need to remove
@Path("/myservice/") from the resource class. So you have a URI like '
http://host/myservice/users' then 'myservice' will be matched against
jaxrs:server/@address= "/myservice" with "users" remaining and thus if you
do not remove @Path("/myservice") then  you'll get an error. Similarly for a
login service....

cheers, Sergey

On Mon, May 17, 2010 at 10:52 PM, rangeli nepal <ra...@gmail.com>wrote:

> I have a custom filter and my application was working nice and fine. I had
> a configuration as shown in beginning section. My class declaration was
> something like following:
>
>  Later on  since I have to use this filter in many  my service, I changed
> my configuration as shown in end section. Now I get errors like
>
>
> 17:25:52,663 WARNING [JAXRSInInterceptor] No root resource matching request
> path /login/ has been found.
> 17:25:52,678 WARNING [WebApplicationExceptionMapper]
> WebApplicationException
> has been caught : no cause is available
> 17:37:07,811 WARNING [JAXRSInInterceptor] No root resource matching request
> path /login has been found.
> 17:37:07,811 WARNING [WebApplicationExceptionMapper]
> WebApplicationException
> has been caught : no cause is available
> 17:38:31,257 WARNING [JAXRSInInterceptor] No root resource matching request
> path /users/ has been found.
> 17:38:31,258 WARNING [WebApplicationExceptionMapper]
> WebApplicationException
> has been caught : no cause is available
>
> Any clue will be highly appreciated.
> Thank you.
> Santos
>
>
>
>
>
>
>
>
> beginning:
>
> <jaxrs:server id="myService" address="/">
>  25         <jaxrs:serviceBeans>
>  26             <ref bean="serviceImpl" />
>  27         </jaxrs:serviceBeans>
>  28
>  29         <jaxrs:providers>
>  30            <ref bean="authorizationFilter" />
>  31          </jaxrs:providers>
>  32
>  33
>  34         <jaxrs:extensionMappings>
>  35             <entry key="xml" value="application/xml" />
>  36         </jaxrs:extensionMappings>
>  37     </jaxrs:server>
>
>
> @Path("/myservice/")
>  @Produces("application/xml")
>  public class ServiceImpl implements ServiceDefn {
>
>
>      @GET
>      @Path("/users")
>      public UserCollection getUsers() {
>          return new UserCollection(users.values());
>      }
>
> end:
>
> <jaxrs:server id="myService" address="/myservice">
>        <jaxrs:serviceBeans>
>            <ref bean="serviceImpl" />
>        </jaxrs:serviceBeans>
>
>        <jaxrs:providers>
>           <ref bean="authorizationFilter" />
>         </jaxrs:providers>
>
>
>        <jaxrs:extensionMappings>
>            <entry key="xml" value="application/xml" />
>        </jaxrs:extensionMappings>
>    </jaxrs:server>
>
>    <jaxrs:server id="loginService" address="/loginservice">
>        <jaxrs:serviceBeans>
>            <ref bean="loginImpl" />
>        </jaxrs:serviceBeans>
>
>        <jaxrs:providers>
>           <ref bean="authorizationFilter" />
>         </jaxrs:providers>
>
>        <jaxrs:extensionMappings>
>            <entry key="xml" value="application/xml" />
>        </jaxrs:extensionMappings>
>    </jaxrs:server>
>