can a webservice load jars during run time
- by KItis
I have created a simple web-service using Java. i want to load jars related to web-service during runtime. I have done this task for normal Java application. there what I did was
JarFile jar = new JarFile(f.getPath());
final Manifest manifest = jar.getManifest();
final Attributes mattr = manifest.getMainAttributes();
// Read the manifset in jar files and get the Name attribute
// whare it specified the class that need to load
//for (Object a : mattr.keySet()) {
for (Iterator iter = mattr.keySet().iterator(); iter.hasNext();) {
Object obj = (Object)iter.next();
if ("ServiceName".equals(obj.toString()))
className = mattr.getValue((Name) obj);
//System.out.println(className);
}
/*
* Create the jar class loader and use the first argument passed
* in from the command line as the jar file to use.
*/
JarClassLoader jarLoader = new JarClassLoader(f.getPath());
/* Load the class from the jar file and resolve it. */
Class c = jarLoader.loadClass(className, true);
My problem is
can I put jars that need to be loaded during run time in to separate folder rather than putting in to WEBINF folder.
do i have to put jars both in axis and web-application.
thanks in advance for any contribution for this question.