This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Location of properties jar in an EAR

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I have set of property files, i placed all these property files into an jar and placed the jar in WEB-INF/lib directory. ResourceBundle is not able to locate the property file placed under this jar.

I tried putting the properties jar under EAR directly and added an manifest entry for both EJB jar and war. Still it is not working

Am i placing the properties jar in correct location? If no, can some one please tell me where i put this properties jar.

Thanks,
Vinod.
 
author & internet detective
Posts: 41185
848
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
Vinod,
I've always seen the property files loose. Are you allowed to put them in a jar and have the server find them?
 
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would normally recommend including the properties files in the EAR file unless you need to change a file and don't want the hassle of rebuilding and redeploying the EAR. This could apply to a logger or configuration file. (Having said that, it may be possible to deploy an exploded directory - as you can with WebLogic Server - in which case you can edit the properties file in situ.)

There are several ways of achieving this. One way is place your JAR file containing the properties files anywhere in the EAR (say the root) and refer to it in the Manifest Class-Path of the J2EE modules that need access.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic