I tried to use the WLRun task yesterday and I found several modifications that could improve the usability of this task. I don't know to whom I should send them so here they are :
 
(1) When there is an error reading the weblogicSystemHome directory, print the full absolute path name in order to better detect where the error comes from :
 
        if (!weblogicSystemHome.isDirectory()) {
String fullPath = null;
try {
    fullPath = weblogicSystemHome.getCanonicalPath();
} catch (Exception e) {
    // handle the error
}

            throw new BuildException("weblogic home directory " + fullPath + " is not valid");
        }
(2)  use the "project.resolveFile()" API to resolve all path names. Otherwise the basedir attribute of your Ant project is not taken into account.
 
So, instead of writing :
 
    public void setHome(String weblogicHome) {
        weblogicSystemHome = new File((weblogicHome);
    }
write :
 
    public void setHome(String weblogicHome) {
        weblogicSystemHome = project.resolveFile(weblogicHome);
    }
(3) Don't locate the policy file relative to the weblogicSystemHome (As I put my policy file elsewhere, I had to modify WLRun).
 
Instead of writing :
 
        File securityPolicyFile = null;
        if (securityPolicy == null) {
            securityPolicyFile = new File(weblogicSystemHome, defaultPolicyFile);
        }
        else {
            securityPolicyFile = new File(weblogicSystemHome, securityPolicy);
        }
write :
 
        File securityPolicyFile = null;
        if (securityPolicy == null) {
            securityPolicyFile = new File(weblogicSystemHome, defaultPolicyFile);
        }
        else {
            securityPolicyFile = project.resolveFile(securityPolicy);
        }
 
That's all !
thanks.
Vincent
 

Reply via email to