Property file - MDM Logger
Hi,
Can someone let me know how the entries will be for MDM Logger in the property file?
Thanks,
Rekha
Hi Rekha,
Follwoing property files will be used for MDM Logger i.e
connection .properties,
log4j.properties.
Please check the below link for more infromation http://logging.apache.org/log4j/1.2/manual.html
warm regards
mahesh.
Similar Messages
-
Modifying property file at run time
Hi all..
I have been using properties file for handling few configurations in my project.
whenever i need a change in the file, i had to change it in corresponding file, create a jar file and then introspect it into project and then publish the project.
Is there any other way of achieving it.... can we modify the property file at run time just like we do for JSP pages...
Or any other better way of doing this.. pls suggest..
(am using 10g OBPM)
Have a nice time...
Regds,
ViswanathSharma,
write a java class that reads a property file from the external path. make the jar file non-versionable in case you need to update that later. if you are on J2ee container all you need to do it drop the file @ domain root and u shd be good to go.
sample code I am doing this for log4j.properties and application propertied.
public class BPMLoggerUtil {
// Initializing the default Logger //
private static Logger logger = null;
private static final String DEFAULT_PATH = "resources/log4j.properties";
private static HashMap map = new HashMap();
* This is the init method
* @param propertyPath
public static void init(String propertyPath){
try {
if((logger = (Logger) map.get(propertyPath)) == null){
Properties properties = new Properties();
properties.load(LoggerUtil.class.getClassLoader().getResourceAsStream(propertyPath));
PropertyConfigurator.configure(properties);
logger = Logger.getLogger(PropertiesHelper.getProperty("resources.test", "AppName"));
map.put(propertyPath, logger);
} catch(Exception ex) {
ex.printStackTrace();
} -
Creating cache for multiple property files run time/dynamically.
Hi,
I have a requirement, where in I need to create cache for each property file present in a folder at server side or in the lib or resources directory. Please help me how I can do this?
Thanks.ok thank you.
I follwed this method implementation:
static HashMap<String, HashMap<Object, String>> cacheHolder = new HashMap<String, HashMap<Object, String>>();
static HashMap<Object, String>[] cache = new HashMap[2];
static Integer fileCount = 0;
static int incrementSize = 2;
public method1(Map<Object,String>map){
File file = new File((new StringBuilder(
"ABC/XYZ/")).append(value)
.toString()); // where value is the file name returned from the external method
int newSize = existingMapLength+incrementSize;
if (someVal== null) {
synchronized (fileCount) {
int oldSize = cache.length;
if(fileCount==cache.length){
HashMap[] oldData = new HashMap[oldSize];
oldData = cache;
cache = new HashMap[newSize];
LOGGER.info("New Size added:==>"+cache.length);
for(int i=0;i<oldSize;i++){
cache[i] = oldData;
cache[fileCount] = readExternalPropertiesFile(file); // external method which returns the properties of the file in hashmap
cacheHolder.put(value, cache[fileCount]);
keys = cache[fileCount].keySet();
else{
cache[fileCount] = readPropertiesFile(file);
cacheHolder.put(value, cache[fileCount]);
keys = cache[fileCount].keySet();
someVal= cache[fileCount];
fileCount = fileCount + 1;
Please let me know if any improvemnets are possible. -
Java property file in web.xml?
I'm having trouble getting a web app to work resonably closely to how I expect:
I have a property file that is accessed by the package of java classes ( under
WEB-INF/classes). In the classes ( package com.th.lifeinsruance ) i have a property
file which is referenced in the java code as com.th.lifeinsurance.xx.properties.
It seems the only place that wl6.0 is prepared to look for this property file
is under the /weblogic6.0 dir ( i.e totally outside the web app!!). I would guess
that I'm supposed to register this property file in web.xml for the app however
the only examples refer to DataSources and so on ( to set a resource). Is this
correct? Does someone have an example of a java property file being read correctly
in its package with the .class files?
Many Thanks
MarkI've some other solution for the same problem which is working fine for me.
1) make a jar file only consisting of the properties file
jar -cvf DescriptionBundle.jar DescriptionBundle.properties
2) copy the jar file to the /dist/Portal-inf/lib folder
3) Use the following code to get the ResourceBundle
Locale locale = null;
Locale locale = null;
locale = Locale.US;
servletReq.getSession().setAttribute("myLocale", locale);
ResourceBundle bundle = ResourceBundle.getBundle("DescriptionBundle", locale);
if (bundle == null) {
logger.warning("bundle is null");
for (Enumeration e = bundle.getKeys(); e.hasMoreElements();) {
String key = (String) e.nextElement();
String s = bundle.getString(key);
servletReq.getSession().setAttribute(key, s);
logger.info("Key is" + key + "value is" + s);
This solution doesn't suit the title of the topic but is another way to access the properties files. -
How can i get the all values from the Property file to Hashtable?
how can i get the all values from the Property file to Hashtable?
ok,consider my property file name is pro.PROPERTIES
and it contain
8326=sun developer
4306=sun java developer
3943=java developer
how can i get the all keys & values from the pro.PROPERTIES to hashtable
plz help guys..............The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
InputStream is = new FileInputStream("tivoli.properties");
props.load(is); -
Error Reading Property File in Portal Component
Hello,
I have created a portal component that calls an api that is located in a jar file. The documentation on the Portal Component Structure specifies putting the jar file in the PORTAL-INF/lib directory, which I have done. The problem is, my jar file reads a property file using ResourceBundle, but it doesn't find the property file. I have placed the property file in the jar file, and throughout the portal component structure, but it just can't find it. Has anyone else done something similar? If so, where did you put your property file(s) for external jars that are used in the portal component.
EP6 SP2 Patch27
thanks,
KeithHi,
I had similar issues and moved the property files to PORTAL-INF/classes.
Best Regards
Frank -
Maven Plugin not accepting values from a property file.
Hi,
I want to create javadocs using maven.
It works fine when i provide all the absolute paths in the pom.
But when i try to provide paths by reading a property file then the maven-javadoc-plugin does not get the paths from this property file.
The property file is defined as mentioned in below format:
src_mvn_consult_framework_dir=/var/lib/hudson/jobs/CZ_NAB_CORE_MVN_CHECKOUT/workspace/middleware/projects/framework
src_mvn_consult_module_dir=/var/lib/hudson/jobs/CZ_NAB_CORE_MVN_CHECKOUT/workspace/middleware/projects/module
src_mvn_consult_appx_dir=/var/lib/hudson/jobs/CZ_NAB_CORE_MVN_CHECKOUT/workspace/middleware/projects/appx
src_mvn_consult_client_dir=/var/lib/hudson/jobs/CZ_NAB_CORE_MVN_CHECKOUT/workspace/middleware/projects/client
src_mvn_consult_app_webservice_dir=/var/lib/hudson/jobs/CZ_NAB_CORE_MVN_CHECKOUT/workspace/middleware/application/com.ofss.fc.cz.nab.webservices
src_mvn_consult_app_middleware_dir=/var/lib/hudson/jobs/CZ_NAB_CORE_MVN_CHECKOUT/workspace/middleware/application/com.ofss.fc.cz.nab.middleware
Calling this property file in the pom like:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
<configuration>
<files>
<file>/var/build/consult/maven/cz_javadoc-config.properties</file>
</files>
</configuration>
</execution>
</executions>
</plugin>
Finally we are using keys defined in property file in pom like:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.7</version>
<configuration>
<sourcepath>${src_mvn_consult_framework_dir};
${src_mvn_consult_module_dir};
${src_mvn_consult_appx_dir};
${src_mvn_consult_client_dir};
${src_mvn_consult_app_webservice_dir};
${src_mvn_consult_app_middleware_dir};
</sourcepath>
</configuration>
</plugin>
Please suggest how we can get the value of keys defined in the property file in POM
Thanks for your invaluable supportI've had to do something similar in one of my apps. In order to populate values in the THIS scope, you'll need to put a copy of the XML loading/processing logic in the pseudo-constructor (or encapsulate it in a separate CFM/CFC file and include it in both places). It's ugly, but that's the only way I'm aware of to access the THIS scope.
-Carl V. -
Open module for managing property file and environment variables
Looking for an open module for managing property files and environment variables (like CLASSPATH) set in a shell script. For handeling properties (preserving comments, supporting includes, appending new entries, and more) I have looked at SuperProperties from openadaptor but find certain functionality lacking. As for interfacing with common shell scripts/files containing setting for CLASSPATH, JAVA_HOME, other system/application variables another type of object editor is needed. Maybe JFIG?
Any ideas are greatly welcomed.You seem wright, you hit a brick wall here with Air to find the location
of the command console on windows...
So in fact I never build an exe tool, but this little problem was a nice
case to test it and I tried it.:
I downloaded monodevelop
-GTK# for .NET 2.12.10*
-MonoDevelop 2.4.2*
from http://monodevelop.com/Download
created a console project and had an exe in 5 minutes !
You can download the findconsole tool and the projectfiles here:
http://greencollective.nl/temp/dump/findconsole_monoproject.zip
findconsole.exe will reveal the path/location of cmd.exe on a windows system.
Cheers,
Latcho -
How to use an equal sign as a part of the value in a property file
say I have this line in a properties file:
args = -Xms512m -Xmx512m -XX:MaxPermSize=256m
obviously I can't use the (=) as is. What should I do to make it work?
I tried to use \= and \:, but it doesn't work as well.
thanks.A property file contains "key" lines or "key=value" lines the '=' character loses its special meaning after a key is read so you can use '=' characters in the 'value' part of a property.
kind regards,
Jos -
How to use property file - sql query define in property file
Hi All,
Anybody please tell me how to use property file.
I have placed sql query in propery file and I have to access this in my file.
well so far this is my code but don't know how to implement in the following ...
pstmt = con.prepareStatement("select * from registration where username=?");
instead of writting the query I want to use the property file.
so far I have developed the following code...
FileInputStream fis = new FileInputStream("querysql.property");
Properties dbProp = new Properties();
dbProp.load(fis);is the code correct... or is there another way to access property file
Please help.
please reply soon....
ThanksBefore answering, check if it's already been done here http://www.jguru.com/forums/view.jsp?EID=1304182
-
How to read and update the value of property file
Hi,
I am not able read the values from property file.
Please tell me how to read and update the values from property file using Properties class
This is my property file : - Config.properties its located in D:\newfolder
Values
SMTP = localhost
Now i need to change the value of the SMTP
New value :
SMTP =10.60.1.9
Pls Help me
Thanks
Merlin Rosina,Post a small (<1 page) example program that forum members can copy and run that demonstrates your problem.
-
Hi All,
How to add the property file..ie(default.properties) to a webdynpro project.
I urgently require the solution. Kindly get it for me.
Regards
DKHi DK,
this is described in the second Web Dynpro Java Tutorial
<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/downloaditem?rid=/library/uuid/b1a3e990-0201-0010-aeb2-a2ef5bc3da8e">creating an Extended Web Dynpro Application</a>
Regards, Bertram -
How can you change property files of a EJB at Runtime?
Hi,
I have got an ejb and want to change my variables which I stored in property file at Runtime.
But the property file isn´t in the jar-file of my ejb...
How can I add it.
Or How can I change the property file without new compilation.
Thanks
UliHi Uli,
the previous post is generally correct, but without taking any part in the sensibility of this (there are valid reasons why you would not store the values in a DB) it would be necessary for you to be a bit more specific.
Is your problem that you can not see the file from your EJB or that you don't know how to change a property file entry in general?
Cheers,
Kalle -
In Vista, Applet isn�t able to read the property files
I�m working on internationalization; the Applet which I�m using wasn�t able to read the property files properly in windows Vista machine. But if I create a jar which contains all the classes and property files, Applet works fine.
This problem is only in Vista machine ,In XP the JVM is smart enough to read plain .property files and its works well without creating the jar
Is that related to any security enhancemence of vista over XP?
Below is a link about The Java Security Model break on Windows Vista
http://bugs.sun.com/view_bug.do?bug_id=6548078
I tried a simple ResourceBundle.getBundle() in my Applet in different ways but nothing work fine for me. It isn�t an issue related to path, I guess because I tried several ways like.
ResourceBundle labels = ResourceBundle.getBundle("LabelsBundle");
ResourceBundle labels = ResourceBundle.getBundle("LabelsBundle",currentLocale);
ResourceBundle labels = ResourceBundle.getBundle("com.test.LabelsBundle");
ResourceBundle labels = ResourceBundle.getBundle("com.test.LabelsBundle",currentLocale);The exception got in java console is
CONFIG: [2008-05-13 15:54:57.909]:(com.satm.insite.InsiteApplet$2@1696e4c):InisiteApplet: Exception: java.util.MissingResourceException: Can't find bundle for base name LabelsBundle, locale en
java.util.MissingResourceException: Can't find bundle for base name LabelsBundle, locale en
at java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
at java.util.ResourceBundle.getBundleImpl(Unknown Source)
at java.util.ResourceBundle.getBundle(Unknown Source)
at com.satm.insite.InsiteApplet.displayValue(InsiteApplet.java:261)
at com.satm.insite.InsiteApplet.callme(InsiteApplet.java:296)
at com.satm.insite.InsiteApplet.initialize(InsiteApplet.java:327)
at com.satm.insite.InsiteApplet$2.run(InsiteApplet.java:235)
at com.satm.tools.languageTools.ThreadPool$ExceptionCatchingThread.run(ThreadPool.java:226)Is there any way to make it work in Windows Vista machine�? This could be a great help for me.
Thanks
RobertCrossposted:
http://forum.java.sun.com/thread.jspa?threadID=5295743&messageID=10250558#10250558
http://forum.java.sun.com/thread.jspa?threadID=5295742&messageID=10250556#10250556 -
Character '\' is lost when reading a String from a property file.
Hi all,
I have encrypted information inside a property file, but when loading properties in my program, the String object used to store the value is changed by the lost of all �\� characters
# EIS password saved in the property file
password=WPLqQE0DlVF8Sg\=\=
#Value loaded in my String object
WPLqQE0DlVF8Sg==
Why is this happening? I use java.util.Properties java class to store and load my properties, and it is supposed to do it with the same encoding (ISO 8859-1).
Please, can someone explain me why this happened and how to solve it?
Best regards.public static void main(String[] args) throws IOException {
OutputStream props = new FileOutputStream("test.properties");
Properties p = new Properties();
p.put("password", "pass=word#is!dumb");
p.put("user", " I am a Dummy");
p.store(props, "Java forum demo props file");
props.close();
/* Properties file after store
* user=\ I am a Dummy
* password=pass\=word\#is\!dumb
Properties post = new Properties();
post.load(new FileInputStream("test.properties"));
for(Iterator it = post.entrySet().iterator(); it.hasNext();)
System.out.println(it.next());
* After load from test.properties
* user= I am a Dummy
* password=pass=word#is!dumb
}Notice that the special chars are only in the file, not actually in the props. If you think otherwise, I don't know what to say. The \ is a special character that is used to escape other special chars, including itself. You can't create a string in java containing only one backslash, as java assumes the next char is being escaped. when you create a string in Java with one backslash, you have to have 2 backslashes. If you are storing data in the property file using something other than store, than you need to ensure that you are escaping all special charachters that the store method does
~Tim
Maybe you are looking for
-
Hi All, Below is my full code. I am using list view web parts and not working in IE browser but Its working fine in Chrome. SP.ListOperation.Selection.getSelectedItems(context); - always returns null in IE but working fine with Chrome. <div> <tr> <t
-
[CS3][JS] How to place multipage Indesign-file
Hi, Can anyone please help me? How do I place every page of an external Indesign-file into my current document [JS]? How do I set the import options? Thanx Tim
-
How to stop sound playing at a embed FLV video
Hello, I would not a piece of code, which will stop the sound playing in a embed flv video. Following situation: I have a "main.swf" file which loads two swf as following: loadMovie ("Teenies.swf", _root.contenedor); loadMovie ("CananIntro.swf", _roo
-
Hi, I'm applying the latest MP(cumulative) to FSCM9.0. Cobol files fail to compile with the below error and also some of the cobol files compiled successfully. Please find the below error and helps are highly appreciated: cob64: error(s) in compilati
-
How to build back RAID 1 setting without formating the OS
Hello I was using Software base RAID 1 on window server 2012 std edition It was working fine but last day I found that my system is not booting the OS this due to power surge I am geting the error as Booting squence not found .When i change the RAID