Announcement Announcement Module
Collapse
No announcement yet.
Cannot install Grails support in STS-2.3.3-M2 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    I was able to do something like what you described, and was able get STS 2.5 to recognize the grails project. Unfortunately, it seems to be unable to compile it -- it complains about not being able to resolve org.hibernate.SessionFactory.

    Code:
    BUG! exception in phase 'semantic analysis' in source unit '/ReBoard-1.2/grails-app/services/ReBoardService.groovy' Pb(324) The type org.hibernate.SessionFactory cannot be resolved. It is indirectly referenced from required .class files
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:944)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:574)
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:550)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:527)
    at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.processToPhase(GroovyCompilationUnitDeclaration.java:163)
    at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitDeclaration.resolve(GroovyCompilationUnitDeclaration.java:1778)
    at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:821)
    at org.eclipse.jdt.internal.core.hierarchy.HierarchyResolver.resolve(HierarchyResolver.java:613)
    at org.eclipse.jdt.internal.core.hierarchy.HierarchyBuilder.buildSupertypes(HierarchyBuilder.java:125)
    at org.eclipse.jdt.internal.core.hierarchy.IndexBasedHierarchyBuilder.build(IndexBasedHierarchyBuilder.java:135)
    at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.compute(TypeHierarchy.java:300)
    at org.eclipse.jdt.internal.core.hierarchy.TypeHierarchy.refresh(TypeHierarchy.java:1263)
    at org.eclipse.jdt.internal.core.CreateTypeHierarchyOperation.executeOperation(CreateTypeHierarchyOperation.java:90)
    at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:728)
    at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:788)
    at org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:726)
    at org.eclipse.jdt.internal.core.SourceType.newSupertypeHierarchy(SourceType.java:678)
    at org.eclipse.jdt.internal.launching.JavaLaunchableTester.hasSuperclass(JavaLaunchableTester.java:470)
    at org.eclipse.jdt.internal.launching.JavaLaunchableTester.test(JavaLaunchableTester.java:613)
    at org.eclipse.core.internal.expressions.Property.test(Property.java:58)
    at org.eclipse.core.internal.expressions.TestExpression.evaluate(TestExpression.java:99)
    at org.eclipse.core.internal.expressions.CompositeExpression.evaluateOr(CompositeExpression.java:68)
    at org.eclipse.core.internal.expressions.OrExpression.evaluate(OrExpression.java:21)
    at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
    at org.eclipse.core.internal.expressions.AndExpression.evaluate(AndExpression.java:29)
    at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
    at org.eclipse.core.internal.expressions.IterateExpression.evaluate(IterateExpression.java:150)
    at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
    at org.eclipse.core.internal.expressions.WithExpression.evaluate(WithExpression.java:72)
    at org.eclipse.core.internal.expressions.CompositeExpression.evaluateAnd(CompositeExpression.java:53)
    at org.eclipse.core.internal.expressions.EnablementExpression.evaluate(EnablementExpression.java:53)
    at org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension.evalEnablementExpression(LaunchShortcutExtension.java:287)
    at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager.getShortcutsForSelection(LaunchingResourceManager.java:452)
    at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager.computeLabels(LaunchingResourceManager.java:237)
    at org.eclipse.debug.internal.ui.contextlaunching.LaunchingResourceManager$2.run(LaunchingResourceManager.java:138)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
    Caused by: org.eclipse.jdt.internal.compiler.problem.AbortCompilation: Pb(324) The type org.hibernate.SessionFactory cannot be resolved. It is indirectly referenced from required .class files
    at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:121)
    at org.eclipse.jdt.internal.compiler.problem.ProblemHandler.handle(ProblemHandler.java:179)
    at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.handle(ProblemReporter.java:1991)
    at org.eclipse.jdt.internal.compiler.problem.ProblemReporter.isClassPathCorrect(ProblemReporter.java:3910)
    at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:54)
    at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:126)
    at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:168)
    at org.eclipse.jdt.internal.compiler.lookup.Scope.getType(Scope.java:2413)
    at org.codehaus.jdt.groovy.internal.compiler.ast.GroovyCompilationUnitScope.lookupClassNodeForSource(GroovyCompilationUnitScope.java:172)
    at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.resolveFromCompileUnit(JDTResolver.java:144)
    at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:278)
    at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.resolve(JDTResolver.java:259)
    at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1267)
    at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:150)
    at org.codehaus.jdt.groovy.internal.compiler.ast.JDTResolver.startResolving(JDTResolver.java:577)
    at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:680)
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:935)
    ... 35 more
    If I run this project from the command line, it works.

    Gene

    Comment


    • #17
      It is a possibility that the grails version being used by your project in Eclipse is not the version being used on the command line. In your project properties, can you check what version is being referenced?

      Comment


      • #18
        I am running 1.3.4 for both.

        Comment


        • #19
          By the looks of things, your dependencies aren't being computed properly. org.hibernate.SessionFactory should be coming from the hibernate-core-3.3.1.GA.jar, which should be on your Grails Dependencies path. Do you see that jar or that class file?

          Comment


          • #20
            Looks like that's a problem -- I am not seeing any of the hibernate jars in the build path/libraries dialog. Is there a principled way of getting them referenced? Or should I just manually add the jars to the Grails Dependencies library?

            Thanks,

            Gene

            Comment


            • #21
              You should not try manually adding them. There may be other jars that your project requires, but aren't on the path.

              You've run update dependencies and this doesn't help?

              Can you run it again and look in your error log?

              Comment


              • #22
                sorry: my mental model of how all this works isn't up to snuff. How do I update dependencies?

                Comment


                • #23
                  Well, I think I figured it out: I told Maven to update dependencies automatically (through the dependencies tab of the properties dialog), then restarted the IDE, and then did an update.

                  Thanks for your help,

                  Gene

                  Comment


                  • #24
                    Glad that worked. You could also have updated the dependencies on your grails project.

                    Right click on the project -> Grails tools -> Refresh Dependencies

                    Comment

                    Working...
                    X