You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by jkraushaar <jo...@doubleslash.de> on 2015/08/19 17:20:06 UTC

404 when trying to register resources using HttpService and pax-web

Hi there,

I'm trying to register resources using the HttpService (pax-web
implementation), but when I access those resources, I get a 404.

I used the chapter "Building an application with custom HttpContext with
Apache Karaf" in "Apache Karaf Cookbook" as a template and registered a
shared HttpContext created by the pax-web WebContainer. Then (in another
bundle) I fetched the HttpService and the HttpContext and registered the
resources:

service.registerResources("/watch", "/web", context);

The bundle which creates and registers the shared HttpContext is a standard
web project (WAB) which does not use the HttpService to register its
resources and servlets but has a web.xml file. Also it registers all of its
servlets, filters and resources under the root context ("/"). Might this be
the cause of the 404?

Thanks for your help,
Jochen



--
View this message in context: http://karaf.922171.n3.nabble.com/404-when-trying-to-register-resources-using-HttpService-and-pax-web-tp4041942.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: 404 when trying to register resources using HttpService and pax-web

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hmm, with that version
I guess it's more an issue of "/" then of anything else.

regards, Achim


2015-08-20 9:52 GMT+02:00 jkraushaar <jo...@doubleslash.de>:

> Hi,
>
> I'm using Karaf 3.0.1 / Pax-Web 3.1.0 and I only registered the resources.
>
> Regards
> Jochen
>
>
>
> --
> View this message in context:
> http://karaf.922171.n3.nabble.com/404-when-trying-to-register-resources-using-HttpService-and-pax-web-tp4041942p4041962.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: 404 when trying to register resources using HttpService and pax-web

Posted by jkraushaar <jo...@doubleslash.de>.
Hi,

I'm using Karaf 3.0.1 / Pax-Web 3.1.0 and I only registered the resources.

Regards
Jochen



--
View this message in context: http://karaf.922171.n3.nabble.com/404-when-trying-to-register-resources-using-HttpService-and-pax-web-tp4041942p4041962.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: 404 when trying to register resources using HttpService and pax-web

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi,

which version of Karaf/Pax-Web are you using?

regards, Achim


2015-08-19 18:03 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:

> Hi,
>
> did you also registered a servlet or just resources ?
>
> Regards
> JB
>
>
> On 08/19/2015 05:20 PM, jkraushaar wrote:
>
>> Hi there,
>>
>> I'm trying to register resources using the HttpService (pax-web
>> implementation), but when I access those resources, I get a 404.
>>
>> I used the chapter "Building an application with custom HttpContext with
>> Apache Karaf" in "Apache Karaf Cookbook" as a template and registered a
>> shared HttpContext created by the pax-web WebContainer. Then (in another
>> bundle) I fetched the HttpService and the HttpContext and registered the
>> resources:
>>
>> service.registerResources("/watch", "/web", context);
>>
>> The bundle which creates and registers the shared HttpContext is a
>> standard
>> web project (WAB) which does not use the HttpService to register its
>> resources and servlets but has a web.xml file. Also it registers all of
>> its
>> servlets, filters and resources under the root context ("/"). Might this
>> be
>> the cause of the 404?
>>
>> Thanks for your help,
>> Jochen
>>
>>
>>
>> --
>> View this message in context:
>> http://karaf.922171.n3.nabble.com/404-when-trying-to-register-resources-using-HttpService-and-pax-web-tp4041942.html
>> Sent from the Karaf - User mailing list archive at Nabble.com.
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>
Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS>

Software Architect / Project Manager / Scrum Master

Re: 404 when trying to register resources using HttpService and pax-web

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

did you also registered a servlet or just resources ?

Regards
JB

On 08/19/2015 05:20 PM, jkraushaar wrote:
> Hi there,
>
> I'm trying to register resources using the HttpService (pax-web
> implementation), but when I access those resources, I get a 404.
>
> I used the chapter "Building an application with custom HttpContext with
> Apache Karaf" in "Apache Karaf Cookbook" as a template and registered a
> shared HttpContext created by the pax-web WebContainer. Then (in another
> bundle) I fetched the HttpService and the HttpContext and registered the
> resources:
>
> service.registerResources("/watch", "/web", context);
>
> The bundle which creates and registers the shared HttpContext is a standard
> web project (WAB) which does not use the HttpService to register its
> resources and servlets but has a web.xml file. Also it registers all of its
> servlets, filters and resources under the root context ("/"). Might this be
> the cause of the 404?
>
> Thanks for your help,
> Jochen
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/404-when-trying-to-register-resources-using-HttpService-and-pax-web-tp4041942.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

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