1 Reply Latest reply on Nov 24, 2006 4:48 AM by Pooja Chugh

    Facing problems while porting Velocity application from Jbos

    Pooja Chugh Newbie

      We have our application running fine on Jboss 3.2.3.
      Now we are trying to port the same application to to Jboss 4.0.5.

      We are using Velocity and JMX, Servlets, Hibernate, JBoss.

      All the static content like Velocity vm files, css, js, gifs file are
      not stored directly in parallel to web-inf.
      We have stored them into some local docbase say C:\content folder

      The above startgy works find with JBoss 3.2.3. and Velocity picks all the references to images and js files from local docbase.

      We are pointing to docbase through some configuration file with the help of Velocity.
      like in velocity.properties.
      resource.loader = file
      file.resource.loader.description = Velocity File Resource Loader
      file.resource.loader.class = org.apache.velocity.runtime.resource.loader.FileResourceLoader

      And setting the docbase :-

      OurVelocityServlet :
      private VelocityEngine velocity;
      velocity = new VelocityEngine();
      ExtendedProperties p = new ExtendedProperties();
      p.addProperty(VelocityEngine.RESOURCE_LOADER, "file");
      p.addProperty("file.resource.loader.class", FileResourceLoader.class.getName());
      p.setProperty(VelocityEngine.FILE_RESOURCE_LOADER_PATH, System.getProperty(_docBaseProp));

      All vm and html files are being picked up from that docbase but not picking images,css and js files.

      Does anyone have some idea?Do we need to do some extra configuration setting while moving from jboss 3.2.3 to jboss 4.0.5 with Velocity and Jboss combination.

        • 1. Re: Facing problems while porting Velocity application from
          Pooja Chugh Newbie

          Hi This is Ashish, I am team mate of Pooja.

          We found the problem and solution as well.

          Actually the Jboss 3.2.3 uses tomcat 4.1.29 and jboss 4.0.5 uses tomcat 5.5.20. and naming-resources.jar and default.servlets.jar working is totally different in jboss 4.

          We had overridden DefaultServlet and overriden the getResources() of DefaultServlet but in jboss 4.0.5, default-Servlet.jar does not use getResources() method call. Insteaed they have protected variable resources of ProxyDirContext.

          we used the same to assigne to our docbase.