I want to control in what order jars(setting classpath) files will be loaded so that java can load the a.class from a.jar rather than b.jar when both a.jar and b.jar has the same class.
this can be done by changing the way pathcURL picks up jar or zip files.
The code is in serverImpl.java of jboss-system.jar initBootLibraries()
method which is private.
The code needs to change to accept multiple jar files also and in the order we have specified in patchURL parameter.I am not sure whether it is good idea to modify by ourself as it will be very hard to maintain. Doesanyone have any suggestion!!.we are in process of buying jboss. should i make a patch request once we buy it or there is another way out.It is pretty urgent as we have a delivery to make.
Below is the code i am talking about..
/**
* Initialize the boot libraries.
*/
private RepositoryClassLoader initBootLibraries() throws Exception
{
// Build the list of URL for the spine to boot
List list = new ArrayList();
// Add the patch URL. If the url protocol is file, then
// add the contents of the directory it points to
URL patchURL = config.getPatchURL();
if (patchURL != null)
{
if (patchURL.getProtocol().equals("file"))
{
File dir = new File(patchURL.getFile());
if (dir.exists())
{
// Add the local file patch directory
list.add(dir.toURL());
// Add the contents of the directory too
File[] jars = dir.listFiles(new FileSuffixFilter(new String[] { ".jar", ".zip" }, true));
for (int j = 0; jars != null && j < jars.length; j++)
{
list.add(jars[j].getCanonicalFile().toURL());
}
}
}
else
{
list.add(patchURL);
}
}
shiva