Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3422864
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:17:32+00:00 2026-05-18T06:17:32+00:00

I have an relatively old Grails app that uses ant to build the application.

  • 0

I have an relatively old Grails app that uses ant to build the application. In the test server it build without any problems, but when I try to run it on my PC, I get a consistent error:

Caused by: jar:file:/C:/ant/apache-ant-1.8.0/lib/ant.jar!/org/apache/tools/ant/antlib.xml:37: Problem: failed to create task or type componentdef
    Cause: The name is undefined.
    Action: Check the spelling.
    Action: Check that any custom tasks/types have been declared.
    Action: Check that any <presetdef>/<macrodef> declarations have taken place.
    at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:484)
        at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:416)
        at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160)
        at org.apache.tools.ant.taskdefs.Antlib.execute(Antlib.java:146)
        at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:432)
        ... 63 more

I have found that the error happens in the following part of the build:

<macrodef name="grails">
    <attribute name="script"/>
    <attribute name="args" default="" />
    <sequential>
        <grailsTask script="@{script}" args="@{args}" classpathref="grails.classpath">
            <compileClasspath refid="compile.classpath"/>
            <testClasspath refid="test.classpath"/>
            <runtimeClasspath refid="app.classpath"/>
        </grailsTask>
    </sequential>
</macrodef>

If I comment out , there are no more errors.

For further refererence, here’s the whole error dump:

G:\chp\src\hewittportlet\build.xml:131: The following error occurred while executing this line:
G:\chp\src\hewittportlet\build.xml:53: Unable to start Grails: java.lang.reflect.InvocationTargetExc
eption
        at grails.ant.GrailsTask.runGrails(GrailsTask.java:124)
        at grails.ant.GrailsTask.execute(GrailsTask.java:78)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1360)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1329)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1212)
        at org.apache.tools.ant.Main.runBuild(Main.java:801)
        at org.apache.tools.ant.Main.startAnt(Main.java:218)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at org.codehaus.groovy.grails.cli.support.GrailsBuildHelper.execute(GrailsBuildHelper.java:9
4)
        at grails.ant.GrailsTask.runGrails(GrailsTask.java:113)
        ... 31 more
Caused by: java.lang.reflect.InvocationTargetException
        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:597)
        at org.codehaus.groovy.grails.cli.support.GrailsBuildHelper.execute(GrailsBuildHelper.java:8
8)
        ... 32 more
Caused by: The following error occurred while executing this line:
jar:file:/C:/ant/apache-ant-1.8.0/lib/ant.jar!/org/apache/tools/ant/antlib.xml:37: Problem: failed t
o create task or type componentdef
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

        at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508)
        at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:434)
        at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:281)
        at org.apache.tools.ant.ComponentHelper.checkNamespace(ComponentHelper.java:790)
        at org.apache.tools.ant.ComponentHelper.getDefinition(ComponentHelper.java:260)
        at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:237)
        at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:216)
        at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:414)
        at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160)
        at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:186)
        at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
        at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:154)
        at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
        at org.codehaus.gant.GantBuilder.invokeMethod(GantBuilder.java:89)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at org.codehaus.gant.GantBinding.initializeGantBinding(GantBinding.groovy:109)
        at org.codehaus.gant.GantBinding.this$4$initializeGantBinding(GantBinding.groovy)
        at org.codehaus.gant.GantBinding$this$4$initializeGantBinding.callCurrent(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:
44)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:1
43)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:1
47)
        at org.codehaus.gant.GantBinding.<init>(GantBinding.groovy:42)
        at org.codehaus.groovy.grails.cli.GrailsScriptRunner.callPluginOrGrailsScript(GrailsScriptRu
nner.java:355)
        at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeCommand(GrailsScriptRunner.java:
279)
        at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeCommand(GrailsScriptRunner.java:
205)
        ... 37 more
Caused by: jar:file:/C:/ant/apache-ant-1.8.0/lib/ant.jar!/org/apache/tools/ant/antlib.xml:37: Proble
m: failed to create task or type componentdef
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

        at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:484)
        at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:416)
        at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160)
        at org.apache.tools.ant.taskdefs.Antlib.execute(Antlib.java:146)
        at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:432)
        ... 63 more

Total time: 34 seconds
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T06:17:32+00:00Added an answer on May 18, 2026 at 6:17 am

    I found the source of the problem.

    The problem was not the version of Ant, but rather the version of Grails and missing scripts. This application was using a deprecated version of Grails (version 1.1.1).

    The following code, which I’m re-listing for everybody’s conveniences, is invoking a script. However, in this particular application, the script had been removed, which caused Grails’ build process to crash:

    <macrodef name="grails">
    <attribute name="script"/>
    <attribute name="args" default="" />
    <sequential>
        <grailsTask script="@{script}" args="@{args}" classpathref="grails.classpath">
            <compileClasspath refid="compile.classpath"/>
            <testClasspath refid="test.classpath"/>
            <runtimeClasspath refid="app.classpath"/>
        </grailsTask>
    </sequential>
    </macrodef>
    

    The solution was simple: to upgrade Grails to a more recent version, such as 1.3.5. The build worked without problems after that, even though some scripts were missing.

    I would speculate that this new behavior allowed to generate scripts during the scaffolding, but at the same time give the freedom to the developer to remove unwanted or unnecessary scripts.

    Thanks to Burth Beckwith for his insights.

    Luis Colorado

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a relatively small app that Im building using vb.net 2.0, and nant.
I help develop a relatively high traffic web application that uses ASP.NET WebForms. Although
I have a windows forms app built with .NET 3.5 and a relatively old
I have a relatively large database tables (just under a million rows) that has
I have a relatively simple application which I need to make native Mac OSX
I have a relatively simple question that I cannot seem to find the answer
I have this relatively simple regex for usernames // Enforce that username has to
I have a relatively simple algorithm that walks an std::vector looking for two neighbouring
We have a considerable code base with relatively high test coverage for pages/forms, all
I have a relatively large set of data that lends itself very naturally to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.