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

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.

Related

Intellij 14 Grails Project Error on run-app: Module not backed by Gradle

I recently downloaded a new Intellij version 2017 for Grails 3 upgrade .I am using Intellij 14 with Grails 2.3.7.When I was prompted to import settings for new version,I clicked yes .Now however when I try to run my existing 2.3.7 project in Intellij 14 ,it complains Module not backed by gradle. I did not use gradle in my 2.3.7 Project.How to run this app.
Apparently my project.iml file was messed up.I had to clean that up and was able run in previous version.Thanks All
you can use the ./gradlew command with gradle installed in your machine to rebuild your gradle project.

Using a Grails 2.4.2 plugin as a JAR dependency in a Grails 2.2.0 project

I have a custom plugin built using Grails 2.4.2 that is to be used with multiple Grails projects as a regular JAR dependency. I have successfully exported the plugin as JAR and installed into my local Maven repository and added the corresponding dependency statements in the "dependencies" block of the BuildConfig.groovy files of the respective parent projects. e.g.:
compile 'my_package:my_custom_plugin:1.0'
One of the parent project is build using Grails 2.4.2. When I run that project with the above mentioned configuration using the command: grails run-app, it runs fine without any errors.
However, when I do the same kind of configuration in another project built using Grails 2.2.0 and run it using the command: grails run-app, it gives the following error:
Error | Fatal error during compilation org.apache.tools.ant.BuildException: java.lang.NoClassDefFoundError: org/grails/datastore/mapping/dirty/checking/DirtyCheckable (Use --stacktrace to see the full trace)
NOTE: Both these parent projects run fine when I add the same plugin as a plugin instead of as a JAR dependency using the statement like this in the BuildConfig.groovy:
grails.plugin.location."my_custom_plugin" = "../my_custom_plugin/"
Can anybody kindly guide me as to how can I resolve this issue?
Any help would be greatly appreciated.

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.

cannot run grails app from Terminal window

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......

Resources