aspose file tools*
The moose likes JBoss/WildFly and the fly likes Application specific properties file not being read the first time it is referenced Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Application specific properties file not being read the first time it is referenced" Watch "Application specific properties file not being read the first time it is referenced" New topic
Author

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

Dan Michaelis
Greenhorn

Joined: Mar 08, 2010
Posts: 2
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
Mark E Hansen
Ranch Hand

Joined: Apr 01, 2009
Posts: 643
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

Joined: Mar 08, 2010
Posts: 2
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

Joined: Apr 01, 2009
Posts: 643
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Application specific properties file not being read the first time it is referenced
 
Similar Threads
JSF not working with JBoss 4.2.1
Ejbc error in Sun One Application Server 7
Question on Log4j NOT restarting
re: Start up of JBoss
Deploying .war files