2 Replies Latest reply on Nov 28, 2005 4:54 AM by smyogesh

    How to refer Images outside JBOSS_HOME?

    smyogesh

      Hi

      I am working as a J2EE programmer.
      I am new to JBOSS server.
      And, I am developing an application "myapp.ear".

      The application is running in Linux server.

      I placed myapp.ear file in the following location:
      /opt/jboss-3.2.6/server/default/deploy/myapp.ear.

      The HTML files are referring the images outside the JBOSS_HOME.

      Images are stored in the following location:
      /var/myapp/images.war/one.gif

      When I run the application, images are not displayed. I am getting a red colored "x" mark with a blank area.

      I referred the jboss-service.xml file under:
      /opt/jboss-3.2.6/server/default/conf/ directory.

      I added the file:/var/myapp/images.war to the "attribute name="URLs"" tag of jboss-service.xml file.

      Then, the tag has the follwoing value:
      deploy/, file:/var/myapp/images.war

      Still the image is not displayed.

      What are things needed to be configured in JBOSS to fix this image display issue?

      Please help me to fix this.

      Thanks,
      smyogesh.

        • 1. Re: How to refer Images outside JBOSS_HOME?
          renkrad

          You must use a servlet to acess and write the image content to the client.

          My advice is for you to add the images to your war, unless those images are part of a client specific repository in that case the images are dinamic so a servlet is necessary.

          • 2. Re: How to refer Images outside JBOSS_HOME?
            smyogesh

            Hi Daniel,
            Thanks for your reply.
            I read some of the XML files in the "conf" directory of JBOSS and came to know that I have to modify the jboss-service.xml file for "Hot Deployment", and then I did it.

            Modify the following tag in the jboss-service.xml file:
            attribute name="URLs" with the following value....
            deploy/,file:/var/myapp/


            I had "images.war" under "/var/myapp". First, JBOSS searches for .war and .ear files under the usual "deploy" directory and if "images.war" is not available, then it will search the "/var/myapp" directory. And it found out the images.war under "/var/myapp".

            Now, my problem is fixed.

            Thanks,
            smyogesh.

            Reference:
            http://www.jboss.org/wiki/Wiki.jsp?page=ConfiguringTheDeploymentScannerInConfjbossSystem.xml