Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4332652
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:17:10+00:00 2026-05-21T10:17:10+00:00

I have been struggling to get an web application to run in the root

  • 0

I have been struggling to get an web application to run in the root application context in Karaf 2.2.0 (it works fine in Karaf 2.1.4). I have been able to isolate the issue to something easily duplicated using the Tomcat sample WAR.

  1. Run the following command from Karaf:

    osgi:install -s webbundle:http://tomcat.apache.org/tomcat-5.5-doc/appdev/sample/sample.war?Bundle-SymbolicName=tomcat-sample&Webapp-Context=/anything

  2. Access the app from your web browser (http://localhost:8181/anything/index.html)

  3. Uninstall the sample bundle
  4. Reinstall the bundle using the root context path with the following command:

    osgi:install -s webbundle:http://tomcat.apache.org/tomcat-5.5-doc/appdev/sample/sample.war?Bundle-SymbolicName=tomcat-sample&Webapp-Context=/

  5. Attempt to access the app from your web browser (http://localhost:8181/index.html)

  6. Note the 404 error.

Looking at the logs, it appears that when a web app is in the root application context, it prepends a “/default/” to any request. For example, when trying to access /index.html it looks in /default/index.html, fails to find the page, and returns a not found error (see the log output below for more details).

Does anyone know how to resolve this issue?


LOG OUTPUT

15:14:46,270 | DEBUG | 30 - /index.html | log                              | .eclipse.jetty.util.log.Slf4jLog   70 | 43 - org.eclipse.jetty.util - 7.2.2.v20101205 | REQUEST /index.html on org.eclipse.jetty.server.nio.SelectChannelConnector$3@693a1324
15:14:46,270 | DEBUG | 30 - /index.html | ServerModel                      | eb.service.spi.model.ServerModel  268 | 52 - org.ops4j.pax.web.pax-web-spi - 1.0.1 | Matching [/index.html]...
15:14:46,270 | DEBUG | 30 - /index.html | ServerModel                      | eb.service.spi.model.ServerModel  292 | 52 - org.ops4j.pax.web.pax-web-spi - 1.0.1 | Path [/index.html] matched to {pattern=/.*,model=ResourceModel{id=org.ops4j.pax.web.service.spi.model.ResourceModel-22,name=default,urlPatterns=[/],alias=/,servlet=ResourceServlet{context=/,alias=/,name=default},initParams={},context=ContextModel{id=org.ops4j.pax.web.service.spi.model.ContextModel-21,name=,httpContext=org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext@3942ef25,contextParams={webapp.context=}}}}
15:14:46,270 | DEBUG | 30 - /index.html | log                              | .eclipse.jetty.util.log.Slf4jLog   70 | 43 - org.eclipse.jetty.util - 7.2.2.v20101205 | Got Session ID 17kb0ch4hv02w1ennfxju5owpw from cookie
15:14:46,270 | DEBUG | 30 - /index.html | log                              | .eclipse.jetty.util.log.Slf4jLog   70 | 43 - org.eclipse.jetty.util - 7.2.2.v20101205 | sessionManager=org.eclipse.jetty.server.session.HashSessionManager@7d8aecf1
15:14:46,271 | DEBUG | 30 - /index.html | log                              | .eclipse.jetty.util.log.Slf4jLog   70 | 43 - org.eclipse.jetty.util - 7.2.2.v20101205 | session=null
15:14:46,271 | DEBUG | 30 - /index.html | log                              | .eclipse.jetty.util.log.Slf4jLog   70 | 43 - org.eclipse.jetty.util - 7.2.2.v20101205 | servlet=default
15:14:46,271 | DEBUG | 30 - /index.html | log                              | .eclipse.jetty.util.log.Slf4jLog   70 | 43 - org.eclipse.jetty.util - 7.2.2.v20101205 | servlet holder=
15:14:46,271 | DEBUG | 30 - /index.html | HttpServiceContext               | etty.internal.HttpServiceContext  115 | 54 - org.ops4j.pax.web.pax-web-jetty - 1.0.1 | Handling request for [/index.html] using http context [org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext@3942ef25]
15:14:46,271 | DEBUG | 30 - /index.html | log                              | .eclipse.jetty.util.log.Slf4jLog   70 | 43 - org.eclipse.jetty.util - 7.2.2.v20101205 | chain=
15:14:46,272 | DEBUG | 30 - /index.html | WebAppWebContainerContext        | r.war.internal.WebAppHttpContext  113 | 64 - org.ops4j.pax.web.pax-web-extender-war - 1.0.1 | Searching bundle [tomcat-sample [97]] for resource [default/index.html], normalized to [default/index.html]
15:14:46,272 | DEBUG | 30 - /index.html | WebAppWebContainerContext        | r.war.internal.WebAppHttpContext  140 | 64 - org.ops4j.pax.web.pax-web-extender-war - 1.0.1 | Resource not found
15:14:46,273 | DEBUG | 30 - /index.html | log     
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:17:10+00:00Added an answer on May 21, 2026 at 10:17 am

    This issue has now been submitted as a Karaf Bug. See https://issues.apache.org/jira/browse/KARAF-577

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm a crappy novice programmer and have been struggling to get this working for
I have been struggling for the last few hours trying to get this search
I have been struggling all day to get data to show in a jqgrid.
I have been struggling for days to get a working upload onto the admin
I have been struggling with this all morning and was hoping to get some
I have been struggling to get this right! Can anyone help me to convert
I have been struggling to get my jquery call to a webmethod to work.
I have been struggling with this NHibernate issue for hours. I extensively researched on
I have been struggling to get Maven2 to cooperate with me, and was wondering
I have been struggling to get a simple DynamicObject example working in .NET 3.5.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.