Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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

WSAD & JAR Files

 
Ranch Hand
Posts: 503
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All:
- I placed a file called "properties.dat" in a jar file called "myJar.jar".
- I placed "myJar.jar" in an ear folder called "MyTestEar".
- I created a web application called "MyTestApplication" and placed "DisplayProperties.java" in this application.
--------
Question:
1. What do I need to do to get DisplayProperties.java to read the properties from myJar.jar?
- What should my Java code look like? Do I need to do any imports or such?
- What dependencies in WSAD would I need to set?
-------
I am new to WSAD and am having a bear of a time trying to read in a properties file. Any help or links to articles would be appreciated.
Thanks,
John Coxey
(jpcoxey001@yahoo.com)
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you try amending the properties of your web project, on the library tab, to include the jar from the ear project? Also, you might look at this link:
http://www7b.boulder.ibm.com/wsdd/library/techarticles/0112_deboer/deboer2.html?n1102
 
John Coxey
Ranch Hand
Posts: 503
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kasey & All:
- Having one of those Malox moments.
- I had placed my propertied file with the regular Java source classes, at the project level.
- Well, when I JAR'd up the properties file, it apparently kept the package structure.
- So I use /com/test/coxey/properties.file to read my JAR'd properties file (now placed in the EAR file). And it works.
- Arggggghhhhh!!! Two days to find this problem. Guess that's what we get paid for.
- Thanks for the help.
Johnny

and when I Jar'd the prop
 
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic