You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Greg Logan <gr...@gmail.com> on 2019/02/15 19:47:32 UTC

REST routing issue

Hi all,

I'm from the Opencast project (opencast.org), which uses Karaf, and CXF
among other frameworks.  We're seeing an issue where requests to a
non-existent endpoint are being dispatched to the alphabetically first
endpoint which matches the request parameters.  For instance, GETting
/info/{int}, which does not exist, gets you admin-ui/acl/{int}.

I've run through the stack trace, and I think it's CXF, but my mail on that
list hasn't gotten any traction so I figured I would expand my search.  Is
CXF what I'm looking for here?  Or is it some other part of Karaf?

Thanks,
G

Re: REST routing issue

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Thanks for the update Greg. I will take a look.

Regards
JB

On 19/02/2019 22:12, Greg Logan wrote:
> Hi JB,
> 
> An example built tarball lives
> in http://build.opencast.org/builds/r6.x/, or you can take a look at the
> contents of https://github.com/opencast/opencast/tree/r/6.x/etc.  As far
> as I know we're not entering any special redirections.  The demo servers
> have nginx running in front of Karaf but they also don't configure any
> redirects which affect this (config
> at https://github.com/opencast/opencast-project-infrastructure/blob/master/ansible-allinone-demo-vm/roles/nginx/templates/nginx.conf)
> 
> G
> 
> On Sat, Feb 16, 2019 at 12:00 AM Jean-Baptiste Onofré <jb@nanthrax.net
> <ma...@nanthrax.net>> wrote:
> 
>     Hi
> 
>     I don't think Karaf (Pax Web/Jetty) or CXF are doing this "redirection"
>     by default.
> 
>     I have to take a look in opencast how CXF and Jetty is configured (maybe
>     a redirect in jetty.xml).
> 
>     Regards
>     JB
> 
>     On 15/02/2019 21:06, Greg Logan wrote:
>     > Correct.  For example, our demo server:
>     > https://stable.opencast.org/info/501 returns (after logging in
>     with the
>     > provided credentials) a JSON blob of an ACL.  There is no endpoint
>     > /info/{int}.  What's you're actually talking to
>     > is https://stable.opencast.org/admin-ng/acl/501, which happens to
>     take a
>     > single integer and be a GET request endpoint, and be alphabetically
>     > first in our full list of endpoints :)
>     >
>     > G
>     >
>     > On Fri, Feb 15, 2019 at 1:58 PM Jean-Baptiste Onofré
>     <jb@nanthrax.net <ma...@nanthrax.net>
>     > <mailto:jb@nanthrax.net <ma...@nanthrax.net>>> wrote:
>     >
>     >     Hi Greg,
>     >
>     >     Do you have a simple test case to reproduce it ?
>     >
>     >     To be sure I understand, when you try GET on
>     >     http://host:8181/cxf/info/10 you go to
>     >     http://host:8181/cxf/admin-ui/acl/10 ("cxf" part of the URL can be
>     >     different depending of the CXF cfg file) ?
>     >
>     >     Regards
>     >     JB
>     >
>     >     On 15/02/2019 20:47, Greg Logan wrote:
>     >     > Hi all,
>     >     >
>     >     > I'm from the Opencast project (opencast.org
>     <http://opencast.org> <http://opencast.org>
>     >     <http://opencast.org/>),
>     >     > which uses Karaf, and CXF among other frameworks.  We're
>     seeing an
>     >     issue
>     >     > where requests to a non-existent endpoint are being
>     dispatched to the
>     >     > alphabetically first endpoint which matches the request
>     >     parameters.  For
>     >     > instance, GETting /info/{int}, which does not exist, gets you
>     >     > admin-ui/acl/{int}.
>     >     >
>     >     > I've run through the stack trace, and I think it's CXF, but
>     my mail on
>     >     > that list hasn't gotten any traction so I figured I would
>     expand my
>     >     > search.  Is CXF what I'm looking for here?  Or is it some other
>     >     part of
>     >     > Karaf?
>     >     >
>     >     > Thanks,
>     >     > G
>     >
>     >     --
>     >     Jean-Baptiste Onofré
>     >     jbonofre@apache.org <ma...@apache.org>
>     <mailto:jbonofre@apache.org <ma...@apache.org>>
>     >     http://blog.nanthrax.net
>     >     Talend - http://www.talend.com
>     >
> 
>     -- 
>     Jean-Baptiste Onofré
>     jbonofre@apache.org <ma...@apache.org>
>     http://blog.nanthrax.net
>     Talend - http://www.talend.com
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: REST routing issue

Posted by Greg Logan <gr...@gmail.com>.
Hi JB,

An example built tarball lives in http://build.opencast.org/builds/r6.x/,
or you can take a look at the contents of
https://github.com/opencast/opencast/tree/r/6.x/etc.  As far as I know
we're not entering any special redirections.  The demo servers have nginx
running in front of Karaf but they also don't configure any redirects which
affect this (config at
https://github.com/opencast/opencast-project-infrastructure/blob/master/ansible-allinone-demo-vm/roles/nginx/templates/nginx.conf
)

G

On Sat, Feb 16, 2019 at 12:00 AM Jean-Baptiste Onofré <jb...@nanthrax.net>
wrote:

> Hi
>
> I don't think Karaf (Pax Web/Jetty) or CXF are doing this "redirection"
> by default.
>
> I have to take a look in opencast how CXF and Jetty is configured (maybe
> a redirect in jetty.xml).
>
> Regards
> JB
>
> On 15/02/2019 21:06, Greg Logan wrote:
> > Correct.  For example, our demo server:
> > https://stable.opencast.org/info/501 returns (after logging in with the
> > provided credentials) a JSON blob of an ACL.  There is no endpoint
> > /info/{int}.  What's you're actually talking to
> > is https://stable.opencast.org/admin-ng/acl/501, which happens to take a
> > single integer and be a GET request endpoint, and be alphabetically
> > first in our full list of endpoints :)
> >
> > G
> >
> > On Fri, Feb 15, 2019 at 1:58 PM Jean-Baptiste Onofré <jb@nanthrax.net
> > <ma...@nanthrax.net>> wrote:
> >
> >     Hi Greg,
> >
> >     Do you have a simple test case to reproduce it ?
> >
> >     To be sure I understand, when you try GET on
> >     http://host:8181/cxf/info/10 you go to
> >     http://host:8181/cxf/admin-ui/acl/10 ("cxf" part of the URL can be
> >     different depending of the CXF cfg file) ?
> >
> >     Regards
> >     JB
> >
> >     On 15/02/2019 20:47, Greg Logan wrote:
> >     > Hi all,
> >     >
> >     > I'm from the Opencast project (opencast.org <http://opencast.org>
> >     <http://opencast.org/>),
> >     > which uses Karaf, and CXF among other frameworks.  We're seeing an
> >     issue
> >     > where requests to a non-existent endpoint are being dispatched to
> the
> >     > alphabetically first endpoint which matches the request
> >     parameters.  For
> >     > instance, GETting /info/{int}, which does not exist, gets you
> >     > admin-ui/acl/{int}.
> >     >
> >     > I've run through the stack trace, and I think it's CXF, but my
> mail on
> >     > that list hasn't gotten any traction so I figured I would expand my
> >     > search.  Is CXF what I'm looking for here?  Or is it some other
> >     part of
> >     > Karaf?
> >     >
> >     > Thanks,
> >     > G
> >
> >     --
> >     Jean-Baptiste Onofré
> >     jbonofre@apache.org <ma...@apache.org>
> >     http://blog.nanthrax.net
> >     Talend - http://www.talend.com
> >
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: REST routing issue

Posted by Greg Logan <gr...@gmail.com>.
Hi Francois,

We have the backend (REST endpoints) and frontend (javascript, html) being
served from the same Karaf instance yes.  We're running an nginx instance
in front of the demo servers, however I've experienced this connecting
directly to Karaf, so I'm going to guess that doesn't affect anything!

Thanks,
G

On Sat, Feb 16, 2019 at 5:45 AM Francois Papon <fr...@openobject.fr>
wrote:

> Hi Greg,
>
> You have webservices and webapp deployed in the same Karaf?
>
> Did you have an Apache Httpd proxy loadbalancer in front of Karaf?
>
> regards,
>
> François Papon
> fpapon@apache.org
>
> Le 16/02/2019 à 10:00, Jean-Baptiste Onofré a écrit :
> > Hi
> >
> > I don't think Karaf (Pax Web/Jetty) or CXF are doing this "redirection"
> > by default.
> >
> > I have to take a look in opencast how CXF and Jetty is configured (maybe
> > a redirect in jetty.xml).
> >
> > Regards
> > JB
> >
> > On 15/02/2019 21:06, Greg Logan wrote:
> >> Correct.  For example, our demo server:
> >> https://stable.opencast.org/info/501 returns (after logging in with the
> >> provided credentials) a JSON blob of an ACL.  There is no endpoint
> >> /info/{int}.  What's you're actually talking to
> >> is https://stable.opencast.org/admin-ng/acl/501, which happens to take
> a
> >> single integer and be a GET request endpoint, and be alphabetically
> >> first in our full list of endpoints :)
> >>
> >> G
> >>
> >> On Fri, Feb 15, 2019 at 1:58 PM Jean-Baptiste Onofré <jb@nanthrax.net
> >> <ma...@nanthrax.net>> wrote:
> >>
> >>     Hi Greg,
> >>
> >>     Do you have a simple test case to reproduce it ?
> >>
> >>     To be sure I understand, when you try GET on
> >>     http://host:8181/cxf/info/10 you go to
> >>     http://host:8181/cxf/admin-ui/acl/10 ("cxf" part of the URL can be
> >>     different depending of the CXF cfg file) ?
> >>
> >>     Regards
> >>     JB
> >>
> >>     On 15/02/2019 20:47, Greg Logan wrote:
> >>     > Hi all,
> >>     >
> >>     > I'm from the Opencast project (opencast.org <http://opencast.org>
> >>     <http://opencast.org/>),
> >>     > which uses Karaf, and CXF among other frameworks.  We're seeing an
> >>     issue
> >>     > where requests to a non-existent endpoint are being dispatched to
> the
> >>     > alphabetically first endpoint which matches the request
> >>     parameters.  For
> >>     > instance, GETting /info/{int}, which does not exist, gets you
> >>     > admin-ui/acl/{int}.
> >>     >
> >>     > I've run through the stack trace, and I think it's CXF, but my
> mail on
> >>     > that list hasn't gotten any traction so I figured I would expand
> my
> >>     > search.  Is CXF what I'm looking for here?  Or is it some other
> >>     part of
> >>     > Karaf?
> >>     >
> >>     > Thanks,
> >>     > G
> >>
> >>     --
> >>     Jean-Baptiste Onofré
> >>     jbonofre@apache.org <ma...@apache.org>
> >>     http://blog.nanthrax.net
> >>     Talend - http://www.talend.com
> >>
>

Re: REST routing issue

Posted by Francois Papon <fr...@openobject.fr>.
Hi Greg,

You have webservices and webapp deployed in the same Karaf?

Did you have an Apache Httpd proxy loadbalancer in front of Karaf?

regards,

François Papon
fpapon@apache.org

Le 16/02/2019 à 10:00, Jean-Baptiste Onofré a écrit :
> Hi
>
> I don't think Karaf (Pax Web/Jetty) or CXF are doing this "redirection"
> by default.
>
> I have to take a look in opencast how CXF and Jetty is configured (maybe
> a redirect in jetty.xml).
>
> Regards
> JB
>
> On 15/02/2019 21:06, Greg Logan wrote:
>> Correct.  For example, our demo server:
>> https://stable.opencast.org/info/501 returns (after logging in with the
>> provided credentials) a JSON blob of an ACL.  There is no endpoint
>> /info/{int}.  What's you're actually talking to
>> is https://stable.opencast.org/admin-ng/acl/501, which happens to take a
>> single integer and be a GET request endpoint, and be alphabetically
>> first in our full list of endpoints :)
>>
>> G
>>
>> On Fri, Feb 15, 2019 at 1:58 PM Jean-Baptiste Onofré <jb@nanthrax.net
>> <ma...@nanthrax.net>> wrote:
>>
>>     Hi Greg,
>>
>>     Do you have a simple test case to reproduce it ?
>>
>>     To be sure I understand, when you try GET on
>>     http://host:8181/cxf/info/10 you go to
>>     http://host:8181/cxf/admin-ui/acl/10 ("cxf" part of the URL can be
>>     different depending of the CXF cfg file) ?
>>
>>     Regards
>>     JB
>>
>>     On 15/02/2019 20:47, Greg Logan wrote:
>>     > Hi all,
>>     >
>>     > I'm from the Opencast project (opencast.org <http://opencast.org>
>>     <http://opencast.org/>),
>>     > which uses Karaf, and CXF among other frameworks.  We're seeing an
>>     issue
>>     > where requests to a non-existent endpoint are being dispatched to the
>>     > alphabetically first endpoint which matches the request
>>     parameters.  For
>>     > instance, GETting /info/{int}, which does not exist, gets you
>>     > admin-ui/acl/{int}.
>>     >
>>     > I've run through the stack trace, and I think it's CXF, but my mail on
>>     > that list hasn't gotten any traction so I figured I would expand my
>>     > search.  Is CXF what I'm looking for here?  Or is it some other
>>     part of
>>     > Karaf?
>>     >
>>     > Thanks,
>>     > G
>>
>>     -- 
>>     Jean-Baptiste Onofré
>>     jbonofre@apache.org <ma...@apache.org>
>>     http://blog.nanthrax.net
>>     Talend - http://www.talend.com
>>

Re: REST routing issue

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi

I don't think Karaf (Pax Web/Jetty) or CXF are doing this "redirection"
by default.

I have to take a look in opencast how CXF and Jetty is configured (maybe
a redirect in jetty.xml).

Regards
JB

On 15/02/2019 21:06, Greg Logan wrote:
> Correct.  For example, our demo server:
> https://stable.opencast.org/info/501 returns (after logging in with the
> provided credentials) a JSON blob of an ACL.  There is no endpoint
> /info/{int}.  What's you're actually talking to
> is https://stable.opencast.org/admin-ng/acl/501, which happens to take a
> single integer and be a GET request endpoint, and be alphabetically
> first in our full list of endpoints :)
> 
> G
> 
> On Fri, Feb 15, 2019 at 1:58 PM Jean-Baptiste Onofré <jb@nanthrax.net
> <ma...@nanthrax.net>> wrote:
> 
>     Hi Greg,
> 
>     Do you have a simple test case to reproduce it ?
> 
>     To be sure I understand, when you try GET on
>     http://host:8181/cxf/info/10 you go to
>     http://host:8181/cxf/admin-ui/acl/10 ("cxf" part of the URL can be
>     different depending of the CXF cfg file) ?
> 
>     Regards
>     JB
> 
>     On 15/02/2019 20:47, Greg Logan wrote:
>     > Hi all,
>     >
>     > I'm from the Opencast project (opencast.org <http://opencast.org>
>     <http://opencast.org/>),
>     > which uses Karaf, and CXF among other frameworks.  We're seeing an
>     issue
>     > where requests to a non-existent endpoint are being dispatched to the
>     > alphabetically first endpoint which matches the request
>     parameters.  For
>     > instance, GETting /info/{int}, which does not exist, gets you
>     > admin-ui/acl/{int}.
>     >
>     > I've run through the stack trace, and I think it's CXF, but my mail on
>     > that list hasn't gotten any traction so I figured I would expand my
>     > search.  Is CXF what I'm looking for here?  Or is it some other
>     part of
>     > Karaf?
>     >
>     > Thanks,
>     > G
> 
>     -- 
>     Jean-Baptiste Onofré
>     jbonofre@apache.org <ma...@apache.org>
>     http://blog.nanthrax.net
>     Talend - http://www.talend.com
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: REST routing issue

Posted by Greg Logan <gr...@gmail.com>.
Correct.  For example, our demo server: https://stable.opencast.org/info/501
returns (after logging in with the provided credentials) a JSON blob of an
ACL.  There is no endpoint /info/{int}.  What's you're actually talking to
is https://stable.opencast.org/admin-ng/acl/501, which happens to take a
single integer and be a GET request endpoint, and be alphabetically first
in our full list of endpoints :)

G

On Fri, Feb 15, 2019 at 1:58 PM Jean-Baptiste Onofré <jb...@nanthrax.net>
wrote:

> Hi Greg,
>
> Do you have a simple test case to reproduce it ?
>
> To be sure I understand, when you try GET on
> http://host:8181/cxf/info/10 you go to
> http://host:8181/cxf/admin-ui/acl/10 ("cxf" part of the URL can be
> different depending of the CXF cfg file) ?
>
> Regards
> JB
>
> On 15/02/2019 20:47, Greg Logan wrote:
> > Hi all,
> >
> > I'm from the Opencast project (opencast.org <http://opencast.org/>),
> > which uses Karaf, and CXF among other frameworks.  We're seeing an issue
> > where requests to a non-existent endpoint are being dispatched to the
> > alphabetically first endpoint which matches the request parameters.  For
> > instance, GETting /info/{int}, which does not exist, gets you
> > admin-ui/acl/{int}.
> >
> > I've run through the stack trace, and I think it's CXF, but my mail on
> > that list hasn't gotten any traction so I figured I would expand my
> > search.  Is CXF what I'm looking for here?  Or is it some other part of
> > Karaf?
> >
> > Thanks,
> > G
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: REST routing issue

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Greg,

Do you have a simple test case to reproduce it ?

To be sure I understand, when you try GET on
http://host:8181/cxf/info/10 you go to
http://host:8181/cxf/admin-ui/acl/10 ("cxf" part of the URL can be
different depending of the CXF cfg file) ?

Regards
JB

On 15/02/2019 20:47, Greg Logan wrote:
> Hi all,
> 
> I'm from the Opencast project (opencast.org <http://opencast.org/>),
> which uses Karaf, and CXF among other frameworks.  We're seeing an issue
> where requests to a non-existent endpoint are being dispatched to the
> alphabetically first endpoint which matches the request parameters.  For
> instance, GETting /info/{int}, which does not exist, gets you
> admin-ui/acl/{int}.
> 
> I've run through the stack trace, and I think it's CXF, but my mail on
> that list hasn't gotten any traction so I figured I would expand my
> search.  Is CXF what I'm looking for here?  Or is it some other part of
> Karaf?
> 
> Thanks,
> G

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com