Cactus
  1. Cactus
  2. CACTUS-219

the cactus scanner return a java.lang.NullPointerException with maven 1.1-beta-1

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.7.1
    • Component/s: Ant Integration
    • Labels:
      None

      Description

      When running the cactus:test-war goal with maven 1.1-beta-1 I get the following stack trace:

      Root cause
      java.lang.NullPointerException
      at org.apache.cactus.integration.maven.CactusScanner.processFileSet(CactusScanner.java:106)
      at org.apache.cactus.integration.maven.CactusScannerTag.doTag(CactusScannerTag.java:123)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.apache.maven.jelly.tags.werkz.MavenGoalTag.runBodyTag(MavenGoalTag.java:78)
      at org.apache.maven.jelly.tags.werkz.MavenGoalTag$MavenGoalAction.performAction(MavenGoalTag.java:109)
      at org.apache.maven.werkz.Goal.fire(Goal.java:656)
      at org.apache.maven.werkz.Goal.attain(Goal.java:592)
      at org.apache.maven.werkz.WerkzProject.attainGoal(WerkzProject.java:210)
      at org.apache.maven.jelly.tags.werkz.MavenAttainGoalTag.doTag(MavenAttainGoalTag.java:114)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:247)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
      at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:186)

      This seems to be caused by a change to the class org.apache.tools.ant.types.AbstractFileSet in ant 1.6.x. This class now has a new toString() method which throws the following exception

      Caused by: No directory specified for FileSet.
      at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:345)
      at org.apache.tools.ant.types.AbstractFileSet.toString(AbstractFileSet.java:654)
      at java.lang.String.valueOf(String.java:2577)
      at java.lang.StringBuilder.append(StringBuilder.java:116)
      at org.apache.cactus.integration.maven.CactusScannerTag.addFileset(CactusScannerTag.java:173)

      A potential patch to CactusScannerTag.java is attached

      1. CACTUS-219.zip
        2 kB
        Eric Lapierre
      2. CactusScannerTag.patch.zip
        0.5 kB
        Eric Lapierre

        Activity

        Eric Lapierre created issue -
        Eric Lapierre made changes -
        Field Original Value New Value
        Attachment CactusScannerTag.patch.zip [ 12311102 ]
        Hide
        Felipe Leme added a comment -

        Eric,

        I can apply something similar to your patch so we can handle that toString() exception, but I'm afraid there is something more serious than that, I mean, we need to figure it out why the exception is being thrown. Could you provide instructions on how to reproduce it?

        Note that it might be a problem similar to this one:

        http://jira.codehaus.org/browse/MAVEN-1606

        – Felipe

        Show
        Felipe Leme added a comment - Eric, I can apply something similar to your patch so we can handle that toString() exception, but I'm afraid there is something more serious than that, I mean, we need to figure it out why the exception is being thrown. Could you provide instructions on how to reproduce it? Note that it might be a problem similar to this one: http://jira.codehaus.org/browse/MAVEN-1606 – Felipe
        Hide
        Eric Lapierre added a comment -

        I added a small project that reproduces the problem. Just invoke maven cactus:test-war

        Let me know if you need more info

        Show
        Eric Lapierre added a comment - I added a small project that reproduces the problem. Just invoke maven cactus:test-war Let me know if you need more info
        Eric Lapierre made changes -
        Attachment CACTUS-219.zip [ 12311178 ]
        Hide
        Felipe Leme added a comment -

        Ok, I could reproduce it - I will try to fix it tonight.

        Show
        Felipe Leme added a comment - Ok, I could reproduce it - I will try to fix it tonight.
        Hide
        Felipe Leme added a comment -

        I applied Eric's suggestion, i.e., removed the call to fileset.toString(), as it wasn't being useful even on Maven 1.0.

        Show
        Felipe Leme added a comment - I applied Eric's suggestion, i.e., removed the call to fileset.toString(), as it wasn't being useful even on Maven 1.0.
        Felipe Leme made changes -
        Resolution Fixed [ 1 ]
        Fix Version/s 1.7.1 [ 12310160 ]
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Felipe Leme [ felipeal ]

          People

          • Assignee:
            Felipe Leme
            Reporter:
            Eric Lapierre
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development