Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 11313 invoked from network); 10 Apr 2002 06:28:30 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 10 Apr 2002 06:28:30 -0000 Received: (qmail 18460 invoked by uid 97); 10 Apr 2002 06:28:39 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 18435 invoked by uid 97); 10 Apr 2002 06:28:39 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 18422 invoked by uid 50); 10 Apr 2002 06:28:38 -0000 Date: 10 Apr 2002 06:28:38 -0000 Message-ID: <20020410062838.18421.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: ant-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 7906] New: - Path tag failes when Ant is started from Together 6.0 Antrunner X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7906 Path tag failes when Ant is started from Together 6.0 Antrunner Summary: Path tag failes when Ant is started from Together 6.0 Antrunner Product: Ant Version: 1.4.1 Platform: PC OS/Version: Windows NT/2K Status: NEW Severity: Normal Priority: Other Component: Other AssignedTo: ant-dev@jakarta.apache.org ReportedBy: mei@isogmbh.de CC: mei@isogmbh.de Overview Description: When the path tag is used in an ant build file and ant is started from the Together 6.0 Antrunner plugin, Ant throws a NoSuchMethodException in org.apache.tools.ant.Project -> public Object createDataType(String typeName). This problem does not appear with Together versions prior to 6.0. Steps to Reproduce: 1) Create a simple build.xml which contains a path tag below the project tag. 2) Activate Antrunner in Together 6.0. 3) Run a target of the build file from within Together with -v flag of ant. Additional Information: The Together 6.0 antrunner uses its own Project class which is derived from org.apache.tools.ant.Project. The createDataType method in org.apache.tools.ant.Project searches for a constructor of the datatype (reproducable with Path, may also appear with other datatypes), e.g. Path(Project prj) by using reflection. Because the Together plugin uses a derived Project class, the line ctor = c.getConstructor(new Class[] {getClass()}); searches for a constructor Path(TgProject.class) which is not available. Workaround: replace ctor = c.getConstructor(new Class[] {getClass()}); with ctor = c.getConstructor(new Class[] {Project.class}); Full createDataType() method which resolved the problem: public Object createDataType(String typeName) throws BuildException { Class c = (Class) dataClassDefinitions.get(typeName); if (c == null) return null; try { java.lang.reflect.Constructor ctor = null; boolean noArg = false; // DataType can have a "no arg" constructor or take a single // Project argument. try { ctor = c.getConstructor(new Class[0]); noArg = true; } catch (NoSuchMethodException nse) { // BEGIN MEI 09.04.2002 resolves Problem with ant runner in Together 6.0 (they use a derived Project class !) // ctor = c.getConstructor(new Class[] {getClass()}); ctor = c.getConstructor(new Class[] {Project.class}); // END MEI 09.04.2002 resolves Problem with ant runner in Together 6.0 (they use a derived Project class !) noArg = false; } Object o = null; if (noArg) { o = ctor.newInstance(new Object[0]); } else { o = ctor.newInstance(new Object[] {this}); } if (o instanceof ProjectComponent) { ((ProjectComponent)o).setProject(this); } String msg = " +DataType: " + typeName; log (msg, MSG_DEBUG); return o; } catch (java.lang.reflect.InvocationTargetException ite) { Throwable t = ite.getTargetException(); String msg = "Could not create datatype of type: " + typeName + " due to " + t; throw new BuildException(msg, t); } catch (Throwable t) { String msg = "Could not create datatype of type: " + typeName + " due to " + t; throw new BuildException(msg, t); } finally { log ("<<< createDataType", MSG_DEBUG); } } -- To unsubscribe, e-mail: For additional commands, e-mail: