• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

property file with same name in two jars gets confused

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm. Those files clearly have different paths in the XML. I'm not familiar with that tag though.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
This one time, at bandcamp, I had relations with a tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic