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: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to