0 Replies Latest reply on Mar 17, 2006 10:52 AM by allisonb

    Question About Locating Resources

    allisonb

      I am in the process of trying to move a set of web applications from WebLogic to JBoss, and am having trouble with loading resources (namely property files). Each of the applications utilizes a number of library jars which use a property file to hold the current configuration. Most of the library jars are common to most of the applications. The libraries use ClassLoader.getResource to locate the property files.

      The effect I am trying to achieve is to have a single copy of the libraries and their configuration. I don't want to include these jars in every application and I want all of the applications to share the same configuration file. I would like these to be in a separate location from the JBoss installation so that they can be updated independently of JBoss updates.

      With the current WebLogic setup, I set up a directory /opt/weblib with two subdirectories:
      -- lib contains the library jars
      -- conf contains the configuration property files
      I then update the classpath for the WebLogic server to include the conf directory and all the jars in the lib directory. Each application is then able to access the library jars without any problem, and the library jars grab their configuration out of the conf directory.

      While trying to port these applications to JBoss, I found that I can put the jars in JBOSS_HOME/server/default/lib (although I would rather have them outside of the JBoss installation tree for ease of administration) and the jars are found by the applications just fine. My problem is that the only way I have been able to use the configuration files is to place them in the top directory of each application war file.

      Since the library jars can be used outside of a web application, I need to make sure that the method being used works in both environments. Is there any way to make this work in JBoss?