Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Websphere and the fly likes properties file in websphere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "properties file in websphere" Watch "properties file in websphere" New topic
Author

properties file in websphere

naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120
We are working on a EJB application and websphere 6.0.
We are facing an issue regarding the properties file. We have a property file "ExceptionMessages_en_EX.properties" which contains list of exceptions

for example
p4154=User not terminated. Please select terminated user.

This property file is placed in IBM\WebSphere\AppServer\properties.

recently we have add a new key and value in ExceptionMessages_en_EX.properties for one of our testing environment.
But the application is unable to read that value and showing as null. Rest(old) are working fine.
when we fetch same front end code to our development system, its working

Is there any properties/settings has to change in websphere server level?
naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120
Any suggestions please
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

Have you restarted the app? Is it possible there is another copy of the property file somewhere?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120
Thank you Jeanne fro your reply.


Yes. we got that doubt also but there is no another copy of same file.

We have restarted the applictaion, server and system itself. We have done everything. But still the problem persists.
naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120
finally we found that the properties file taking from different path.
naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120

I have found that below code is loading the properties file from the path IBM\WebSphere\AppServer\properties

this.load(this.getClass().getResourceAsStream("/application.properties"));


Can any body help that where the rest of the path ( IBM\WebSphere\AppServer\ ) mentioned.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30537
    
150

naga eswar wrote:Can any body help that where the rest of the path ( IBM\WebSphere\AppServer\ ) mentioned.

It probably isn't. That API loads files from the classpath. It stands to reason IBM puts their home directory in the classpath of WebSphere.
naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120
Thank you Jeanne


Jeanne Boyarsky wrote: It stands to reason IBM puts their home directory in the classpath of WebSphere.


Can you explain in details regaridng. classpath of WebSphere means is it mention anywhere in the console.

My problem is that previously the application use to fetch properties files loaded from IBM\WebSphere\AppServer\properties.

now its loading from C:\IBM\WebSphere\AppServer\profiles\AppSrv01\properties

We dont know how its changed. can you please help us.

naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120
naga eswar wrote:Thank you Jeanne


Jeanne Boyarsky wrote: It stands to reason IBM puts their home directory in the classpath of WebSphere.


Can you explain in details regarding this. classpath of WebSphere means is it mention anywhere in the console.

My problem is that previously the application use to fetch properties files loaded from IBM\WebSphere\AppServer\properties.

now its loading from C:\IBM\WebSphere\AppServer\profiles\AppSrv01\properties

We dont know how its changed. can you please help us.

naga eswar
Ranch Hand

Joined: Jan 25, 2012
Posts: 120
Thank you Jeanne


Jeanne Boyarsky wrote: It stands to reason IBM puts their home directory in the classpath of WebSphere.


Can you explain in details regarding this. classpath of WebSphere means is it mention anywhere in the console.

My problem is that previously the application use to fetch properties files loaded from IBM\WebSphere\AppServer\properties.

now its loading from C:\IBM\WebSphere\AppServer\profiles\AppSrv01\properties

We dont know how its changed. can you please help us.

venkata mohan
Greenhorn

Joined: Nov 16, 2012
Posts: 2
can you check your WebSphere Variables pat for WAS-Props_Dir value once

Login to the console --> Environment--> WebSphere Variables--> WAS-PROPS-DIR
 
jQuery in Action, 2nd edition
 
subject: properties file in websphere