Grails facet gone or broken?

I seem to be having some difficulty with grails modules in the new maia.

IIRC, I could set a grails facet to a module, and now I cannot see how to add it to a project. That would be ok, except that I've tried both creating new, and importing existing grails apps, and I am batting 1-for-5.

I've tried importing my existing grails app, and I get many errors from Idea saying it can't find my classes. Then I look for the grails facet, and I can't find it, nor is grails an option in ctrl-alt-shift-s. I do now see add framework, but only have groovy as an option.

Twice I went through the "File | New Project | ... from scratch | Grails" and it seems to bomb out and fail silently.

Am I missing something obvious here?
Thanks,

Sean
ps: all my other EAP adventures have been quite stable, good work in general on updates and additions : -)

27 comments
Comment actions Permalink

Twice I went through the "File | New Project | ... from scratch | Grails" and it seems to bomb out and fail silently.

That's the correct way. Another one is to create new module (not sure if
it's enabled in the last EAP, but it will be in the next one). Have you
chosen the correct Grails SDK in the wizard? If yes, what do you see
next? IDEA should suggest you to run create-app or create-plugin.

0
Comment actions Permalink

There must be something I'm missing in setting up grails in this release. I have %GRAILS_HOME% set correctly, and JDK_HOME should be good (except it has a space in the path "program files"...)

I no longer see a "grails" facet, only a groovy facet, and that no longer seems to appear for project settings.

After trying the New project | import from existing grails sources, I still have seem to need to "add framework" to the project. There I only see "groovy" (no mention of grails), and dialog box prompts for "settings" not path to grails....

If this the right approach (which from the groovy focus rather grails, I expect it is not correct), then I am stuck with only "src" as a source path, and my grails domain objects are not recognized. I assume the same goes for controllers, services,....

FWIW: I assume there has been a significant change in the grails support, I have gone through this type of process about 6-10 times with various upgrades and bouncing between Vista and Ubuntu. This is the first time I've had difficulty importing my grails project, but then that's the price of bleeding edge/EAP :-).

Any insights or suggestions?
Thanks,

Sean

0
Comment actions Permalink

There was a blog post a little while back about Groovy related changes:  http://blogs.jetbrains.com/idea/2009/09/groovy-related-configuration-changes/

I don't know if that well help you at all but it may give you some insight into what changed.

0
Comment actions Permalink

Sean,

Did you ever get an answer for this?  I have the same issue with the 10781 build.  Creating a grails application from scratch leaves me with an empty java project.  Bummer.  I liked the new "Grails View".  Looks like something broke in this release.

0
Comment actions Permalink

gemini,
     No direct answer. I looked through Russ' suggestion, but nothing popped out at me.

     The best I can offer is that I found that I was having a few possibly (un?)related issues, so I did my best to wipe grails and idea clean and start over.

     I'm running Vista 64bit, and found that the YourKit(?) profiler was causing problems, and followed a lead to remove it from idea.exe.vmoptions, last line:
-agentlib:yjpagent=disablej2ee,disablecounts,disablealloc,sessionname=IntelliJIdea90  // deleted this line
I don't think that is related, but since I can't pin down what changed, thought I'd mention it.

     It's possible there was some cruft hanging around between my intellij (grails) cache and my .grails cache/repository. I believe I deleted both, and my guess is that helped. Along the way, I noticed that if I reselected the gdk "property" (path to grails) I had what seemed to be intermittent success before my clean & reinstall. Perhaps some disconnect between what idea displayed and actually used for grails path? (yes, grasping at straws here...)

     One last note: in my thrashing about, I seemed to get to a point where grails was available, but 'grails run-app' seemed to fail silently, or never get called. I wonder if you could try that from the command line, and see if the grails-goodness then magically works in Idea.
Sorry I can't be more help, but I'd be happy discuss further if you like,

Sean

0
Comment actions Permalink

Sean,

Here is what worked for me...   I used grails 1.2 M3 to create a new project from the command line.  Grails 1.2 creates both Idea and Eclipse project files.  Open the Idea project file and it will be converted into the new format.  What is odd is that the grails view and other functionality work now.  Just the "create new grails project from scratch" functionality is broken.

Hope this helps!

0
Comment actions Permalink

I have a maven based grails project.  In maia 90.116 I too am unable to add a grails module (it is not there to pick from).  Doing the same in 8.3 worked fine and is pretty annoying as I hear it has better groovy support.  There is grails support under run config, but I obviously can't create one because there is no grails module defined.

0
Comment actions Permalink

gemini,
     The approach you mention does seem to work for me. I am guessing there is some hairball in the project builder which silently fails to call the create-app script.
Thanks for the feedback,

Sean

0
Comment actions Permalink

There is no Grails module anymore. Use new module/new project to create
a module with Grails support.

0
Comment actions Permalink

Adding new Grails Application module or project works fine for me. Have
you specified a correct Grails SDK in the wizard?

0
Comment actions Permalink

I have, several times with some variations on how (copy/paste, select, type...)

I does not complain about a bad grails sdk anywhere I can see, it just happily goes about finishing the project. IIRC, I have then gone back to add in grails (which seems to only be referred to as groovy--rather confusion). At that point it asks for a **groovy** sdk, and accepts my grails home dir, and things seem to be back in the realm of function, and I am once again thankful I'm not relying on eclipse or netbeans for grails/groovy support

Sean

0
Comment actions Permalink

What are you doing, could you give more details, step-by-step?

0
Comment actions Permalink

Hi Peter,
     Short answer: I'm doing the same thing I've done about 50 times in Idea over the past 6 months (yes, I've created lots of test apps :-) ).

     I've found my work around (see above), so I am fine with leaving the sitaution as-is until further notice. I have just downloaded the recent EAP, and will try that at some point in the next couple of weeks. With the work-around, and just a couple of people (myself included) having trouble, it seems like putting this issue on freeze until further notice (or more complaints) makes sense.BTW, I am quite happy with idea and its support. It's rather impressive that the only hitch I've come across with these bleeding-edge releases is a minor inconvenience (after finding the work-around) when creating a new project.
Thanks,

Sean

0
Comment actions Permalink

I'm having a problem with Grails support in 9 EAP version (ideaIJ-92.65).

If I create a new Grails app from scratch, I get a /src directory but not /grails-app.  I cannot run "create-app".

If I open a command shell, run "create-app", and create a project over existing Grails sources, I can't create domain, controller, or service components.  If I add a Grails run-time, I can see that it wants to "run-app", but it complains that there isn't a Grails module specified.  The drop down for selecting one is empty.

My 8.1.4 version requires that I open a command shell and run "create-app", but once I do that I have the expected Grails functionality at my disposal.

The Grails stuff has been broken ever since I started using the EAP versions of IntelliJ.  I'd sure like to see them restored and improved.

0
Comment actions Permalink

This problem should be fixed in the upcoming 9.0.1 release

0
Comment actions Permalink

Then what can I do if  my project is Maven Grails project? I cant use IDEA Grails facet now?

0
Comment actions Permalink

There is no Grails facet. You can create a Grails Application IDEA module over your Grails sources, or, actually, the existing module should pick up if it has correct Grails distribution in classpath. If it isn't picked up, please attach the Grails-related jar list from the classpath

0
Comment actions Permalink

I am on 9.0.1 -  build 93.94
grails 1.0.4, 1.1.1 & 1.2.1

I can perfrom:  'create-app' (as part of IDEA Grails project creation), 'create-domain', 'create-controller' etc and the files are created on the filesystem.
But I can not see any of my domains in the Grails view; If I d-click on the folder icon for: Domain class, services or controllers it causes the view to revert to the project view.
I cant see no errors, and I cant do Grails

I've even tried createing andimporting from 1.1.1 and 1.2.1, no joy.



Is there a fix fo this ?

Regards
Wayne

0
Comment actions Permalink

I can perfrom:  'create-app' (as part of IDEA Grails project creation), 'create-domain', 'create-controller' etc and the files are created on the filesystem.
But I can not see any of my domains in the Grails view; If I d-click on the folder icon for: Domain class, services or controllers it causes the view to revert to the project view.
I cant see no errors, and I cant do Grails


The double-click is supposed to do precisely this if you don't have
anything under that node in the tree. So, is it that you have some
Domain classes/Controllers and they are not shown in the Grails view,
while they are in the Project View? Or you just don't have them? Then
you can create them from IDEA by right-clicking on Domain/Controllers
node and selecting 'New | '.

0
Comment actions Permalink

I have created the domains in the IDE (and some externally in the same project) and they exist on the filesystem.done all the sync and stuff...

but... they NEVER appear in the ide.

this is such a retrogradestep Im tempted Im tempted to downgrade to 8.x where it just worked.  shame
.

0
Comment actions Permalink

Are your domain classes under source roots? Could you please post a
screenshot of a project & grails views with them?

0
Comment actions Permalink

Thanks for you help, please find more info below:

Project creation console log:

[/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java, -Xmx256M, -Dgrails.home=/Applications/Alderstone/Common/Grails/grails-1.1.1, -Dbase.dir=/tmp, -Dtools.jar=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/lib/tools.jar, -Dgroovy.starter.conf=/Applications/Alderstone/Common/Grails/grails-1.1.1/conf/groovy-starter.conf, -Dfile.encoding=MacRoman, -classpath, /Applications/Alderstone/Common/Grails/grails-1.1.1/lib/groovy-all-1.6.3.jar:/Applications/Alderstone/Common/Grails/grails-1.1.1/dist/grails-bootstrap-1.1.1.jar, org.codehaus.groovy.grails.cli.support.GrailsStarter, --main, org.codehaus.groovy.grails.cli.GrailsScriptRunner, --conf, /Applications/Alderstone/Common/Grails/grails-1.1.1/conf/groovy-starter.conf, create-app TestProject]
Welcome to Grails 1.1.1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /Applications/Alderstone/Common/Grails/grails-1.1.1

Base Directory: /private/tmp
Running script /Applications/Alderstone/Common/Grails/grails-1.1.1/scripts/CreateApp_.groovy
Environment set to development
    [mkdir] Created dir: /private/tmp/TestProject/src/java
    [mkdir] Created dir: /private/tmp/TestProject/src/groovy
    [mkdir] Created dir: /private/tmp/TestProject/grails-app
    [mkdir] Created dir: /private/tmp/TestProject/grails-app/controllers
    [mkdir] Created dir: /private/tmp/TestProject/grails-app/services
    [mkdir] Created dir: /private/tmp/TestProject/grails-app/domain
    [mkdir] Created dir: /private/tmp/TestProject/grails-app/taglib
    [mkdir] Created dir: /private/tmp/TestProject/grails-app/utils
    [mkdir] Created dir: /private/tmp/TestProject/grails-app/views
    [mkdir] Created dir: /private/tmp/TestProject/grails-app/views/layouts
    [mkdir] Created dir: /private/tmp/TestProject/grails-app/i18n
    [mkdir] Created dir: /private/tmp/TestProject/grails-app/conf
    [mkdir] Created dir: /private/tmp/TestProject/test
    [mkdir] Created dir: /private/tmp/TestProject/test/unit
    [mkdir] Created dir: /private/tmp/TestProject/test/integration
    [mkdir] Created dir: /private/tmp/TestProject/scripts
    [mkdir] Created dir: /private/tmp/TestProject/web-app
    [mkdir] Created dir: /private/tmp/TestProject/web-app/js
    [mkdir] Created dir: /private/tmp/TestProject/web-app/css
    [mkdir] Created dir: /private/tmp/TestProject/web-app/images
    [mkdir] Created dir: /private/tmp/TestProject/web-app/META-INF
    [mkdir] Created dir: /private/tmp/TestProject/lib
    [mkdir] Created dir: /private/tmp/TestProject/grails-app/conf/spring
    [mkdir] Created dir: /private/tmp/TestProject/grails-app/conf/hibernate
[propertyfile] Creating new property file: /private/tmp/TestProject/application.properties
     [copy] Copying 1 resource to /private/tmp/TestProject
    [unjar] Expanding: /private/tmp/TestProject/grails-shared-files.jar into /private/tmp/TestProject
   [delete] Deleting: /private/tmp/TestProject/grails-shared-files.jar
     [copy] Copying 1 resource to /private/tmp/TestProject
    [unjar] Expanding: /private/tmp/TestProject/grails-app-files.jar into /private/tmp/TestProject
   [delete] Deleting: /private/tmp/TestProject/grails-app-files.jar
     [move] Moving 1 file to /private/tmp/TestProject
     [move] Moving 1 file to /private/tmp/TestProject
     [move] Moving 1 file to /private/tmp/TestProject
Installing plug-in hibernate-1.1.1
    [mkdir] Created dir: /Users/wayne/.grails/1.1.1/projects/TestProject/plugins/hibernate-1.1.1
    [unzip] Expanding: /Users/wayne/.grails/1.1.1/plugins/grails-hibernate-1.1.1.zip into /Users/wayne/.grails/1.1.1/projects/TestProject/plugins/hibernate-1.1.1
Executing hibernate-1.1.1 plugin post-install script ...
Plugin hibernate-1.1.1 installed
Created Grails Application at /private/tmp/TestProject



Domain Class creation console log:

[/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java, -Xmx256M, -Dgrails.home=/Applications/Alderstone/Common/Grails/grails-1.1.1, -Dbase.dir=/tmp/TestProject, -Dtools.jar=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/lib/tools.jar, -Dgroovy.starter.conf=/Applications/Alderstone/Common/Grails/grails-1.1.1/conf/groovy-starter.conf, -Dfile.encoding=MacRoman, -classpath, /Applications/Alderstone/Common/Grails/grails-1.1.1/lib/groovy-all-1.6.3.jar:/Applications/Alderstone/Common/Grails/grails-1.1.1/dist/grails-bootstrap-1.1.1.jar, org.codehaus.groovy.grails.cli.support.GrailsStarter, --main, org.codehaus.groovy.grails.cli.GrailsScriptRunner, --conf, /Applications/Alderstone/Common/Grails/grails-1.1.1/conf/groovy-starter.conf, create-domain-class com.example.myDomain]
Welcome to Grails 1.1.1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /Applications/Alderstone/Common/Grails/grails-1.1.1

Base Directory: /private/tmp/TestProject
Running script /Applications/Alderstone/Common/Grails/grails-1.1.1/scripts/CreateDomainClass.groovy
Environment set to development
    [mkdir] Created dir: /private/tmp/TestProject/grails-app/domain/com/example
Created DomainClass for MyDomain
    [mkdir] Created dir: /private/tmp/TestProject/test/unit/com/example
Created Tests for MyDomain

Screenshot after syncronise on project root and IDE restart:

Screen shot 2010-03-10 at 08.53.48.png

if I double click on Domain Classes I get dumped in the project view, which also can not see the domain classes:
Screen shot 2010-03-10 at 09.00.18.png
  (that also happens with controllers and services)



find grails-app/
grails-app/
grails-app//conf
grails-app//conf/BootStrap.groovy
grails-app//conf/Config.groovy
grails-app//conf/DataSource.groovy
grails-app//conf/hibernate
grails-app//conf/spring
grails-app//conf/spring/resources.groovy
grails-app//conf/UrlMappings.groovy
grails-app//controllers
grails-app//domain
grails-app//domain/com
grails-app//domain/com/example
grails-app//domain/com/example/MyDomain.groovy
grails-app//i18n
grails-app//i18n/messages.properties
grails-app//i18n/messages_de.properties
grails-app//i18n/messages_es.properties
grails-app//i18n/messages_fr.properties
grails-app//i18n/messages_it.properties
grails-app//i18n/messages_ja.properties
grails-app//i18n/messages_nl.properties
grails-app//i18n/messages_pt_BR.properties
grails-app//i18n/messages_ru.properties
grails-app//i18n/messages_th.properties
grails-app//i18n/messages_zh_CN.properties
grails-app//services
grails-app//taglib
grails-app//utils
grails-app//views
grails-app//views/error.gsp
grails-app//views/index.gsp
grails-app//views/layouts
grails-app//views/layouts/main.gsp

0
Comment actions Permalink

I found this in the (MacOS X) Console log:

10/03/2010 08:52:50    [0x0-0x6f06f0].com.jetbrains.intellij[10701]    [183057534]   WARN - .history.utils.LocalHistoryLog -
10/03/2010 08:52:50    [0x0-0x6f06f0].com.jetbrains.intellij[10701]    has entry for file: false
10/03/2010 08:52:50    [0x0-0x6f06f0].com.jetbrains.intellij[10701]    file is not valid: /tmp/TestProject/TestProject-grailsPlugins.iml
10/03/2010 08:52:50    [0x0-0x6f06f0].com.jetbrains.intellij[10701]    first valid parent: /tmp/TestProject
10/03/2010 08:52:51    [0x0-0x6f06f0].com.jetbrains.intellij[10701]    [183057668]   WARN - .history.utils.LocalHistoryLog -
10/03/2010 08:52:51    [0x0-0x6f06f0].com.jetbrains.intellij[10701]    has entry for file: false
10/03/2010 08:52:51    [0x0-0x6f06f0].com.jetbrains.intellij[10701]    file is not valid: /tmp/TestProject/.idea/ant.xml
10/03/2010 08:52:51    [0x0-0x6f06f0].com.jetbrains.intellij[10701]    first valid parent: /tmp/TestProject/.idea



Attachment(s):
ant.xml
TestProject-grailsPlugins.iml.zip
0
Comment actions Permalink

Yes, the /tmp bit looks strange, given that Grails has created
everything inside /private/tmp. Looks like a symlink. It's probable that
IDEA's file system doesn't mirror it properly. In this case please do
'File | Invalidate caches' and restart, this may help.

0
Comment actions Permalink

I create this particualr example in tmp, my previous attempts have been in my home folder.

0
Comment actions Permalink

Still, does the 'Invalidate caches' help in this particular case?

And could you attach analogous logs from the projects in home?

0
Comment actions Permalink

sorry, I forgot to try the invalidate caches.  that worked a treat, thank you /very/ much

0

Please sign in to leave a comment.