I have a servlet which is registered using Declarative Services (in a normal,
non-WAB bundle). If I register it using `alias = /`, it works fine: I can go
to http://localhost:8282/ and see the page. But changing alias to
`/documents` doesn't. The logs show the servlet is still started and
registered with Pax Web:


2012-06-20 10:12:53,399 | INFO  | FelixStartLevel  | DocumentServlet            
     
| 52 - ru.focusmedia.odp.server.documents.http - 0.1.0 | Document servlet
started
2012-06-20 10:12:53,403 | INFO  | FelixStartLevel  | HttpServiceFactoryImpl     
     
| 131 - org.ops4j.pax.web.pax-web-runtime - 1.0.9 | Binding bundle:
[ru.focusmedia.odp.server.documents.http [52]] to http service
2012-06-20 10:12:53,405 | INFO  | FelixStartLevel  | ContextHandler             
     
|  -  -  | started
HttpServiceContext{httpContext=DefaultHttpContext{bundle=ru.focusmedia.odp.server.documents.http
[52]}}


and the service is provided:


karaf@root> ls 52

ru.focusmedia.odp.server.documents.http (52) provides:
------------------------------------------------------
alias = /documents
component.id = 2
component.name = ru.focusmedia.odp.server.documents.http.DocumentServlet
objectClass = javax.servlet.Servlet
service.id = 161
----
objectClass = javax.servlet.ServletContext
osgi.web.symbolicname = ru.focusmedia.odp.server.documents.http
osgi.web.version = 0.1.0
service.id = 166


But going to http://localhost:8282/documents gives me a 404. Any ideas what
the problem could be?

In org.ops4j.pax.web.cfg I just have


org.osgi.service.http.port = 8282

--
View this message in context: 
http://karaf.922171.n3.nabble.com/Registering-servlet-under-alias-works-alias-documents-doesn-t-tp4024906.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to