ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pahucki, Nathan" <NPahu...@silverstream.com>
Subject RE: Custom Task That Accepts a fileset
Date Thu, 18 Jul 2002 13:46:05 GMT
This is solved, sorry for the bother. I named my custom task "filelist" in
the taskdef forgetting that there is an element in ant already named
"filelist". I renamed it, and it works fine now.

-----Original Message-----
From: Pahucki, Nathan 
Sent: Wednesday, July 17, 2002 5:45 PM
To: 'ant-dev@jakarta.apache.org'
Subject: Custom Task That Accepts a fileset


I am writing a custom task for Ant 1.5 (release) that is supposed to accept
a fileset. I have the public void addFileset(FileSet fs) method, however,
when I run the task, I get an Exception from the IntrospectionHelper saying
that the task does not accept the "fileset" nested element. The thing that
absolutely baffles me is that this same method is used in ant-provided tasks
(like Copy or Delete) and works fine. I have also tried the createFileset
and addConfiguredFileset methods to no avail.
 
I dug into the IntrospectorHelper a little, and discovered that the
nestedCreators (Hasthable) member variable, at the end of the constructor
does have an entry for fileset (as it should). However, when the
createElement() method is called, the nestedCreators has absolutely nothing
in it, and so the nestedCreator for fileset is null, and so I get the
exception. Perhaps there is a bug here, or I am just not doing something
right. 
 
Any suggestions would be appreciated.

Here is XML in the build file:

<filelist>
	<fileset dir="${silverfoundry.repositorydir}" >
		<patternset>
			   <exclude name="CVSROOT"/>
		</patternset>
	</fileset>
</filelist>

And here is the add method:

     /**
     * Adds a set of files (nested fileset attribute).
     */
    public void addFilesets(FileSet fs) {
        fileSets.add(fs);
    }

StackTrace upon failure:

file:C:/Projects/SFProjectManager/scripts.xml:59: The <filelist> data type
doesn't support the nested fileset" element. 	
at
org.apache.tools.ant.IntrospectionHelper.createElement(IntrospectionHelper.j
ava:549) 	
at
org.apache.tools.ant.helper.ProjectHelperImpl$NestedElementHandler.init(Proj
ectHelperImpl.java:960) 	
at
org.apache.tools.ant.helper.ProjectHelperImpl$DataTypeHandler.startElement(P
rojectHelperImpl.java:1137) 	
at
org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.j
ava:415) 	
at
org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.ja
va:571) 	
at
org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java
:756) 	
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDo
cumentFragmentScannerImpl.java:752) 	
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(XMLDocumentFragmentScannerImpl.java:1453) 	
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocume
ntFragmentScannerImpl.java:333) 	
at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:524)

at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:580)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152) 	
at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:116
9) 	
at
org.apache.tools.ant.helper.ProjectHelperImpl.parse(ProjectHelperImpl.java:1
55) 	at
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:117)

at
com.sssw.foundry.managment.util.RemoteAntInvoker.runAntTarget(RemoteAntInvok
er.java:37) 	
at com.sssw.foundry.managment.Test.main(Test.java:13)

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


Mime
View raw message