• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How Do I Add Properties Library

 
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm new to Tomcat, having used Websphere server until now. I was able to easily add the properties library to the Websphere server in WSAD by adding its location to the classpath. I can't, however, figure out how to do something similar in Tomcat. There doesn't seem to be anything in the server.xml, web.xml, or the cataline.policy that I can find. I would be grateful for any assistance. Thank you.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is a "properties library"?

If you are just looking to add a jar to the classpath, drop it into WEB-INF/lib or the Tomcat lib folder (to share it across all apps)
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's a directory the contains a collection of .properties files where I store the properties that are common to all applications. I tried copying the directory into the share/lib (I'm assuming that's what you meant), but it's still not working. As I said, I'm a novice.
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I see things for other applications, such as SUSE linux (I'm using eclipse ganymede) and it shows what I would need under JVM settings. Unfortunately, I don't see anything similar in eclipse. And I just realized I hadn't mentioned eclipse before. So that's what I'm using, if that helps you at all. I'm running on XP.

(on Websphere, it was the classpath under Environment)
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe this will help? In my Websphere server, I set up the following to get the properties library to be recognized globally:

 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you are accessing these properties files using normal Java mechanisms (are you?), then all they need to be is on the calsspath. So you should just be able to include them in the WEB-INF/classes hierarchy.
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'll try that and get back to you -- just tried adding to the shared.loader:

shared.loader=${catalina.base}/shared/classes,${catalina.base}/shared/lib/*.jar,${catalina.base}/shared/lib/properties/*.properties

That didn't work. I'll see if this does...

Wait -- these aren't classes, they are files -- text files, specifically. [added] and yes, I know you can put properties in the JavaSource to be compiled and that works, but not with this [completed] And it is required that the basics not change (which doing this will change the basics). We have a controlling jar that points to /properties to find /properties/<name>.properties files. I am required to use the home-grown jar and cannot manipulate it. So that puts me back at square one....
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I FIGURED IT OUT!!! Understand, this has been the last four weeks of my life off and on. Okay, if anyone is interested, in eclipse, I selected Run > Run Configuration, clicked on localhost under Apache, then clicked the Classpath tab. I clicked on User Entries, then Advanced (the other buttons didn't apply). I selected Add External Folder, then selected the Properties directory. Started up the server and VOILA! there was my application!

Bear, as always, I appreciate your assistance. You are always patient and do what you can to help. This is probably only the second time in my recollection that you didn't know the answer. Considering the number of times I've had the pleasure of getting your assistance, that's remarkable. Thanks for everything.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Setting something up in an IDE has no resemblance to setting things up for a real site. You should mention that you are trying to set up an IDE when posting.

My answer is appropriate for those trying to set up a real production site outside of an IDE.
 
Pat Flickner
Ranch Hand
Posts: 173
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Absolutely, Bear. All I was trying to do was get my localhost set up. And I thank you for your assistance.
 
Do not threaten THIS beaver! Not even with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic