Announcement Announcement Module
Collapse
No announcement yet.
STS 2.2.0 isn't configuring grails plugins in classpath Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • STS 2.2.0 isn't configuring grails plugins in classpath

    Hello,

    I've just download STS 2.2.0 and I'm trying to make my mavenized Grails project to work with, I've already installed groovy and grails support. And did this:
    1. Import my multi-module maven project, which has a grails project;
    2. Right click on grails module and select Configure / Convert to Grails
    3. Open the modue's Properties / Java Build Path / Source and select all the folder that I use for source, e.g: grails-app/service

    Now STS knows where are my sources and tried to compile it but there a re errors on the source files because STS isn't finding the plugins.

    I read in this post that the plugin configuration should be automatic.

    How could I configure it manually?

    Regards,
    Felipe Cypriano

  • #2
    I'm also having the same problem (vanilla grails project, no maven).

    I had to add the class folder 'project/lib' to the build path which solved libs within my grails project but still getting errors when referencing libs from within plugins.

    Comment


    • #3
      Hi,

      there are two things that might help to solve the problem:

      * Configure your Grails installation from Preferences -> Groovy -> Grails (add at least one installation)
      * Refresh the dependencies from the project context menu Grails Tools -> Refresh Dependencies

      See http://www.grails.org/STS+Integration for more details.

      Christian

      Comment


      • #4
        Originally posted by Christian Dupuis View Post
        Hi,

        there are two things that might help to solve the problem:

        * Configure your Grails installation from Preferences -> Groovy -> Grails (add at least one installation)
        * Refresh the dependencies from the project context menu Grails Tools -> Refresh Dependencies

        See http://www.grails.org/STS+Integration for more details.

        Christian
        Hi Christian,

        I did all this and didn't solve. The thing is when I set the my folders where the code files are as source folders in Properties / Java Build Path, just after this configuration my files start to get the errors.

        Steps:
        1. Import the main POM, grails app is one subproject
        2. Right click on the grails module, Configure / Convert to Grails
        3. Right click on the grails module again and Grails Tools / Refresh Dependencies
        4. So far so good, if I open a file no error is shown (see first screenshot)
        5. Now I right click on grails module again select Properties, on the left side Java Build Path, back to the right side Source tab
          1. Add grails-app/controllers
          2. Add grails-app/services
          3. Add src/java
          4. Add src/groovy
        6. Now I get errors on the import of plugins (see the second screenshot)

        What am I missing? If you need more information please just ask.


        Regards,
        Felipe Cypriano

        Comment


        • #5
          I got dependencies working after I removed the project from the current workspace and imported it back again. Before doing this I was receiving strange error messages:
          An internal error occurred during: "Updating source folders on project 'P/myproject'".
          java.lang.IllegalArgumentException: Element not found: /.org.eclipse.jdt.core.external.folders/.link1/projects/myproject/plugins/tomcat-1.2-M3/src/groovy.

          Comment


          • #6
            Reimport the project didn't work for me, I tried this just after Christian's reply.

            Comment


            • #7
              Originally posted by Christian Dupuis View Post
              Hi,

              there are two things that might help to solve the problem:

              * Configure your Grails installation from Preferences -> Groovy -> Grails (add at least one installation)
              * Refresh the dependencies from the project context menu Grails Tools -> Refresh Dependencies

              See http://www.grails.org/STS+Integration for more details.

              Christian
              Thanks for this. I just added a grails instalation 'C:\grails-1.1.1' and now when I 'Refresh Dependencies' or start sts I get the below error.

              I've also tried the deleting / reimporting project.

              Code:
              java.lang.NoClassDefFoundError: com/springsource/sts/grails/core/model/GrailsBuildSettings
              Caused by: java.lang.ClassNotFoundException: com.springsource.sts.grails.core.model.GrailsBuildSettings
              	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
              	at java.security.AccessController.doPrivileged(Native Method)
              	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
              	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
              	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
              	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
              	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

              Comment


              • #8
                ajevans85,

                That is a strange error as it indicates that there is something wrong with your STS install. Or did you install STS into a path which names has spaces? If so, can you install it into a path without spaces and retry.

                Let me know what you find out.

                Christian

                Comment


                • #9
                  Ok I have gotten a little further.

                  The default location for STS on my system was 'C:\Program Files (x86)\springsource' . I have now re-installed to 'C:\springsource' .

                  Next I needed to add 'http://dist.springsource.org/milestone/GRECLIPSE/e3.5/' to my updates list as the old url is nolonger valid so couldn't install groovy. Adding this new url allowed me to install groovy / grails support.

                  I then imported a project and most of the dependinces where resolved except for two import statements importing from plugins. This is better than last time as I now have 6 reported errors instead of 140.

                  I think Vista may be doing it's usual (not working) thing as checking the logs their is a error that STS can't open the IAC config file, not sure what this is?

                  See attached error log

                  Comment


                  • #10
                    ajevans85,

                    can you provide more details about those 6 errors (2 missing imports)? What plugins do these imports belong to? Can you create a small sample project that shows this error. With the sample I could take a quick look and check what is wrong.

                    You can safely ignore the IAC file error. That is coming from profiling infrastructure in Eclipse.

                    Christian

                    Comment


                    • #11
                      Spaces in install path

                      I had the errors about "could not find the main class com.springsource.sts.grails.core.model..." and moving STS to a place with no spaces in the path fixed it. Thanks for the tip.

                      Please can you update http://www.grails.org/STS+Integration (unless this fact is already documented somewhere?). Otherwise how is anyone supposed to know? Paths with spaces are not exactly a new OS feature so I just assumed it would work without thinking about it.

                      Comment


                      • #12
                        fletchgqc,

                        I consider this to be a bug that needs fixing. I will fix this asap and make sure that we publish an updated build.

                        Christian

                        Comment


                        • #13
                          Attached is a sample project which uses the FilterPane plugin. In my project I create a 'MyService' service and add a import 'import com.zeddware.grails.plugins.filterpane.*' which gives the error 'The import com.zeddware cannot be resolved.

                          Hope this helps

                          Comment


                          • #14
                            Forgot the file, looks to big to upload here. I think the above description should be enough?

                            Comment


                            • #15
                              I got the same problem and had to create a new workspace once I'd moved springsource from program files before it worked, but all good now.


                              Originally posted by ajevans85 View Post
                              Thanks for this. I just added a grails instalation 'C:\grails-1.1.1' and now when I 'Refresh Dependencies' or start sts I get the below error.

                              I've also tried the deleting / reimporting project.

                              Code:
                              java.lang.NoClassDefFoundError: com/springsource/sts/grails/core/model/GrailsBuildSettings
                              Caused by: java.lang.ClassNotFoundException: com.springsource.sts.grails.core.model.GrailsBuildSettings
                              	at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
                              	at java.security.AccessController.doPrivileged(Native Method)
                              	at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
                              	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                              	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                              	at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                              	at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)

                              Comment

                              Working...
                              X