Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365657

Summary: org.eclipse.ant.core.AntRunner.getInternalAntRunner() fails and the build is unsucessfull
Product: [Eclipse Project] Platform Reporter: Mahesh Maney <mahesh.maney>
Component: AntAssignee: Platform-Ant-Inbox <platform-ant-inbox>
Status: RESOLVED NOT_ECLIPSE QA Contact:
Severity: major    
Priority: P3 CC: curtis.windatt.public, mahesh.maney, Michael_Rennie, remy.suen
Version: 3.7   
Target Milestone: ---   
Hardware: PC   
OS: Windows NT   
Whiteboard:

Description Mahesh Maney CLA 2011-12-05 14:24:11 EST
Build Identifier: 20110615-0604

I'm calling the run() method of Antrunner, while executing the body of run() at line 323 - classInternalAntRunner = getInternalAntRunner(); enters into the getInternalAntRunner() . I get the following message when the getInternalAntRunner() is executed at line - "return loader.loadClass("org.eclipse.ant.internal.core.ant.InternalAntRunner"); //$NON-NLS-1$"

java.lang.NullPointerException
	at sun.net.util.URLUtil.urlNoFragString(Unknown Source)
	at sun.misc.URLClassPath.getLoader(Unknown Source)
	at sun.misc.URLClassPath.getResource(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at org.eclipse.ant.internal.core.AntClassLoader.findClass(AntClassLoader.java:54)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at org.eclipse.ant.core.AntRunner.getInternalAntRunner(AntRunner.java:398)
	at org.eclipse.ant.core.AntRunner.run(AntRunner.java:323)
	at com.unisys.jai.core.DMSProcessor$DoWork$1.run(DMSProcessor.java:679)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)

The same code when executed on Eclipse 3.6, Build id: 20100318-1801 it works fine. both are executed on windows xp Professional, SP 3. 

Reproducible: Always

Steps to Reproduce:
1. have a build.xml that compiles and jars some java files
2. call org.eclipse.ant.core.AntRunner.run()
3. we get java.lang.NullPointerException
Comment 1 Curtis Windatt CLA 2011-12-05 15:53:01 EST
Reassigning to platform ant
Comment 2 Michael Rennie CLA 2011-12-06 11:42:00 EST
(In reply to comment #0)
> Build Identifier: 20110615-0604
> 
> I'm calling the run() method of AntRunner, while executing the body of run() 

How exactly are you calling the run() method? How are you configuring AntRunner prior to running it?
Comment 3 Mahesh Maney CLA 2011-12-07 03:02:57 EST
// I create  an object of AntRunner.
     AntRunner ar = new AntRunner();
// Set the absolute path of the build.xml file
ar.setBuildFileLocation(buildFile);
// Set all the required jar files to the class path;
    // jdk1.6.0_11/lib/tools.jar;
    //lib/ant.jar, 
    //lib/ant-apache-oro.jar,
    //lib/ant-jai.jar, 
    //lib/ant-junit.jar, 
    //lib/ant-jsch.jar, 
    //lib/ant-antlr.jar, 
    //lib/ant-launcher.jar, 
    //lib/ant-netrexx.jar, 
    //lib/ant-apache-bsf.jar,
    //lib/ant-jmf.jar, 
    //lib/ant-jdepend.jar, 
    //lib/ant-swing.jar, 
    //lib/ant-commons-net.jar
    // mU is an URL array containing the URL of all the mentioned jar files
ar.setCustomClasspath(mU);
// set up a file to record activity 
setMessageFile(ar,opFolder);
try {
      // Calling the run() method now.
      ar.run(m);
} catch (Exception e) {
      e.printStackTrace();
}

After the call to the run(), it enters AntRunner class's run() at line 313
At line # 323 - classInternalAntRunner = getInternalAntRunner(); is executed throwing a null pointer exception.

is this the information you looking for Mike ? anything more expected please let me know.
Comment 4 Mahesh Maney CLA 2012-06-22 06:46:45 EDT
the issue was not from eclipse.