3 Replies Latest reply on Jun 15, 2009 12:43 PM by shsharma79

    Put a file on jboss 4.0.2 with out bundling it in a jar, war

      Hi, I have multiple applications running on multiple servers. There are some system properties which are common across all these applications. I want to put all these common properties in one common file on one of the servers and then want to load these properties from all other servers using org.jboss.varia.property.SystemPropertiesService as defined at http://docs.jboss.org/jbossas/jboss4guide/r3/html/ch10.html using URLList attribute.

      I don't want to bundle this common properties file in a jar, war or ear file because I want to give sys-admins ability to modify the file without going through a build-test-deploy cycle. But I want to put this file on the jboss 4.0.2 server, so that other servers can read this file using a URL as described in the article above.

      Can someone please help me out with following:

      1. Is it possible to expose a static file without bundling it in a jar, war or ear file as a browsable/readable URL?

      2. If yes, please tell me how i.e. where should I put the file on jboss instance? What will be the context-root or URL to access this plain text file?

      Thanks in advance,
      Shal

        • 1. Re: Put a file on jboss 4.0.2 with out bundling it in a jar,
          jaikiran

          You can place those files in JBOSS_HOME/server/< servername>/conf folder and they will be by default made available in the classpath of the applications deployed on the server.

          • 2. Re: Put a file on jboss 4.0.2 with out bundling it in a jar,

             

            "jaikiran" wrote:
            You can place those files in JBOSS_HOME/server/< servername>/conf folder and they will be by default made available in the classpath of the applications deployed on the server.


            Thanks for your response. Yes, it will be available on the server's classpath but how would I expose this common properties file to all other servers? I want to expose the common properties as a common browsable property file. If I put it in the conf directory it can not be accessed by other servers.

            Am I missing something?

            • 3. Re: Put a file on jboss 4.0.2 with out bundling it in a jar,

              I have found a solution to my query. It might not be a clean solution but I thought I will publish it here so that other might benefit if they have similar need.

              Solution: Create a directory my-app.war in the "deploy" folder and put the file in there. JBoss will throw a warning saying that it could not find web.xml but your file will be available with the context-root "my-app".

              Thanks
              Shal