on 02-28-2007 7:58 PM
All,
I have a need to use a *.properties file to be read at run time in the mapping. So, a Java class has been created that will have the methods to be called from the mapping program through UDF, read the PROPS file and get back with a response.
Is there a place on the server that I can keep this file and define that path in the Java class ? Typically what is the standard path that is used?
m
Hi,
Instead of answering your question....can i ask you/suggest you another method...
How about using the value mapping to achieve the same ?
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
standard way of reading a properties file wont work directly...as direct file io is not encouraged from within EJB runtime environment.wherever you are going to have a properties file bundled inside the jar read it as
Properties properties = new Properties();
InputStream inStream = this.getClass().getResourceAsStream("MY_PROP.properties");
try
{
properties .load(inStream);
}
catch (Exception e)
{
// Error handling code
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> standard way of reading a properties file wont work
> directly...as direct file io is not encouraged from
> within EJB runtime environment.wherever you are going
> to have a properties file bundled inside the jar read
> it as
>
> [code]Properties properties = new Properties();
> InputStream inStream =
> this.getClass().getResourceAsStream("MY_PROP.propertie
> s");
> try
> {
> properties .load(inStream);
> }
> catch (Exception e)
> {
> // Error handling code
So is there a central location on the file system where the properties files can be placed? For example in some lib folder?
The same question for custom jar files - is there a central location where we can put the jar file, instead of attaching a jar file to each namespace, which is messy and difficult to maintain.
Thanks.
Ron
>>The same question for custom jar files - is there a central location where we >>can put the jar file, instead of attaching a jar file to each namespace, which is >>messy and difficult to maintain.
hmm...a question raised so far many times and no satisfactory answer even as of now...at least I have not seen...only possible way being add your jar file to each and every namespace under imported archives
There is no standard location.
Butr one option is to bundle the file with your Jar and use the getResource() to read the file as pointed by Amol.
To make sure that the jar is accessible in all SWCV's create a Generic SWCV and make sure that all other SWCV's have a usage dependency on the generic SWCV.
The best way though would be to use value Mapping maintained in the Integration Directory.
Regards
Bhavesh
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.