You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2008/04/09 20:52:10 UTC

DO NOT REPLY [Bug 44790] New: NullPointerException using with

https://issues.apache.org/bugzilla/show_bug.cgi?id=44790

           Summary: NullPointerException using <pathconvert> with <mapper
                    type="unpackage">
           Product: Ant
           Version: 1.7.0
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: Core
        AssignedTo: notifications@ant.apache.org
        ReportedBy: archie@dellroad.org


Possibly related to Bug #44731?

$ cat > xx.xml
<project name="foo" default="foo">
  <target name="foo">
    <pathconvert property="janfu" dirsep="/">
      <path location="${foobar}"/>
      <mapper type="unpackage"/>
    </pathconvert>
    <echo message="janfu=${janfu}"/>
  </target>
</project>

$ ant -v -f xx.xml -Dfoobar=aa.bb.cc
Apache Ant version 1.7.0 compiled on September 22 2007
Buildfile: xx.xml
Detected Java version: 1.5 in: /usr/lib/jvm/java-1.5.0-sun-1.5.0_13-sr2/jre
Detected OS: Linux
parsing buildfile /home/archie/ivycore/trunk/xx.xml with URI =
file:/home/archie/ivycore/trunk/xx.xml
Project base dir set to: /home/archie/ivycore/trunk
Build sequence for target(s) `foo' is [foo]
Complete build sequence is [foo, ]

foo:
[antlib:org.apache.tools.ant] Could not load definitions from resource
org/apache/tools/ant/antlib.xml. It could not be found.

BUILD FAILED
/home/archie/ivycore/trunk/xx.xml:3: java.lang.NullPointerException
        at org.apache.tools.ant.types.Mapper.getImplementation(Mapper.java:233)
        at
org.apache.tools.ant.taskdefs.PathConvert.execute(PathConvert.java:342)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        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:348)
        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:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        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:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.NullPointerException
        at
org.apache.tools.ant.util.GlobPatternMapper.setFrom(GlobPatternMapper.java:98)
        at org.apache.tools.ant.types.Mapper.getImplementation(Mapper.java:226)
        ... 18 more
--- Nested Exception ---
java.lang.NullPointerException
        at
org.apache.tools.ant.util.GlobPatternMapper.setFrom(GlobPatternMapper.java:98)
        at org.apache.tools.ant.types.Mapper.getImplementation(Mapper.java:226)
        at
org.apache.tools.ant.taskdefs.PathConvert.execute(PathConvert.java:342)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
        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:348)
        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:1329)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1298)
        at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
        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:257)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)

Total time: 1 second
$


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

DO NOT REPLY [Bug 44790] NullPointerException using with

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44790





--- Comment #1 from Stefan Bodewig <bo...@apache.org>  2008-08-11 04:14:13 PST ---
the underlaying reason is that from and to are in fact required attributes of
the unpackage and package mappers, even though having them default to "*" would
have been a reasonable choice.

You need to fix your build file.

I'm going to remove the NPE and change it to a meaningful error message - and
document that the attributes are required.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 44790] NullPointerException using with

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44790


Stefan Bodewig <bo...@apache.org> changed:

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




--- Comment #2 from Stefan Bodewig <bo...@apache.org>  2008-08-11 04:41:03 PST ---
docchange and explicit guards in svn revision 684721


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 44790] NullPointerException using with

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=44790


Stefan Bodewig <bo...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |notifications@ant.apache.org
         AssignedTo|notifications@ant.apache.org|bodewig@apache.org




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are the assignee for the bug.