You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2006/10/29 03:44:08 UTC

DO NOT REPLY [Bug 40839] New: - fails with NPE when compiling with eclipse ecj 3.1.x

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40839>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40839

           Summary: <javac> fails with NPE when compiling with eclipse ecj
                    3.1.x
           Product: Ant
           Version: 1.7.0Beta3
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: caster@gentoo.org


Executing <javac> on any sources with ant 1.7 and ecj 3.1 (taken from eclipse
3.1.2) results in (-debug):

Apache Ant version 1.7.0Beta3 compiled on October 29 2006
Buildfile: build.xml
Adding reference: ant.PropertyHelper
Detected Java version: 1.5 in: /opt/sun-jdk-1.5.0.08/jre
Detected OS: Linux
Adding reference: ant.ComponentHelper
Setting ro project property: trigger.include -> true
Setting ro project property: build.compiler ->
org.eclipse.jdt.core.JDTCompilerAdapter
Setting ro project property: ant.file -> /home/caster/gentoo/ant/tst/build.xml
setting java.net.useSystemProxies to true
Adding reference: ant.projectHelper
Adding reference: ant.parsing.context
Adding reference: ant.targets
parsing buildfile /home/caster/gentoo/ant/tst/build.xml with URI =
file:/home/caster/gentoo/ant/tst/build.xml
Setting ro project property: ant.project.name -> test
Adding reference: test
Setting ro project property: ant.file.test -> /home/caster/gentoo/ant/tst/build.xml
Project base dir set to: /home/caster/gentoo/ant/tst
 +Target:
 +Target: compile
 +Target: prepare
 +Target: clean
Attempting to create object of type org.apache.tools.ant.helper.DefaultExecutor
Adding reference: ant.executor
Build sequence for target(s) `compile' is [compile]
Complete build sequence is [compile, prepare, clean, ]

compile:
[antlib:org.apache.tools.ant] Could not load definitions from resource
org/apache/tools/ant/antlib.xml. It could not be found.
fileset: Setup scanner in dir /home/caster/gentoo/ant/tst/src with patternSet{
includes: [Class1.java:if->trigger.include] excludes: [] }
    [javac] Class1.java added as Class1.class doesn't exist.
    [javac] Compiling 1 source file to /home/caster/gentoo/ant/tst/classes
    [javac] Using JDT compiler
dropping /opt/sun-jdk-1.5.0.08/jre/jre/lib/rt.jar from path as it doesn't exist
dropping /opt/sun-jdk-1.5.0.08/Classes/jce.jar from path as it doesn't exist
dropping /opt/sun-jdk-1.5.0.08/Classes/jsse.jar from path as it doesn't exist
dropping /opt/sun-jdk-1.5.0.08/jre/lib/core.jar from path as it doesn't exist
dropping /opt/sun-jdk-1.5.0.08/jre/lib/graphics.jar from path as it doesn't exist
dropping /opt/sun-jdk-1.5.0.08/jre/lib/security.jar from path as it doesn't exist
dropping /opt/sun-jdk-1.5.0.08/jre/lib/server.jar from path as it doesn't exist
dropping /opt/sun-jdk-1.5.0.08/jre/lib/xml.jar from path as it doesn't exist
dropping /opt/sun-jdk-1.5.0.08/Classes/classes.jar from path as it doesn't exist
dropping /opt/sun-jdk-1.5.0.08/Classes/ui.jar from path as it doesn't exist

BUILD FAILED
/home/caster/gentoo/ant/tst/build.xml:5: java.lang.NullPointerException
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:115)
        at org.apache.tools.ant.Task.perform(Task.java:342)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1291)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1260)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1143)
        at org.apache.tools.ant.Main.runBuild(Main.java:698)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.NullPointerException
        at
org.apache.tools.ant.types.AbstractFileSet.setupDirectoryScanner(AbstractFileSet.java:467)
        at
org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:429)
        at org.apache.tools.ant.types.FileSet.iterator(FileSet.java:69)
        at org.apache.tools.ant.types.resources.Union.getCollection(Union.java:105)
        at org.apache.tools.ant.types.resources.Union.getCollection(Union.java:88)
        at
org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.cacheCollection(BaseResourceCollectionContainer.java:244)
        at
org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.toString(BaseResourceCollectionContainer.java:229)
        at org.apache.tools.ant.types.Path.toString(Path.java:333)
        at
org.apache.tools.ant.types.Commandline$Argument.setPath(Commandline.java:135)
        at
org.eclipse.jdt.core.JDTCompilerAdapter.setupJavacCommand(JDTCompilerAdapter.java:144)
        at
org.eclipse.jdt.core.JDTCompilerAdapter.execute(JDTCompilerAdapter.java:56)
        at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:995)
        at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:819)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:281)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        ... 11 more
--- Nested Exception ---
java.lang.NullPointerException
        at
org.apache.tools.ant.types.AbstractFileSet.setupDirectoryScanner(AbstractFileSet.java:467)
        at
org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:429)
        at org.apache.tools.ant.types.FileSet.iterator(FileSet.java:69)
        at org.apache.tools.ant.types.resources.Union.getCollection(Union.java:105)
        at org.apache.tools.ant.types.resources.Union.getCollection(Union.java:88)
        at
org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.cacheCollection(BaseResourceCollectionContainer.java:244)
        at
org.apache.tools.ant.types.resources.BaseResourceCollectionContainer.toString(BaseResourceCollectionContainer.java:229)
        at org.apache.tools.ant.types.Path.toString(Path.java:333)
        at
org.apache.tools.ant.types.Commandline$Argument.setPath(Commandline.java:135)
        at
org.eclipse.jdt.core.JDTCompilerAdapter.setupJavacCommand(JDTCompilerAdapter.java:144)
        at
org.eclipse.jdt.core.JDTCompilerAdapter.execute(JDTCompilerAdapter.java:56)
        at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:995)
        at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:819)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:281)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
        at org.apache.tools.ant.Task.perform(Task.java:342)
        at org.apache.tools.ant.Target.execute(Target.java:357)
        at org.apache.tools.ant.Target.performTasks(Target.java:385)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1291)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1260)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1143)
        at org.apache.tools.ant.Main.runBuild(Main.java:698)
        at org.apache.tools.ant.Main.startAnt(Main.java:199)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Total time: 0 seconds


Happens with both beta3 and latest svn (468820).

What's interesting, ecj 3.2 works fine. But since it's different branch and not
just bugfix of 3.1, I believe it's still worth fixing. Also, ant 1.6.5 works
with both ecj 3.1 and 3.2 which suggests the problem is in ant, not ecj?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40839] - fails with NPE when compiling with eclipse ecj 3.1.x

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40839>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40839


antoine@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |1.7.0




------- Additional Comments From antoine@apache.org  2006-10-29 18:57 -------
fixed in SVN. Workaround is to set the Project attribute to FileSet in
Path#addFileset. Did the same for FileList, Path, and DirSet.
Root cause of the problem is org.eclipse.jdt.core.JDTCompilerAdapter.java . In
the version 3.1 of Eclipse, a FileSet is created in the method addExtDirs(Path,
Path). The Project attribute is not set on this FileSet, but it is added to a
Path. When Path.toString() is called, this leads to a NullPointerException. I
suppose that this is done differently in Eclipse 3.2.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40839] - fails with NPE when compiling with eclipse ecj 3.1.x

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40839>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40839





------- Additional Comments From antoine@apache.org  2006-10-28 20:46 -------
Can you add your build file to the bug report ? Or ideally just the piece which
is necessary to find the error.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40839] - fails with NPE when compiling with eclipse ecj 3.1.x

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40839>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40839





------- Additional Comments From antoine@apache.org  2006-10-28 20:44 -------
the sources of JDTCompilerAdapter can be seen here
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.core/antadapter/org/eclipse/jdt/core/JDTCompilerAdapter.java

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


DO NOT REPLY [Bug 40839] - fails with NPE when compiling with eclipse ecj 3.1.x

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40839>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40839





------- Additional Comments From caster@gentoo.org  2006-10-29 01:10 -------
Created an attachment (id=19049)
 --> (http://issues.apache.org/bugzilla/attachment.cgi?id=19049&action=view)
simple build file exploiting the bug

"ant prepare" creates the .java file to compile, "ant" compiles it,
build.compiler property is pre-set to ecj, you just need to supply ecj.jar via
-lib parameter

you can download sources of ecj here, to spare downloading of whole eclipse
sources (they are just unpacked directly from there), there are also build
files for creating ecj.jar for testing
http://dev.gentoo.org/~caster/distfiles/eclipse-ecj-3.1.2.tar.bz2
http://dev.gentoo.org/~caster/distfiles/eclipse-ecj-3.2.tar.bz2

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org