[
https://jira.jboss.org/jira/browse/JBAS-5467?page=com.atlassian.jira.plug...
]
Brian Egge commented on JBAS-5467:
----------------------------------
This issue caused us a problem again.
We have a deployer script which instead of replacing files, renames them
".backup...". JBoss had been loading both the new file and the .backup file in
the lib directory. I.e., lib/hibernate.jar; lib/.backup-hibernate.jar. This problem
remained hidden until the JBoss server was copied to another directory. After being
moved, it started loading the older files first.
Should we have multiple copies of jars in our lib directory? No, obviously this is a
problem on our part. Should moving the directory cause a working deployment to stop
working? In my opinion, no, the app server should function in a consistant manner
regardless of hardware or the physical ordering of the files.
Unfortunately, we don't build our JBoss servers, but instead insist on running a
version for which a support contact is available. As such, we can't just patch our
own copy and ignore the issue.
I might be wrong about the class, but I'm pretty sure the micro-kernel uses it when it
load the jars in the server's lib directory. Files in the deploy directory do get
loaded in a defined order, but not those in the lib directory.
Here's the specific method, for which the patch applies.
protected File[] listFiles(final String urlspec) throws Exception
{
URL url = Strings.toURL(urlspec);
// url is already canonical thanks to Strings.toURL
File dir = new File(url.getFile());
File[] files = dir.listFiles(new java.io.FileFilter()
{
public boolean accept(File pathname)
{
String name = pathname.getName().toLowerCase();
return (name.endsWith(".jar") ||
name.endsWith(".zip"));
}
});
return files;
}
Order files loaded by the SARDeployer
-------------------------------------
Key: JBAS-5467
URL:
https://jira.jboss.org/jira/browse/JBAS-5467
Project: JBoss Application Server
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: System service
Reporter: Brian Egge
Assignee: Dimitris Andreadis
Priority: Optional
Attachments: sardeployer-sorting.diff
Original Estimate: 15 minutes
Remaining Estimate: 15 minutes
Java's File.listFiles returns files in a not always consistent order. This can be
seen by listing a large directory on different platforms, or even on the same platform.
Specifically, on Solaris we had copied the deploy directory, and found the behavior of our
app changed. This was due to two jar files having different versions of the same class.
Always loading files in the same order would reduce the chance of the order randomly
changing.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira