Bug 34676 - Custom type via "antTypes" extension point require default constructor
Summary: Custom type via "antTypes" extension point require default constructor
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Ant-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: readme
Depends on:
Blocks:
 
Reported: 2003-03-11 12:29 EST by Darin Wright CLA
Modified: 2009-08-30 02:20 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Wright CLA 2003-03-11 12:29:09 EST
I created a plugin with a custom ant data-type (taken from the tests - 
AntTestPath). When I ran a script that used the type, I got the following error:

Buildfile: d:\eclipse2.1
\plugins\org.eclipse.ant.tests.core\testscripts\CustomType.xml
BUILD FAILED: 
file:d:/eclipse2.1/plugins/org.eclipse.ant.tests.core/testscripts/CustomType.xml
:3: Could not create datatype of type: anttestpath due to 
java.lang.NoSuchMethodException: <init>
Total time: 221 milliseconds

For some reason, when using the extesion point, we require the type to have a 
default constructor. When using a <typedef> or runtime classpath and type 
preference, the default consturctor is not required.

Not sure why there is a difference
Comment 1 Darin Wright CLA 2003-03-11 12:29:30 EST
Deferred. Not critical.
Comment 2 Darin Swanson CLA 2003-04-02 16:09:36 EST
The only way I could reproduce your problem was to have the types.jar added as 
a runtime library in the plugin.xml of the plugin:
<runtime>
  <library name=types.jar"/>
</runtime>

This causes the type to be loaded by the plugin classloader instead of the Ant 
classloader. This should be another README entry.

Can you verify that this is what you were doing Darin?
Comment 3 Darin Swanson CLA 2003-04-08 17:47:44 EDT
<<ping>> Have you had a chance to look at this Darin?
Comment 4 Darin Wright CLA 2003-04-14 11:43:21 EDT
<<pong>> I'll look at this today
Comment 5 Darin Wright CLA 2003-04-14 13:57:01 EDT
Yes - when I have the type in a jar that is not part of the plug-in, it works 
as expected. How do you want to mark this one?
Comment 6 Darin Swanson CLA 2003-04-14 14:03:42 EDT
Falls under the known issues section of the currnet Eclipse release notes.
See "Custom Ant tasks and Ant types must be separate from plug-in library JARs
Closing.
Comment 7 Denis Roy CLA 2009-08-30 02:20:18 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.