new grails project won't start - grails

I'm trying to get my feet wet with grails, so I'm following a tutorial to get going with a sample project. I downloaded grails 2.3.2, added the environment variables for the command prompt commands, and successfully created a project by using >grails create-app teamwork. Calling >grails run-app after changing to the project directory successfully downloads all requisites, but then I get . I know that this exception doesn't reveal much, but do you guys have any ideas on why? I am running command prompt in admin mode, if that means anything.

Try not forking the JVM in BuildConfig.groovy, if I recall correctly. If that works, then check the JIRA issues for Grails 2.3.2.

Related

Grails run-app 'Application metadata not found'

I downloaded a serverpush example called GrailsChat and trying to run is on grails 2.4.4.
I had some issues with dependencies missing that took me a while to figure out (don't think it's related but just mentioning it).
When I run grails run-app I get:
| Application metadata not found, please run: grails upgrade
When I run grails upgrade I get
| Script 'Upgrade' not found, did you mean:
1) MigrateDocs
2) IntegrateWith
3) SetGrailsVersion
4) InstallDependency
5) DependencyReport
> Please make a selection or enter Q to quit:
I figure the issue is probably to do with the grails version I have being newer than the grails version that the sample app was targetting but I don't want to move back version simply to run an example (I'd rather understand the underlying issue).
Can anyone point me to some documentation that will help me understand what the application metadata is and how to move forward please?
Grails Upgrade command is removed in 2.4. You might have to upgrade the app manually following the guide.
Or you can just run the service wrapper which will download the grails version automatically base on the app.
./grailsw run-app
It seems like you have missed any one of mentioned
Not set grails proper Version
Missing application.properties file (with proper grails version)

ggts null pointer "Retrieving available scripts"

I installed a fresh copy of GGTS on a fresh copy of windows 8 with JDK 1.7 installed.
I tried to get it to compile my existing project which was based on 2.3.6 and it failed miserably as GGTS comes with grails 2.4.2.
I know serveral people who had problems with 2.4.x so decided to stick with 2.3.
So I downloaded 2.3.11 (latest 2.3) and created a GRAILS_HOME pointing to 2.3.11 dir, and JAVA_HOME pointing to the root of the JDK.
On command line, I can now type grails - version and get back 2.3.11.
I restarted GGTS, and deleted the project and createde it again, adding 2.3.11 as a new Grails version, and set the project to use that.
It fails to compile, saying version is wrong. Fair enough. But when I try to launch the command line from GGTS using the gree circular button at the top which looks like 3 cups, it says:
Retrieving available scripts
Retrieving available scripts
An internal error occurred during: "Retrieving available scripts".
java.lang.NullPointerException
Any ideas?
In my case the problem was, that I had moved grails to a different folder. I just had to change the location of grails in the settings. Hope that helps somebody.
check all grails-project's 'app.grails.version' in application.properties, then open window - preferences - groovy -grails, make sure that all VERSIONs were defined ( I use sts, maybe a little difference ).
alternatively
update all application.properties set app.grails.version=2.3.11 ( the version your ggts defined )
Check if your environment variable of GRAILS_HOME is set to the right version of Grails.
I ran into this same issue, and the problem was caused by the Grails installation it was trying to use. It wanted to use the default version that comes with GGTS rather than the one I installed myself.
To fix, go to Window > Preferences > Groovy > Grails, then "Edit" the Grails installation it shows. I had to switch mine from C:\ggts-bundle\grails-2.4.4\ to C:\grails-2.4.2\.

what happened to 'generate-all' command in Grails 2.3.8?

Started a brand new project based on grails 2.3.8 (groovy 2.2.2) and I can't figure out what happened to 'generate-all' command. I have a domain class set up, i was able to create the controller but it beats me to find how views get crated now.
I've gone through the crate-app step and crated 1 domain class. Am I missing a plugin or something? When I look at tutorials they sure refer to the 'geneate-all' command.
Have things changed that much?
Typically in 2.3.x when you first create the project "generate-all" needs to have a series of Grails compile, clean, clean-all and refresh-dependency. Failing that, exit the project and restart. Then it will show as a valid command.
The reason for this is in 2.3.x scaffolding was moved into a plugin and it needs to be compiled first before the command is available.

Cannot create grails projects in STS but from command line

I have recently started to work with grails. I was able to create applications and generate stuff. Yesterday I wanted to resume my work, after a little break and ran into the following error, when trying to create a new project:
Command terminated with an exception:
org.grails.ide.eclipse.longrunning.client.GrailsProcessDiedException: Grails process died
(see details for partial output)
Grails process died
------System.out:-----------
------System.err:-----------
This error only occurs when I use the SpringSourceTool, if I try using the command line it works fine. My first reaction was to change the java version from 1.8 to 1.7, but that didn't help. My environment variables look like this (I am running Fedora Linux 19)
JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.0.x86_64
GRAILS_HOME=/home/peer/grails/grails-2.3.0
They are also included in the PATH variable.
Can anybody help? Thanks, Peer
This is a known issue in STS:
https://issuetracker.springsource.com/browse/STS-3277
A work-around is provided in the link.
For anyone pulling their hair out trying to create a grails project using the STS extension for Grails, here is my setup and following is what I did to get it working:
-- OSX 10.8.4 Build 12E3067 --
-- STS Version 3.4.0 --
-- Grails 2.3.3 (installed separately to STS) --
Fresh installed STS 3.4.0
I *de*selected the Preferences/Groovy/Compiler/Enable checking for mismatches between
project and workspace Groovy compiler levels
I ONLY selected the Grails Support option when installing the extensions (nothing else)
Restart STS 3.4.0 (i.e. restart eclipse)
I then pointed my Grails project to my existing Grails 2.3.3 installation
Make sure that the environment variable GRAILS_HOME is set and exported in the same
shell from which you invoke STS otherwise you will get a process termination error in
Eclipse (STS)
This worked.

Error in Grails

Anyone knows how to fix this ?
It works fine on my env (Me being the developer) and doesn't work on my colleagues machine who unzips the whole
Welcome to Grails null - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: C:\abc\products\grails-1.1
Base Directory: C:\abc\products\foo\bar
Running script C:\abc\products\grails-1.1\scripts\RunApp.groovy
Environment set to development
Application expects grails version [1.1], but GRAILS_HOME is version [null] - us
e the correct Grails version or run 'grails upgrade' if this Grails version is n
ewer than the version your application expects.
Some clarifications
1) There has been no Grails version change , either on my machine or my colleagues machine. In fact some of them are installing for the first time
2) Under C:\Documents and Settings\myfriend.grails I can see a folder called 'null'
I tried removing this folder - but it gets created he runs my application
3) The way I am giving him the release is- I unzip the whole folder and he unzips it
SO there are three steps
A_ grails create-app to create the APp
B_ Unzip my folder to replace the generated folder
C_ Grails run-app
Things are fine after the step A- but degenerate after Step C
It appears that his Grails installation is corrupted or not set up correctly. I would have him reinstall a fresh copy of Grails - http://www.grails.org/Installation and try again.
The error that you are getting is telling us that the application that you are trying to run is identified as version 1.1 and I assume that this is correct. The fact that Grails is not able to identify what version is installed makes me point to a corrupted or mis-configured Grails installation
If he types 'grails' at the command line what does he see?
I found the problem.
This was because I had added a file- build.properties
And since the file was there- it was expecting it to have certain properties defined in it
Once I renamed it to something else- it started to work

Resources