1 Reply Latest reply on Dec 4, 2002 3:47 AM by Yuri Tsykhotsky

    Serving static pages from jbossweb of JBoss3.0.4

    Sasha Newbie

      Hi everyone,

      I would greatly appreciate if you could assist with the following problem:

      JBoss3.0.0 (has Jetty 4.0.1 embedded):
      In Jetty 4.0.1 in order to serve static pages from the specified directory jboss-service.xml file that lives in [JBossHome]\server\default\deploy\jetty-plugin.sar\META-INF was included the following piece of xml code:

      /
      C:\wwwRoot\
      TRUE

      Therefore, when running JBoss3.0.0 (that has Jetty 4.0.1 web server embedded) on a local machine the call to http://localhost would take the user to index.html that was located in C:\wwwRoot

      JBoss3.0.4 (has Jetty 4.1 embedded called jbossweb):
      We have tried to do exactly the same for JBoss3.0.4 that has jbossweb web server embedded. In fact jbossweb is a Jetty 4.1
      We have modified jboss-service.xml file that lives in [JBossHome]\server\default\deploy\jbossweb.sar\META-INF to include the following piece of xml code:

      /
      C:\wwwRoot\
      TRUE


      However, when JBoss3.0.4 is started the following error is thrown while trying to fire up jbossweb:
      10:23:10,469 INFO [jbossweb] Checking Resource aliases
      10:23:10,469 ERROR [jbossweb] problem configuring Jetty:
      java.lang.NoSuchMethodException: class org.mortbay.jetty.servlet.ServletHttpContext.setServingResources(class java.lang.String)
      at org.mortbay.xml.XmlConfiguration.set(XmlConfiguration.java:356)
      at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:227)
      at org.mortbay.xml.XmlConfiguration.call(XmlConfiguration.java:496)

      After analysing this error we have decided to comment TRUE line in jboss-service.xml.
      No errors were thrown. However, when tried to access http://localhost the following error was thrown:
      HTTP ERROR: 404 / Not Found
      RequestURI=/


      We would greatly appreciate if you could let us know how to set up jbossweb(Jetty 4.1) to serve static pages.

      Thank you very much for your time and assistance on this matter.

        • 1. Re: Serving static pages from jbossweb of JBoss3.0.4
          Yuri Tsykhotsky Newbie

          Hi. You have to update jboss-service.xml located into deploy/jbossweb.sar/META-INF with something like this:

          /
          C:\jboss\webroot\

          I put that block inside of declaration of attribute "ConfigurationElement"
          Than when you create you own webroot directory dont forget to create WEB-INF dir inside of it and put some simple web.xml into WEB-INF
          You can access all you static web resources from directory webroot or what ever you named it
          For example: if I put index.html into webroot dir
          url looks like this http://localhost:8080/index.html
          Good luck

          Yuri