Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

property file with same name in two jars gets confused

 
Irene Loos
Ranch Hand
Posts: 78
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
We have two J2EE applications running on WAS 6.1. Application use library of jars that setup thru classpath. There is a property file with the same name but under different folder structure in two different jars. Application 1 points to file from first jar, application 2 points to a file from jar 2, but sometimes, application 1 pulls the file from jar 2 - how is that possible? The behavior is random.

Thank you
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Irene,
How you are loading the property file? By file name or path? For example, A.properties vs b/c/A.properties?
 
Irene Loos
Ranch Hand
Posts: 78
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,
The java class in the applciation that class it has an import statement to a class in reusbale jar that is linked thru shared libraries. Shared jars all located in the same folder.

The applciation has xml properties. The file that we need to use i specified here:
<resource
name="datasource.n1n.validate_buffers"
basepath="projects/transactions"
startpath="projects/transactions"
pattern="validate_buffers.properties">
</resource>

Once it is in the reusbale jar, the clas has following:

ResourceManager serverResources = ResourceRegistry.getInstance().get("datasource.n1n.server");
ResourceManager transactionResources = ResourceRegistry.getInstance().get("datasource.n1n.validate");
ResourceBundle transactionProperties = transactionResources.asResourceBundle();
ResourceBundle bufferProperties = ResourceRegistry.getInstance().get("datasource.cics.validate_buffers").asResourceBundle();

from there it will attempt to use property file and randonly will go to file that is called from another application that has following in xml properties:
<resource
name="datasource.n1n.validate_buffers"
basepath="projects/components/bproject/finder"
startpath="projects/components/bproject/finder"
pattern="properties/validate_buffers.properties">
</resource>


Irene
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 33694
316
Eclipse IDE Java VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm. Those files clearly have different paths in the XML. I'm not familiar with that tag though.
 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried using different names for the resources? Given them the same name is bound to cause confusion at the least.
 
Irene Loos
Ranch Hand
Posts: 78
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for all replies. We wil lbe changing the name of property file to be unique in each application.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic