Page 1 of 2 12 LastLast
Results 1 to 10 of 37

Thread: STS 2.2.0 isn't configuring grails plugins in classpath

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Posts
    10

    Thumbs down 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. #2
    Join Date
    Jul 2009
    Posts
    7

    Default

    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.

  3. #3
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    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
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

  4. #4
    Join Date
    Mar 2009
    Posts
    10

    Default

    Quote 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
    Attached Images Attached Images

  5. #5
    Join Date
    Jul 2005
    Location
    Helsinki, Finland
    Posts
    12

    Default

    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.

  6. #6
    Join Date
    Mar 2009
    Posts
    10

    Default

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

  7. #7
    Join Date
    Jul 2005
    Location
    Helsinki, Finland
    Posts
    12

    Default Workaround for "Updating source folders on project 'P/myproject' / Element not found

    Quote Originally Posted by lhotari View Post
    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.
    This time this solution didn't work.

    I tried removing and re-creating the WORKSPACE_DIR/.metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders directory and that worked.

    Code:
    rm -rf .metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders
    mkdir .metadata/.plugins/org.eclipse.core.resources/.projects/.org.eclipse.jdt.core.external.folders
    The directory contained these files before removing:
    Code:
    .location
    .markers.snap
    .syncinfo.snap
    I think that the .location file was corrupted.

    The problem might also be in a corrupted .metadata/.plugins/org.eclipse.jdt.core/.org.eclipse.jdt.core.external.folders/.project file which contains the link information to the grails working directory (~/.grails/1.2.0.RC1 in my case).

  8. #8
    Join Date
    Jul 2009
    Posts
    7

    Default

    Quote 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)

  9. #9
    Join Date
    Aug 2004
    Location
    Duesseldorf, Germany
    Posts
    1,210

    Default

    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
    Christian Dupuis
    SpringSource, a division of VMware
    Lead, SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/cdupuis

  10. #10
    Join Date
    Jul 2009
    Posts
    7

    Default

    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
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •