You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Kev Jackson <ke...@it.fts-vn.com> on 2006/04/18 04:44:55 UTC

Re: Ant 1.7 NullPointerException AbstractFileSet and OOM error

Hm,

In the cargo code we have:

/**
 * Remove all file in the configuration directory.
 */
 private void cleanConfigurationDirectory()
 {
     // Clean up stuff previously put in the temporary directory but do not
     // remove the Cargo timestamp file
     Delete delete = (Delete) getAntUtils().createAntTask("delete");

     FileSet fileSet = new FileSet();
     fileSet.setDir(getHome());
     fileSet.createInclude().setName("**/*");
     fileSet.createExclude().setName(".cargo");

     // Ensure we really delete all files.
     fileSet.setDefaultexcludes(false);
        
     delete.addFileset(fileSet);
     delete.setIncludeEmptyDirs(true);
     delete.setFailOnError(true);
     delete.setQuiet(false);
        
     delete.execute();        
 }

So there's no project being set here for the Delete task, unless 
createAntTask performs some setup magic.

Matt, as you worked on the resource collections for the delete task, do 
you see what's missing in this code?  It certainly seems that from an 
API/programmer viewpoint, the changes to 1.7 are not bwc with code 
written for 1.6.5, but I'm not sure how to go about 'fixing' Delete, or 
what to suggest to the people at cargo to modify this code to get it to 
work with 1.7/trunk

I'm going to check out the 1.6.5 branch and continue testing on that as 
it doesn't contain the new delete code

Thanks
Kev

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


Re: Ant 1.7 NullPointerException AbstractFileSet and OOM error

Posted by Kevin Jackson <fo...@gmail.com>.
On 4/18/06, Matt Benson <gu...@yahoo.com> wrote:
> Well, I checked out appfuse, DL'd Tomcat... then it
> wants mysql, which I just don't have time to install
> too right now.  :)  I will check in my changes anyway.

Thanks, I have all these installed as my 'day job' is
server-side/web-app java, so it wasn't a big deal for me.  I'll test
the changes this morning.

Kev

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


Re: Ant 1.7 NullPointerException AbstractFileSet and OOM error

Posted by Kev Jackson <ke...@it.fts-vn.com>.
Matt,

Just verified your changes have fixed the problem relating to Cargo and 
the NullPointer I was experiencing - thanks for looking into it for me.

Kev

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


Re: Ant 1.7 NullPointerException AbstractFileSet and OOM error

Posted by Matt Benson <gu...@yahoo.com>.
Well, I checked out appfuse, DL'd Tomcat... then it
wants mysql, which I just don't have time to install
too right now.  :)  I will check in my changes anyway.

-Matt

--- Kev Jackson <ke...@it.fts-vn.com> wrote:

> 
> >well, obviously if I broke them it's entirely
> likely
> >they won't be alone.  Probably the easiest/most BC
> >thing will be some form of checking whether
> >(Abstract?)FileSet instances have a project set and
> >using the task's project if not (I think fileset
> >handling is separate from other
> ResourceCollections,
> >so that will work... otherwise I'll clone the
> >filesets).  I'll take a look in about ten hours
> after
> >I get to work.
> >
> >-Matt
> >  
> >
> For testing purposes:
>  >>
> 
> Yes, there's a couple operations that copy around
> 500 files.  Here's
> how to reproduce the problem in AppFuse:
> 
> 1. Checkout the latest code from CVS: cvs -d
> :pserver:guest@cvs.dev.java.net:/cvs co -P appfuse
> (you may have to
> login first, password is guest)
> 2. cd into appfuse/extras/appgen and run "ant
> test-all".
> 3. Make sure your ANT_OPTS are set to "".  When I do
> this, I get the
> following after 4 minutes:
> 
>      [copy] Copying 328 files to
> C:\Source\appfuse-appgen2
>      [copy] Copying 104 files to
> C:\Source\appfuse-appgen2\extras
> 
> BUILD FAILED
> C:\Source\appfuse\extras\appgen\build.xml:639: The
> following error
> occurred while executing this lin
> e:
> C:\Source\appfuse\extras\appgen\build.xml:546: The
> following error
> occurred while executing this lin
> e:
> java.lang.OutOfMemoryError: Java heap space
> 
> Total time: 4 minutes 9 seconds
> 
> <<
> Ant 1.7 fails when trying to execute the cargo
> config, long before the 
> heap space issue (probably within ~1 min).
> Kev
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: Ant 1.7 NullPointerException AbstractFileSet and OOM error

Posted by Kev Jackson <ke...@it.fts-vn.com>.
>well, obviously if I broke them it's entirely likely
>they won't be alone.  Probably the easiest/most BC
>thing will be some form of checking whether
>(Abstract?)FileSet instances have a project set and
>using the task's project if not (I think fileset
>handling is separate from other ResourceCollections,
>so that will work... otherwise I'll clone the
>filesets).  I'll take a look in about ten hours after
>I get to work.
>
>-Matt
>  
>
For testing purposes:
 >>

Yes, there's a couple operations that copy around 500 files.  Here's
how to reproduce the problem in AppFuse:

1. Checkout the latest code from CVS: cvs -d
:pserver:guest@cvs.dev.java.net:/cvs co -P appfuse (you may have to
login first, password is guest)
2. cd into appfuse/extras/appgen and run "ant test-all".
3. Make sure your ANT_OPTS are set to "".  When I do this, I get the
following after 4 minutes:

     [copy] Copying 328 files to C:\Source\appfuse-appgen2
     [copy] Copying 104 files to C:\Source\appfuse-appgen2\extras

BUILD FAILED
C:\Source\appfuse\extras\appgen\build.xml:639: The following error
occurred while executing this lin
e:
C:\Source\appfuse\extras\appgen\build.xml:546: The following error
occurred while executing this lin
e:
java.lang.OutOfMemoryError: Java heap space

Total time: 4 minutes 9 seconds

<<
Ant 1.7 fails when trying to execute the cargo config, long before the 
heap space issue (probably within ~1 min).
Kev

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


Re: Ant 1.7 NullPointerException AbstractFileSet and OOM error

Posted by Matt Benson <gu...@yahoo.com>.
--- Kev Jackson <ke...@it.fts-vn.com> wrote:

> Hm,
> 
> In the cargo code we have:
> 
> /**
>  * Remove all file in the configuration directory.
>  */
>  private void cleanConfigurationDirectory()
>  {
>      // Clean up stuff previously put in the
> temporary directory but do not
>      // remove the Cargo timestamp file
>      Delete delete = (Delete)
> getAntUtils().createAntTask("delete");
> 
>      FileSet fileSet = new FileSet();
>      fileSet.setDir(getHome());
>      fileSet.createInclude().setName("**/*");
>      fileSet.createExclude().setName(".cargo");
> 
>      // Ensure we really delete all files.
>      fileSet.setDefaultexcludes(false);
>         
>      delete.addFileset(fileSet);
>      delete.setIncludeEmptyDirs(true);
>      delete.setFailOnError(true);
>      delete.setQuiet(false);
>         
>      delete.execute();        
>  }
> 
> So there's no project being set here for the Delete
> task, unless 
> createAntTask performs some setup magic.
> 
> Matt, as you worked on the resource collections for
> the delete task, do 
> you see what's missing in this code?  It certainly
> seems that from an 
> API/programmer viewpoint, the changes to 1.7 are not
> bwc with code 
> written for 1.6.5, but I'm not sure how to go about
> 'fixing' Delete, or 
> what to suggest to the people at cargo to modify
> this code to get it to 
> work with 1.7/trunk
> 

well, obviously if I broke them it's entirely likely
they won't be alone.  Probably the easiest/most BC
thing will be some form of checking whether
(Abstract?)FileSet instances have a project set and
using the task's project if not (I think fileset
handling is separate from other ResourceCollections,
so that will work... otherwise I'll clone the
filesets).  I'll take a look in about ten hours after
I get to work.

-Matt

> I'm going to check out the 1.6.5 branch and continue
> testing on that as 
> it doesn't contain the new delete code
> 
> Thanks
> Kev
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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