Announcement Announcement Module
Collapse
No announcement yet.
Need Help With STS Error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need Help With STS Error

    Hi Everyone,

    I got this weird environment error and I was wondering if anyone else ran into it.
    It will not compile but it did work before. I have tried everything. Re-installing everything from scratch but no luck.
    What can cause this? Is there a way to fix it? Thanks in advance for your help.

    Code:
    General error during semantic analysis: String index out of range: -1 java.lang.StringIndexOutOfBoundsException: String index out of range: -1 at 
     java.lang.String.substring(Unknown Source) at java.lang.String.substring(Unknown Source) at 
     org.codehaus.groovy.runtime.MetaClassHelper.capitalize(MetaClassHelper.java:453) at 
     org.codehaus.groovy.control.StaticImportVisitor.getAccessorName(StaticImportVisitor.java:515) at 
     org.codehaus.groovy.control.StaticImportVisitor.findStaticPropertyAccessor(StaticImportVisitor.java:524) at 
     org.codehaus.groovy.control.StaticImportVisitor.findStaticPropertyAccessorGivenArgs(StaticImportVisitor.java:520) at 
     org.codehaus.groovy.control.StaticImportVisitor.findStaticMethodImportFromModule(StaticImportVisitor.java:490) at 
     org.codehaus.groovy.control.StaticImportVisitor.transformPropertyExpression(StaticImportVisitor.java:345) at 
     org.codehaus.groovy.control.StaticImportVisitor.transform(StaticImportVisitor.java:81) at 
     org.codehaus.groovy.control.StaticImportVisitor.transformBinaryExpression(StaticImportVisitor.java:149) at 
     org.codehaus.groovy.control.StaticImportVisitor.transform(StaticImportVisitor.java:78) at 
     org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitExpressionStatement(ClassCodeExpressionTransformer.java:139) at 
     org.codehaus.groovy.ast.stmt.ExpressionStatement.visit(ExpressionStatement.java:40) 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.ClassCodeExpressionTransformer.visitIfElse(ClassCodeExpressionTransformer.java:79) at 
     org.codehaus.groovy.ast.stmt.IfStatement.visit(IfStatement.java:41) at 
     org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitIfElse(ClassCodeExpressionTransformer.java:80) 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.visitTryCatchFinally(CodeVisitorSupport.java:82) 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.ClassCodeVisitorSupport.visitClassCodeContainer(ClassCodeVisitorSupport.java:102) at 
     org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:113) at 
     org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:50) at 
     org.codehaus.groovy.control.StaticImportVisitor.visitConstructorOrMethod(StaticImportVisitor.java:60) at 
     org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:124) at 
     org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1157) at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:
     51) at org.codehaus.groovy.control.StaticImportVisitor.visitClass(StaticImportVisitor.java:54) at org.codehaus.groovy.control.CompilationUnit
     $2.call(CompilationUnit.java:701) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1147) at 
     org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:585) at 
     org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:563) at 
     org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:540) at 
     org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.processToPhase(GroovyCompilationUnitDeclaration.java:168) at 
     org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.resolve(GroovyCompilationUnitDeclaration.java:1959) at 
     org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:820) at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:137) at 
     java.lang.Thread.run(Unknown Source)

  • #2
    Looks like Groovy doesn't like one of your static imports. Can you share the code? Also, does this compile on the command line?

    Comment


    • #3
      Thanks Andrew,

      It was the static imports. Once the static import was removed, it compiled correctly.
      Is this a known groovy issue with static import? Thanks again.

      Hai

      Comment


      • #4
        This looks like a bug to me. Static imports should not throw that kind of exception. Can you share the code? Or at least the static import that is giving you trouble?

        Also, does it compile on the command line?

        Comment


        • #5
          The static imports are

          Code:
          import grails.converters.*
          import groovyx.net.http.*
          import static groovyx.net.http.ContentType.*
          import static groovyx.net.http.Method.*
          
          import java.security.KeyStore
          import org.apache.http.conn.scheme.Scheme
          import org.apache.http.conn.ssl.AllowAllHostnameVerifier;
          import org.apache.http.conn.ssl.SSLSocketFactory
          It did not compile on the command line.
          Oddly it complaint about it in a different groovy class and not where the static imports exist.

          Hai

          Comment

          Working...
          X