best place to put properties file in IBM websphere 8.5?

后端 未结 6 748
说谎
说谎 2020-12-31 16:06

In our existing application properties file is embedded in a jar file ,we decided to move properties file outside of ear(application) , what is the best place to put propert

6条回答
  •  误落风尘
    2020-12-31 16:48

    Contrary to the (currently) accepted answer, I argue that placing anything under WAS_HOME/classes is a discouraged practice. This directory is often used by IBM to place classes/JAR files that are considered "internal" to WAS and related products (for instance, certain versions of WebSphere Portal place JAR files in that directory).

    Also, placing items in WAS_HOME/classes makes the items available to all applications running on all WAS profiles created off this WAS installation. You can't change that behaviour; that's how WAS is designed. That's another reason to conclude that WAS_HOME/classes should be reserved for WAS internal use.

    This argument can be generalized to practically any location under WAS_HOME: user files (that is, files not provided by the software vendor) should not reside in locations that are managed by the product's installer/uninstaller. The WAS_HOME hierarchy is managed by IBM Installation Manager (or the WAS Installer, depending on the WAS version in question). I wouldn't put any of my files anywhere there.

    Now, back to your question. If you must have your property files "loose" (that is, not included with any particular EAR), your best bet is to do the following:

    1. Create a directory outside the WAS directory tree and place your files there.
    2. In WAS, create a Shared Library definition.
    3. Add the directory you created to the Shared Library.
    4. Attach the Shared Library to either the server or the application(s) you'd like your property files to be available to:

      • To attach the Shared Library to the server, create a new Classloader element on the server and attach the shared library to it.
      • To attach the Shared Library to the application, perform the attachment through editing the EAR's properties in the administration console, or through scripted deployment parameters.

提交回复
热议问题