This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Java in General and the fly likes Exception that only shows up for first visitor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Exception that only shows up for first visitor" Watch "Exception that only shows up for first visitor" New topic
Author

Exception that only shows up for first visitor

Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

We just solved an issue here where a jar file was only readable by root on a unix server and our web application was trying to get to it as "other"

It was hard to solve because upon server restart, the first attempt to access it threw an error that contained:
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)

Caused by: java.security.PrivilegedActionException: java.util.zip.ZipException:
Permission denied
at java.security.AccessController.doPrivileged(Native Method)
... 44 more

subsequent attempts gave a different error that did not show the permission denied or anything else useful, just a noClassDefFound error.

It seems like on the first attempt the inaccessible file gets partially opened or something and the java environment keeps some memory of that. Then, subsequent visits don't see it as a permission error.

my reason for posting is to see if someone can explain this for me.

Environment is weblogic server, but it is using plain sun JVM
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Probably some kind of performance optimization the VM is doing...


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Tim McGuire
Ranch Hand

Joined: Apr 30, 2003
Posts: 820

yes. it optimized 8 hours away. I wonder how to avoid this in the future. It seems like a bug.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Exception that only shows up for first visitor