You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2005/08/01 07:42:32 UTC

DO NOT REPLY [Bug 35958] New: - Multiple taskdefs causes ClassCastException

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=35958>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=35958

           Summary: Multiple taskdefs causes ClassCastException
           Product: Commons
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: VFS
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: andrew.newman@suncorp.com.au


If you have defined your tasks as such:
    <taskdef name="v-mkdir" classname="org.apache.commons.vfs.tasks.MkdirTask"
classpathref="vfs-classpath" />
    <taskdef name="v-copy" classname="org.apache.commons.vfs.tasks.CopyTask"
classpathref="vfs-classpath"/>

Then in a task use them:
<v-mkdir dir="..."/>
<v-copy destdir="...">
  <src file="..."/>
</v-copy>

You get the following exception:
v-copy
..\build.xml:xx: null
	at org.apache.commons.vfs.tasks.AbstractSyncTask.execute(AbstractSyncTask.java:196)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
	at org.apache.tools.ant.Task.perform(Task.java:364)
	at org.apache.tools.ant.Target.execute(Target.java:341)
	at org.apache.tools.ant.Target.performTasks(Target.java:369)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1214)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1062)
	at org.apache.tools.ant.Main.runBuild(Main.java:673)
	at org.apache.tools.ant.Main.startAnt(Main.java:188)
	at org.apache.tools.ant.Main.start(Main.java:151)
	at org.apache.tools.ant.Main.main(Main.java:241)
	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:324)
	at com.intellij.rt.ant.execution.AntMain2.main(AntMain2.java:13)
Caused by: java.lang.ClassCastException
	at org.apache.commons.vfs.tasks.VfsTask.resolveFile(VfsTask.java:64)
	at
org.apache.commons.vfs.tasks.AbstractSyncTask.handleFiles(AbstractSyncTask.java:206)
	at org.apache.commons.vfs.tasks.AbstractSyncTask.execute(AbstractSyncTask.java:187)
	... 15 more

The alternative, if you call it that, is to use (as given on the web site):
<taskdef resource="org/apache/commons/vfs/tasks/tasks.properties"
classpathref="vfs-classpath"/>

I would expect that the Ant tasks would work either way.

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

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