3 Replies Latest reply on Dec 16, 2002 11:15 AM by Julian Gosnell

    [ Jetty ] addContext : Problem

    krypton Novice

      Hello,

      Jboss Ver 3.04
      Jetty Ver 4.2 (?)

      Scenario:
      I deploy my application as an ear ( which contains a war etc and an images folder.
      I want users to upload photos and then serve them, yet i wish to keep that packaged ear separate.

      I add the following to the
      \deploy\jbossweb.sar\META-INF\jboss-service.xml


      /
      G:/projects/live/jboss/jboss-3.0.4/server/myserver/deploy/myapp/docroot
      TRUE


      This should allow me to access anything under the docroot folder AND the doc root under inside the war (?).

      No luck :-( ( see below )

      21:26:30,799 INFO [JettyService] Creating
      21:26:31,080 INFO [jbossweb] Registered jboss.web:Jetty=0,SocketListener=0
      21:26:31,160 INFO [jbossweb] Registered jboss.web:Jetty=0,AJP13Listener=0
      21:26:31,500 INFO [jbossweb] Registered jboss.web:Jetty=0,ServletHttpContext=0,context=/
      21:26:31,520 INFO [jbossweb] Checking Resource aliases
      21:26:31,530 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:357)
      at org.jboss.jetty.Jetty.setConfigurationElement(Jetty.java:330)
      at org.jboss.jetty.JettyService.createService(JettyService.java:165)
      at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:136)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
      at $Proxy5.create(Unknown Source)
      at org.jboss.system.ServiceController.create(ServiceController.java:315)
      at org.jboss.system.ServiceController.create(ServiceController.java:243)
      at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)

      Ok so i comment out the tag regarding ServingResources and .. jetty starts up fine ... BUT .. i still cannot access resources/files under docroot/*

      I have done some research and have not found much w.r.t this issue.

      Can anybody help me with this or recommend an alternative approach ?

      I have a few options:

      1) Try again with Jetty/Jboss
      2) Write a File/Image Servlet to serve content from this dir

      Any Ideas People ?

      Thanks K.