No console output available on linux when executing grails/groovy
What version of grails?
env|grep JAVA_HOME
JAVA_HOME=/usr/lib/jvm/java-6-openjdk-amd64/
env|grep GRAILS
GRAILS_HOME=/home/vahid/ggts-bundle/grails-2.3.7/
which grails
grails is aliased to `/home/vahid/ggts-bundle/grails-2.3.7/bin/grails'
alias|grep grails
alias grails='/home/vahid/ggts-bundle/grails-2.3.7/bin/grails'
Do you see anything actually being done, or is it after completion that it does not show up?
grails refresh-dependencies --plain-output 2>&1 > /tmp/vh.txt
The above redirected all output to /tmp/vh.txt
cat /tmp/vh.txt
|Loading Grails 2.3.7
|Configuring classpath
.
|Environment set to development
....
|Dependencies refreshed.
grails application terminating automatically
Srujan
I thought I give you more of an insight into grails now that I have a little time on my hands...
most of the grails should remember one day not too long ago we were also in the same boat and had no idea where to start...
I would suggest getting hold of a good book such as definitive guide to grails 2 and reading/experimenting....
To create a basic app with one object :
The following is using grails command line - so refer to No console output available on linux when executing grails/groovy for expoerting out java grails - I Guess you are windows so same but on windows environment...
$ grails create-app grails-example
$ cd grails-example
$ grails create-domain-class Books
$ vi grails-app/domain/grails/example/Books.groovy
cat grails-app/domain/grails/example/Books.groovy
package grails.example
class Books {
String name
static constraints = {
}
}
vi is a linux editing tool so use notepad and go to that path and as you can see I added
String name
save file now run:
$ grails generate-controller grails.example.Books
$ grails generate-view Books
$ grails generate-view grails.example.Books
$ grails run-app
As for general beginners guide, I came across this site today and have probably used in the past without noticing it...
http://grails.asia/grails-tutorial-for-beginners/
Best of luck and welcome to Grails. I have enjoyed every moment of working with it...
Grails hangs on command line
Cleaning .ivy cache helps
$HOME/.grails/ivy-cache
Groovy executing shell commands
Ok, solved it myself;
def sout = new StringBuilder(), serr = new StringBuilder()
def proc = 'ls /badDir'.execute()
proc.consumeProcessOutput(sout, serr)
proc.waitForOrKill(1000)
println "out> $sout\nerr> $serr"
displays:
out> err> ls: cannot access /badDir: No such file or directory
Grails Dependencies not Added as Libraries to IntelliJ IDEA
Understanding how Grails resolves Gant scripts really helps:
http://grails.github.io/grails-doc/2.3.x/guide/commandLine.html
Grails searches in the following directories for Gant scripts to execute:
- USER_HOME/.grails/scripts
- PROJECT_HOME/scripts
- PROJECT_HOME/plugins/*/scripts
- GRAILS_HOME/scripts
The problem seems that IntelliJ IDEA is automagically providing this Gant script, but putting the script in the wrong spot.
Using VisualVM, here are the user directories:
user.dir=C:\Users\%USERNAME%
user.home=\\SOME\network\drive\%USERNAME%
So even though Cygwin, and so it seems IntelliJ IDEA, treats C:\Users\%USERNAME%
as the home directory, the Windows Group Policy maps it to a network share and Java uses this value as user.home
.
Looking in C:\Users\%USERNAME%\.grails\scripts
, I was able to find the script. I copied it to \\SOME\network\drive\%USERNAME%\.grails\scripts
and then Grails recognized the script and IntelliJ IDEA was able to configure itself properly.
How to get Grails application name within Config.groovy?
To get the appName in a config file that you're including with grails.config.locations
you can use:
appName = grails.util.Metadata.current.'app.name'
Related Topics
Displaying or Redirecting a Shell's Job Control Messages
Are the 'Dot' and 'Dot Dot' Files in Unix and Linux Real Files
Bash Script Properties File Using '.' in Variable Name
How to Make Linux Power Off When Halt Is Run
Cmsg_Nxthdr() Returns Null Even Though There Are More Cmsghdr Objects
How to Suspend and Resume a Sequence of Commands in Bash
Gatttool Non-Interactive Mode --Char-Write
Differentiate Between Exit and Session Timeout
Django on Apache Wtih Mod_Wsgi (Linux) - 403 Forbidden
Stop Being Root in the Middle of a Script That Was Run with Sudo
After Segfault: Is There a Way, to Check If Pointer Is Still Valid