HI, I want to keep a property file in an ear at a common location so that the ejb jar and war both can use it. I tried putting it in meta-inf directory (along with application.xml). then i specified the path in the classpath of manifest. it didn't work
i put the property file at top level one level up meta-inf. Secified it in the class path of the manifest. But when i use following statement from a java code -
InputStream in = this.getClass().getResourceAsStream ("general.properties"); properties.load(in);
I got following exception - java.util.MissingResourceException: Can't find bundle for base name general, locale en_US [ July 20, 2004: Message edited by: Reena Kher ]
Create a jar file that contains the properties file and any other common stuff. Put that jar file in the ear and the jar file name in the manifest classpath of the ear's modules (web app, ejb) that you want to hit it and you should be set.
I've never seen a situation where individual files that the modules will use are placed in the ear outside of a module.
Create a jar file that contains the properties file and any other common stuff. Put that jar file in the ear and the jar file name in the manifest classpath of the ear's modules (web app, ejb) that you want to hit it and you should be set.
Using Ken Robinson's formula :-) I've never seen such a long discussion about a simple properties file. An automatic build process/system should always been able to put the properties file in all the jars where it is needed (as we are not talking about a writable proeprties file).