ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Public Id <>
Subject ClassCastException in MacroInstance (Apache Ant version 1.6.5 compiled on June 2 2005)
Date Mon, 07 Aug 2006 13:02:40 GMT
I am getting a ClassCastException from MacroInstance. This is the actual callstack I get:
  C:\dev\workspace\proj\build.xml:70: org.apache.bsf.BSFException: The application script
threw an exception: The following error occurred while executing this line:
C:\dev\workspace\proj\build.xml:21: The following error occurred while executing this line:
C:\dev\workspace\proj\build-common.xml:341: The following error occurred while executing this
C:\dev\workspace\proj\build-common.xml:365: java.lang.ClassCastException BSF info: ANT at
line: 0 column: columnNo

  I've debugged this to, line 273:
  UnknownElement unknownElement = (UnknownElement) r.getProxy();
  What is happening is that r.getProxy() is actually returning a FileSet, hence the exception.
  Here's what's odd: I am getting this exception when I try to use beanshell with the
  script task to create a subant task and perform it, passing in a Filelist. I've got an existing
target which does the exact same thing as the subant task I'm trying to create but with a
larger Filelist. When I run invoke that target directly, everything works just fine.
  Here's the excerpt which creates the task:
  fl = project.createDataType("filelist");
  fl.setDir( new File("..") );
  fl.setFiles( sb.toString() );
  task = project.createTask( "subant" );
  task.setTaskName( "build-continuing" );
  task.setTaskType( "build-continuing" );
  task.setTarget( "all" );
  task.setVerbose( true );
  task.addFilelist( fl );
  Is there something else I need to do? Any thoughts as to what could cause this? Is this
a question better suited for the dev list?
  : jay

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message