cannot run grails app from Terminal window - grails

I need some help for running grails app. I am using Grails 1.3.7 on my Mac with OSx Lion. I used to run grails application fine from the command line/terminal window fine. But recently since I installed Intellij Idea and started running grails app thru Intellij Idea. But now I cannot run the same application from terminal window. In console, my application goes upto ... 'running grails application' and then never go further. I can see the java process in 'Activity Monitor' but the app never go further.. Appreciate help to determine why I cannot run app from terminal now, and runs fine when launched thru IntellijIdea.
From Terminal window
YSINGH_XXX:Trunk_AS ysingh$ grails run-app
Welcome to Grails 1.3.7 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /Users/ysingh/Grails/grails-1.3.7
Base Directory: /Users/ysingh/Workspace/Trunk/Trunk_AS
Resolving dependencies...
Dependencies resolved in 2369ms.
Running script /Users/ysingh/Grails/grails-1.3.7/scripts/RunApp.groovy
Environment set to development
[groovyc] Compiling 2 source files to /Users/ysingh/.grails/1.3.7/projects/Trunk_AS/ast/mongodb-morphia
[groovyc] Compiling 2 source files to /Users/ysingh/Workspace/Trunk/Trunk_AS/target/classes
[copy] Copying 1 file to /Users/ysingh/.grails/1.3.7/projects/Trunk_AS
[delete] Deleting directory /Users/ysingh/.grails/1.3.7/projects/Trunk_AS/tomcat
Running Grails application..
============== This is the last statement in console......

Related

Why I can't create new grails application in Netbeans 8.2?

OS: Windows 10
JDK: jdk1.8.0_65
IDE: Netbeans 8.2
Steps I had taken:
1. I had installed Netbeans, selecting the ALL column, meaning it can support Groovy or the grails application.
2. I also had installed the latest version of Grails which is the grails-3.3.5.
3. After installing everything, I opened Netbeans.
STEPS I HAD TAKEN IN NETBEANS
File > New Project > Groovy > Grails Application > then I clicked next.
After that I had clicked the Configure Grails... button. Then I copy pasted the file path of my grails home directory (in my case that is C:\Program Files\NetBeans 8.2\grails-3.3.5) under the textbox of Grails Home then clicked on OK.
The problem here is that I cannot create a new project. It kept on displaying this message box: "Unexpected error occured while creating the application. See output window for more details."
And there it shows the error: "Specifiy an application name or use --inplace to create an application in the current directory"
What should I do? Please help me. I need this for my job application's exam. Thank you so much.
I get exactly the same error as you when creating a Grails 3.3.5 project in NetBeans 8.2 on Windows 10. This is because of a longstanding bug in NetBeans: Bug 258407 - Error when creating a Grails 3.1.x project, which also impacts more recent releases of Grails.
Although that bug has Status: VERIFIED FIXED, unfortunately the fix was not applied to release 8.2 itself ("...this bug is fixed in development builds not 8.2"). You have two possible workarounds:
Install a DEV build of NetBeans 8.x which contains the fix.
Install the beta release of NetBeans 9.0 which contains the fix.
Option 1: Using a DEV release of NetBeans
Download the most recent nightly Dev build of NetBeans 8.2.
Activate Groovy and locate Grails 3.3.5 in the same way as you did on NetBeans 8.2.
You can then successfully create your Grails application using the Groovy > Grails Application project wizard, and run it:
Option 2: Using a beta release of NetBeans 9.
Download and unzip NetBeans 9 beta from the Apache NetBeans 9.0 Beta web site.
Start NetBeans 9 beta and install the Groovy/Grails plugin:
Locate Grails 3.3.5 in the same way as you did on NetBeans 8.2 (Tools > Options > Miscellaneous > Groovy > Grails Home).
You can then successfully create your Grails application using the Groovy > Grails Application project wizard, and run it:

Unable to run my Grails app - how to fix this?

When I run my Grails project in Eclipse then the following error comes. What is the meaning of the error? How to remove this? I am using the Git to share the application on Bitbucket. Why is it showing the list of the plugins? Also when I run the app from the command prompt of the Grails then the app runs and there are no errors. Why is this?
|Loading Grails 2.5.0
|Configuring classpath
Error |
G:\programming\TE\TE_intern_grails\local directory for grails using git\arpte\arpte does not appear to be part of a Grails application.
Error |
The following commands are supported outside of a project:
add-proxy
clear-proxy
create-app
create-multi-project-build
create-plugin
help
install-app-templates
list-plugins
package-plugin
plugin-info
remove-proxy
set-proxy
|Run 'grails help' for a complete list of available scripts.Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
You could import the project as a Git project in eclipse and try to run. This has fixed my issue recently.
Otherwise
Right click on the project
Click on run
Go to Run As, then select Run Configurations
Delete the existing run configurations of the present project
Run the project now.
It will work perfectly.

Grails GGTS "Task 'assemble' not found in root project" error when running "grails war" in Command Prompt

I have been learning Groovy/Grails Tool Suite (GGTS) 3.6.4, with Grails 2.4.4 using some video tutorials. When I attempt to package the project into an application using the grails war command on the Windows command prompt, I get the following error:
"Error Gradle build terminated with error: Task 'assemble' not found in root project ..."
Any references to this error that I have found online have only involved Android Studio (for instance), so I am at a loss here as to how to fix it for GGTS.
I have Android Studio 1.0.1 installed, and in case it was affecting the Grails packaging, I tried the solution of removing the <component name="FacetManager"> from the general Android Studio "MyApplication.iml" file, but that had no effect. I couldn't find any analogous file for the GGTS.
In case the issue lies elsewhere in my overall installation, I have Java JRE 7_79 (64-bit) installed, as well as the the JDK 1.7.0_79 (64-bit)
OK. I found out what the cause of the error was, and how to avoid it in the future.
The Problem
Grails 3.0.1 requires the following files for grails war to work:
build.gradle
gradle.properties
gradlew
gradlew.bat
\gradle (directory)
Grails 2.4.4 does not require any of the above files for making a WAR file.
GGTS 3.6.4 does not work with Grails 3.0.1, but it comes with and works fine with Grails 2.4.4.
The Solution
Copying the stated Gradle files & directory to a GGTS project folder fixed the problem. However, I wasn't satisfied with needing to do this manually or with a custom batch file for every project.
Looking deeper, it turns out that when working out compatibility issues between the Java 32-bit JRE existing on my system and the Java 64-bit JRE & SDK, Grails, and GGTS versions (there was a lot of fiddling to get things working), at one point I had set up my global variable to Grails to be directed at 3.0.1, and I failed to update it to Grails 2.4.4. Making this change has fixed the issue.
Explaining the Cause
When following this video series on installing a compatible set of Java, Grails, and GGTS, the instructor manually downloaded the latest version of Grails from the Grails site and then downloaded GGTS separately from its own site. Both of these were older versions than what I was working with.
In my case it turns out that, after setting up the Java SDK & Grails, the latest version of GGTS (3.6.4) did not work properly with the latest version of Grails (3.0.1). Fortunately the GGTS bundle came with an older version of Grails (2.4.4), and by referencing that, GGTS would work correctly. However, although I changed the IDE reference to Grails, I forgot to reset my environment variable ...
So GGTS was setting up the project for using Grails 2.4.4. However, when calling grails war, the command was using Grails 3.0.1! Apparently these two versions of Grails use different files for creating a WAR file, so GGTS was not setting up the project directories with the correct local files, and the packaging was failing.
Avoiding Future Occurrences
So, when using GGTS 3.6.4, make sure that all references to Grails point to Grails 2.4.4.
In general, if any GGTS bundle contains a version of Grails, you should have everything set up to use that version, even if it is old.

Build Error when building blank Grails Project in GGTS

I have freshly downloaded GGTS 3.5.1 and pointed it to grails-2.4.0 and jdk_1.8.0_05 but I can't build just a blank grails project without getting build errors.
The exact error is.
Building Workspace
Errors Occurred During The Build
Errors running builder 'Java Builder' on project 'test'.
org.codehaus.groovy.runtime.DefaultGroovyMethods.count(Ljava/lang/Iterable;Lgroovy/lang/Closure;)Ljava/lang/Number;
I have tried booting using the -clean flag, downloading other versions of groovy, grails and jdk. This error even occurs exactly the same on my desktop and laptop, so I guess something I'm doing in the setup has to be wrong.
What was the Groovy compiler specified for in your GGTS? I think for Grails 2.4 you'd need Groovy 2.3 compiler set in the preferences.

Grails : Error generating web.xml file

I have upgraded my Grails project from version 2.1.2 to 2.2.3. Before the upgrade, the project worked flawlessly. However, I am not able to run the project now. I get a strange error :
| Compiling 143 source files.....
| Error Error generating web.xml file (Use --stacktrace to see the full trace)
and the compilation stops.
I thought that the "--stacktrace" option would provide some useful information. However, I am not able to decipher the error.
Error here > http://pastebin.com/zwR4YzXS
Googling / searching this problem did not help. I hope I am not the only one, who is getting this error.
Thank you for your advices !
Some useful info :
Grails 2.2.3
Java version :
java version "1.7.0_21"
OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-0ubuntu0.12.10.1)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)
OS: Ubuntu 12.04 x64
Faced the same issue while working with grails 2.3.2. Actually, I added and then removed clojure plugin. Right after got such problem.
$ grails clean just worked for me.
Same problem i was facing i used the below command :
grails clean
grails refresh-dependencies
and that worked for me
If you are using Intellij the problem is that:
the reason for this is that IDEA adds classpath by default on creating integration test run configuration. So if you run tests you might cause that error
Open Run → Edit Configurations... (or press Alt-Shift-F10)
Select your configuration that fails
Uncheck Add --classpath checkbox
You are done! Run.

Resources