aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Getting Null Pointer Exception While calling execute method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Getting Null Pointer Exception While calling execute method" Watch "Getting Null Pointer Exception While calling execute method" New topic
Author

Getting Null Pointer Exception While calling execute method

Srinivas Ivaturi
Ranch Hand

Joined: Jan 28, 2003
Posts: 50
import org.apache.catalina.ant.AbstractCatalinaTask;
import org.apache.catalina.ant.DeployTask;

public class TestWarFileDeployment {

public static void deployWARFile()
{
DeployTask dt = new DeployTask();
dt.setUrl("http://localhost:8080/manager/html");
dt.setUsername("tomcat");
dt.setPassword("tomcat");
dt.setPath("/test");
dt.setWar("file :/test.war");

dt.execute();
}

public static void main(String args[])
{
deployWARFile();
}
}


When I compile and run this program to install the test.war file via Java program + Ant task I am getting the following exception. Do I need to set anything else? / Anything am I missing?


Exception in thread "main" java.lang.NullPointerException
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:278)
at org.apache.catalina.ant.DeployTask.execute(DeployTask.java:146)
at com.ssaglobal.TestFramework.TestWarFileDeployment.deployWARFile(TestWarFileDeployment.java:31)
at com.ssaglobal.TestFramework.TestWarFileDeployment.main(TestWarFileDeployment.java:37)
Caused by: java.lang.NullPointerException
at org.apache.tools.ant.Task.log(Task.java:302)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:259)
... 3 more
--- Nested Exception ---
java.lang.NullPointerException
at org.apache.tools.ant.Task.log(Task.java:302)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:259)
at org.apache.catalina.ant.DeployTask.execute(DeployTask.java:146)
at com.ssaglobal.TestFramework.TestWarFileDeployment.deployWARFile(TestWarFileDeployment.java:31)
at com.ssaglobal.TestFramework.TestWarFileDeployment.main(TestWarFileDeployment.java:37)


Thanks
Srinivas Ivaturi.
Srinivas Ivaturi
Ranch Hand

Joined: Jan 28, 2003
Posts: 50
Can somebody help me out in that problem???
Roseanne Zhang
Ranch Hand

Joined: Nov 14, 2000
Posts: 1953
Your task should extends the ant Task class.
http://bobcat.webappcabaret.net/javachina/faq/ant_01.htm#ant_abc_Q07
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting Null Pointer Exception While calling execute method