OSSEZ

 找回密码
 新用户

QQ登录

只需一步,快速开始

扫一扫,访问微社区

OSSEZ 首页 系统默认 - 请不要删除 查看内容

Grails: java.lang.reflect.InvocationTargetException 异常

2011-7-11 20:12| 发布者: honeymoose| 查看: 6597| 评论: 0



在用 Grails 进行编译的时候出现下面的异常:
  1. Unable to start Grails: java.lang.reflect.InvocationTargetException
复制代码
如果你使用的 Ant 是 1.8 版的,你需要将版本回退到 1.7

Grails 目前还不支持 Ant 1.8 版。

根据官方的说明,Grails 目前只支持 1.7 版的 ANT。

请参考 Grail 官方网站的信息:
http://jira.grails.org/browse/GRAILS-6897

错误栈信息如下:
  1. BUILD FAILED
  2. /Users/ildar/tmp/grails-ant-integration/build.xml:125: The following error occurred while executing this line:
  3. /Users/ildar/tmp/grails-ant-integration/build.xml:48: Unable to start Grails: java.lang.reflect.InvocationTargetException
  4. at grails.ant.GrailsTask.runGrails(GrailsTask.java:138)
  5. at grails.ant.GrailsTask.execute(GrailsTask.java:99)
  6. at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
  7. at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
  8. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  9. at java.lang.reflect.Method.invoke(Method.java:597)
  10. at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
  11. at org.apache.tools.ant.Task.perform(Task.java:348)
  12. at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
  13. at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
  14. at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
  15. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  16. at java.lang.reflect.Method.invoke(Method.java:597)
  17. at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
  18. at org.apache.tools.ant.Task.perform(Task.java:348)
  19. at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
  20. at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
  21. at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
  22. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  23. at java.lang.reflect.Method.invoke(Method.java:597)
  24. at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
  25. at org.apache.tools.ant.Task.perform(Task.java:348)
  26. at org.apache.tools.ant.Target.execute(Target.java:390)
  27. at org.apache.tools.ant.Target.performTasks(Target.java:411)
  28. at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
  29. at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
  30. at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
  31. at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
  32. at org.apache.tools.ant.Main.runBuild(Main.java:801)
  33. at org.apache.tools.ant.Main.startAnt(Main.java:218)
  34. at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
  35. at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
  36. Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
  37. at org.codehaus.groovy.grails.cli.support.GrailsBuildHelper.execute(GrailsBuildHelper.java:105)
  38. at grails.ant.GrailsTask.runGrails(GrailsTask.java:127)
  39. ... 31 more
  40. Caused by: java.lang.reflect.InvocationTargetException
  41. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  42. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  43. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  44. at java.lang.reflect.Method.invoke(Method.java:597)
  45. at org.codehaus.groovy.grails.cli.support.GrailsBuildHelper.execute(GrailsBuildHelper.java:99)
  46. ... 32 more
  47. Caused by: : The following error occurred while executing this line:
  48. jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml:37: Problem: failed to create task or type componentdef
  49. Cause: The name is undefined.
  50. Action: Check the spelling.
  51. Action: Check that any custom tasks/types have been declared.
  52. Action: Check that any / declarations have taken place.

  53. at org.apache.tools.ant.ProjectHelper.addLocationToBuildException(ProjectHelper.java:508)
  54. at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:434)
  55. at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:281)
  56. at org.apache.tools.ant.ComponentHelper.checkNamespace(ComponentHelper.java:790)
  57. at org.apache.tools.ant.ComponentHelper.getDefinition(ComponentHelper.java:260)
  58. at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:237)
  59. at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:216)
  60. at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:414)
  61. at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160)
  62. at groovy.util.AntBuilder.performTask(AntBuilder.java:245)
  63. at groovy.util.AntBuilder.nodeCompleted(AntBuilder.java:212)
  64. at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:147)
  65. at groovy.util.AntBuilder.doInvokeMethod(AntBuilder.java:166)
  66. at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64)
  67. at org.codehaus.gant.GantBuilder.invokeMethod(GantBuilder.java:93)
  68. at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:45)
  69. at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
  70. at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
  71. at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
  72. at org.codehaus.gant.GantBinding.initializeGantBinding(GantBinding.groovy:108)
  73. at org.codehaus.gant.GantBinding.this$4$initializeGantBinding(GantBinding.groovy)
  74. at org.codehaus.gant.GantBinding$this$4$initializeGantBinding.callCurrent(Unknown Source)
  75. at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:44)
  76. at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141)
  77. at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:145)
  78. at org.codehaus.gant.GantBinding.(GantBinding.groovy:42)
  79. at org.codehaus.groovy.grails.cli.GrailsScriptRunner.callPluginOrGrailsScript(GrailsScriptRunner.java:436)
  80. at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeCommand(GrailsScriptRunner.java:308)
  81. at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeCommand(GrailsScriptRunner.java:243)
  82. ... 37 more
  83. Caused by: jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/antlib.xml:37: Problem: failed to create task or type componentdef
  84. Cause: The name is undefined.
  85. Action: Check the spelling.
  86. Action: Check that any custom tasks/types have been declared.
  87. Action: Check that any / declarations have taken place.

  88. at org.apache.tools.ant.UnknownElement.getNotFoundException(UnknownElement.java:484)
  89. at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:416)
  90. at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:160)
  91. at org.apache.tools.ant.taskdefs.Antlib.execute(Antlib.java:146)
  92. at org.apache.tools.ant.taskdefs.Definer.loadAntlib(Definer.java:432)
  93. ... 64 more
复制代码

本文内容由 honeymoose 提供

关闭

站长推荐上一条 /1 下一条

QQ|手机版|小黑屋|Archiver|帮助|OSSEZ (North Tecom)  

GMT+8, 2017-5-27 23:37

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

返回顶部