• 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

Application specific properties file not being read the first time it is referenced

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My apologies for asking what I hope will be a fairly simple question. I'm relatively new to deployment of code to JBOSS, and I'm not sure where to start looking for the answer to this problem.

I have a .war that I have developed under Eclipse, and have deployed to JBOSS through Eclipse's automated deployment tool (I personally prefer Maven's command line interface, but I'm trying to get away from my "green screen" background, and trying to give GUI's a chance). I have moderately extensive unit tests written that SHOULD expose any properties file problems before I deploy the code, and the tests do not indicate that I should have a problem.

I deploy the application to the JBOSS server, and open the initial page with the browser. Everything there seems to work fine, but there's no server interaction required to load the page (just a bunch of javascript). When I click on one of the buttons that invokes a server action, I immediately get an exception on the server side, saying that my logging properties file (and it is my application logging properties, file, not the log4j properties configuration for JBOSS) cannot be found. I would chalk this up to my eternal frustration with all things classpath, except that after the first attempt to access the server, this exception seems to go away (replaced with another one that relates to another question I have... but I digress).

I can't think of any "timing" condition that would cause the application not to be able to find a file, but I can't think of any reason why a second attempt would find the file in the .war file when the first attempt would fail.

Any push in the right direction would help; I'm stuck for an angle from which to approach this problem.

Thanks in advance,

Dan Michaelis
 
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you sure the reason you're not getting that error on the second attempt isn't because something else is happening sooner than when that error would get hit? In other words, perhaps on the second attempt, the application is not getting as far.

Anyway, you're not saying very much about what is going on with the application. What is the exception you're getting? Is there no way you can debug that to determine what the path is to the file the application is actually trying to find? Once we know that, it should be a simple matter to find where the application really is, and bring the real issue to light.

All you've said is the application can't find a file. Not much to go on there...
 
Dan Michaelis
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mark,

Thanks for the reply.

And now that I think it through; you're entirely correct, and this was a stupid developer error. How thoroughly embarrassing!

The properties file is used for logging; once the loggers are configured, I theoretically never have to read the file again, so subsequent calls don't even try. <sigh> There is a secondary problem with the code that had led me down the wrong path on this one, but even *I* should have figured this out on my own!

Thanks again!
 
Mark E Hansen
Ranch Hand
Posts: 650
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't be embarrassed. Often times, I need a second pair of eyes to see some really simple mistakes I've made, and I've been developing since the early 1980's.

Anyway, I'm glad you got it working.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic