STS中Grails的classpath容器

时间:2012-12-27 16:28:29

标签: eclipse grails build-dependencies spring-tool-suite

我在Grails依赖项上遇到STS问题。有一个条目,指向错误的目录。由于错误,内部STS构建失败:

Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".

  java.lang.NullPointerException
    at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNodeBuilder.toRawType(JDTClassNodeBuilder.java:116)
    at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNodeBuilder.configureParameterizedType(JDTClassNodeBuilder.java:290)
    at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNodeBuilder.configureType(JDTClassNodeBuilder.java:56)
    at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNodeBuilder.build(JDTClassNodeBuilder.java:46)
    at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.makeClassNode(JDTClassNode.java:399)
    at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.makeParameter(JDTClassNode.java:379)
    at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.makeParameters(JDTClassNode.java:366)
    at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.methodBindingToMethodNode(JDTClassNode.java:339)
    at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.initializeMembers(JDTClassNode.java:256)
    at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.initialize(JDTClassNode.java:227)
    at org.codehaus.jdt.groovy.internal.compiler.ast.JDTClassNode.lazyClassInit(JDTClassNode.java:158)
    at org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass(ClassNode.java:1087)
    at org.codehaus.groovy.ast.ClassNode.getUnresolvedSuperClass(ClassNode.java:1079)
    at org.codehaus.groovy.ast.ClassNode.getSuperClass(ClassNode.java:1073)
    at org.codehaus.groovy.ast.ClassNode.isDerivedFrom(ClassNode.java:1013)
    at org.codehaus.groovy.classgen.ClassCompletionVerifier.visitCatchStatement(ClassCompletionVerifier.java:448)
    at org.codehaus.groovy.ast.stmt.CatchStatement.visit(CatchStatement.java:41)
    at org.codehaus.groovy.ast.CodeVisitorSupport.visitTryCatchFinally(CodeVisitorSupport.java:84)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitTryCatchFinally(ClassCodeVisitorSupport.java:244)
    at org.codehaus.groovy.ast.stmt.TryCatchStatement.visit(TryCatchStatement.java:42)
    at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:179)
    at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
    at org.codehaus.groovy.ast.CodeVisitorSupport.visitIfElse(CodeVisitorSupport.java:56)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitIfElse(ClassCodeVisitorSupport.java:219)
    at org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:41)
    at org.codehaus.groovy.ast.CodeVisitorSupport.visitBlockStatement(CodeVisitorSupport.java:35)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitBlockStatement(ClassCodeVisitorSupport.java:179)
    at org.codehaus.groovy.ast.stmt.BlockStatement.visit(BlockStatement.java:69)
    at org.codehaus.groovy.ast.CodeVisitorSupport.visitClosureExpression(CodeVisitorSupport.java:174)
    at org.codehaus.groovy.ast.expr.ClosureExpression.visit(ClosureExpression.java:45)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitProperty(ClassCodeVisitorSupport.java:142)
    at org.codehaus.groovy.classgen.ClassCompletionVerifier.visitProperty(ClassCompletionVerifier.java:349)
    at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1160)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:51)
    at org.codehaus.groovy.classgen.ClassCompletionVerifier.visitClass(ClassCompletionVerifier.java:74)
    at org.codehaus.groovy.control.CompilationUnit$6.call(CompilationUnit.java:838)
    at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1152)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:588)
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:566)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:543)
    at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.processToPhase(GroovyCompilationUnitDeclaration.java:171)
    at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.generateCode(GroovyCompilationUnitDeclaration.java:1555)
    at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:838)
    at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:137)
    at java.lang.Thread.run(Unknown Source)

Grails命令 run-app 工作正常。

我通过不需要的插件类链接到

来获得此条目
C:\Documents and Settings\<myUserName>\.grails\1.3.7\projects\<ProjectName>\plugin-classes

现在我正在寻找一种删除此条目的方法,但是在Project-&gt; Build Path-&gt;下配置构建路径 - &gt; 删除按钮的库已被禁用。

如果我查看.classpath文件,我会看到以下条目:

<classpathentry kind="con" path="org.grails.ide.eclipse.core.CLASSPATH_CONTAINER"/>

谷歌关于CLASSPATH_CONTAINER失败了。 conf 目录(带有subversion的差异)

中的文件没有变化

我已经尝试过:

  1. 删除.ivy2文件夹
  2. 删除.grails文件夹
  3. grails clean
  4. Grails-&GT;刷新依赖关系
  5. 项目 - &gt;清洁
  6. 删除项目并从SVN导入最新版本
  7. 删除工作区并创建新的
  8. 1..7
  9. 的任意组合

    请帮忙!

2 个答案:

答案 0 :(得分:2)

  1. 删除.ivy2文件夹
  2. 删除.grails文件夹
  3. 删除.m2文件夹
  4. 从application.properties
  5. 中删除所有添加的插件
  6. 从BuildConfig.groovy
  7. 中删除所有添加的插件
  8. 尝试重新启动您的项目 - 现在应该正常工作
  9. 重新安装插件

答案 1 :(得分:2)

以下步骤解决了我的问题:

  1. 删除.grails文件夹
  2. 删除.ivy2文件夹
  3. 删除工作区
  4. 重新安装eclipse(这是缺少的一步)
  5. 列表项
  6. 将项目导入新工作区
  7. 确保没有为此项目升级grails和groovy编译器版本。
  8. 我不确定可以采取哪一步。 拉尔夫,谢谢你的建议。