0 Replies Latest reply on Dec 6, 2002 1:17 PM by ian.fallon

    Getting Jetty to serve up files from a directory

    ian.fallon

      Somewhere on these forums I found the following technique to get Jetty to serve up files from a directory:

      "
      Add something like this to the ConfigurationElement in
      jbossweb.sar/META-INF/jboss-service.xml, to serve static pages:


      /documents/*
      /docroot/
      TRUE

      "

      but I can't get it to work. Specifically it complains about "ServingResources" not being a method when JBoss starts:

      18:25:10,545 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)
      at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:231)
      at org.mortbay.xml.XmlConfiguration.configure(XmlConfiguration.java:163)
      at org.jboss.jetty.Jetty.setXMLConfiguration(Jetty.java:355)
      at org.jboss.jetty.Jetty.setConfigurationElement(Jetty.java:328)
      at org.jboss.jetty.JettyService.createService(JettyService.java:165)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:136)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284
      )

      jboss-service.xml doesn't appear to have a DTD so I can't tell if the XML file is right (and even if it did, I guess the dynamic calls won't be covered by the DTD).

      Has anyone had any success with this ?

      Regards,

      Ian