2 Replies Latest reply on May 16, 2010 9:59 AM by richard.qin

    Deploying static images in JBoss 5.1 with profile.xml

    poesys

      I've followed the directions at http://community.jboss.org/wiki/HowtodeploymyapplicationinanexternaldirectoryinJBoss-5 to set up a "static" web app that will serve up a collection of image files to my other web apps.

       

      1. I modified profile.xml to add /opt/jboss/server/static/deploy as a deployment directory.

      2. I added srv.war as a directory (/opt/jboss/server/static/deploy/srv.war) and put an empty web.xml in a WEB-INF subdirectory.

      3. I created symbolic links under srv.war for the various image directories (images1, images2).

       

      The JBoss server starts up fine and shows /srv as a deployed war file in the jmx-console. However, I can't seem to get to the image files, I just get a 404 message for /srv/images1/xxx.png, for example. I can see the files are "there" in the linked sense but the web server doesn't seem to find them.

       

      There's also a wrinkle that I'd like to ask about. I'm using virtual hosts with a jboss-web.xml in my other web apps. When I refer to "/srv/images1" it uses the virtual host name (http://bob:8080/srv/images1), which won't be found either. I don't think srv can be deployed with a virtual host, right?

       

      So why can't I see http://localhost:8080/srv/images1/xxxx.png?

       

        --Bob Muller

        • 1. Re: Deploying static images in JBoss 5.1 with profile.xml
          poesys

          The key word in the problem statement is "linked"--I put symbolic links under the static exploded war file directory to the files. I tried removing the links and creating the hierarchy and files in place under the exploded war file, and http resolution worked fine. So to the best of my belief, the web server (Catalina?) is simply not able to resolve symbolic links, it needs the actual files to be in the exploded war. Which is a little limiting, actually, if you have a huge file structure and you want to store it on a separate mount.

           

          Any comments from anyone in the know about this limitation of Catalina?

          • 2. Re: Deploying static images in JBoss 5.1 with profile.xml
            richard.qin

            you can enable the symbol link support by adding allowLinking="true" in the context.xml of your web app.