IntelliJ can't find my Grails install - grails

Im still using IntelliJ 14 (can't afford the upgrade) but now Im working on a Grails project. I used sdkman to install Groovy and Grails so my Grails install is in the usual place (i.e. /Users/whoever/.sdkman/candidates/grails/current). I see console messages telling me that IntelliJ is trying to find release-2.2.0.zip (which doesn't exist anywhere locally AFAIK). Also see attempts to connect to mvn.quonb.org which all fail. Is there a new repo? Can I tell IntelliJ to look somewhere else? How to fix?

Related

Unable to run Grails application using Groovy/Grails Tools Suite 3.6.4

Versions:-
Grails - 3.1.7, Groovy - 2.4.6, Java - 1.8.0, Operating System - Ubuntu 16.04
LTS
I'm able to create an application and run via command line interface (terminal) on ubuntu OS. But when I tried to import the same application (import as grails project) on GGTS the below error message is displayed.
'/home/shravan/grails/demo' doesn't look like a Grails project
Then I tried to create a new grails project from the tool suite itself and configured the grails installation and when I do so, this error message is displayed.
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:----------- Error: Could not find or load main class org.codehaus.groovy.grails.cli.support.GrailsStarter
Error: Could not find or load main class
org.codehaus.groovy.grails.cli.support.GrailsStarter
I'd like you guys to help me resolve this issue as I'm new to this grails application. Your help is much appreciated.
GGTS does not support Grails 3. Nobody has been maintaining GGTS for over a year, so it doesn't look like it ever will support Grails 3. I recommend switching to IntelliJ instead.
Like Donal mentioned, GGTS doesn't support Grails 3 and it is not been maintained. So it's better you use IntelliJ.
The biggest advantage of IntelliJ is that it's very fast and developer friendly and you can use Grails 3 on it's free community version since Grails 3 is based on Gradle.
https://www.jetbrains.com/idea/download/

Vagrant box for Groovy and Grails Development

I want to use Vagrant to ensure a consistent development environment for my Groovy and Grails projects. Is there are standard base Vagrant box? Ie that comes with Java, GVM, Groovy and Grails pre-installed?
I’ve taken a look and can find two but I had some issues with both:
http://borzacchiello.it/set-up-a-vagrant-machine-for-grails-development/
“An error occurred while downloading the remote file. The error message, if any, is reproduced below. Please fix this error and try again. Couldn't open vag2demo/vagrant-grails/base”
https://github.com/osoco/testbox
Here localhost:8888 went to a tomcat that should have Jenkins running, instead it was a base tomcat installation.
Does anyone know of any other sources for a Groovy and Grails Vagrant box?
I ran into similar problems recently and created my own Vagrant box for Grails development.
https://github.com/janmey/grails-vagrant
It's based on Java7 and the latest Groovy and Grails versions are installed using gvm. It's still work-in-progress, but you should be able to get started with it pretty quickly. The inital "vagrant up" will take a while, but the "Hello World" app should work then.

Grails app kills itself

I just got a chance to test-drive a VPS for a week, and decided to try Grails on it. The problem is, that it shuts itself down.
Details:
VPS - 512MB Ram, Ubuntu 12.10 x64 (no particular reason for x64)
Oracle Java 7u17
Latest GVM 0.9.5
Grails 2.2.1
What I did was follow along this tutorial http://grails.org/Quick+Start, which is very basic. Everything went smooth until I did grails run-app.
After doing the initialization, it showed running for like 5s, and I could even start loading the page, but it suddenly showed Killed in the terminal. This is what the terminal showed:
root#jp:/var/grails/my-project# grails run-app
| Running Grails application
Killed
There was no input during that time whatsoever. Any ideas on the cause of this problem?
You should only ever run Grails with the run-app command when developing locally. The reason behind this is because run-app starts your Grails app with a lot of dynamic behavior that is great for rapid development, but horrible performance-wise for running on an actual server.
Refer to Grails' User Guide on how best to deploy your application:
http://grails.org/doc/latest/guide/gettingStarted.html#deployingAnApplication
As the docs above state, the correct way to run your Grails app is to embed it in a servlet container. Tomcat is a good place to start since Grails uses that by default when running locally. You may also need to play around with the VM flags of your servlet container, depending on your environment (again, the docs give a few suggestions here).
You can redirect output of your command if it get's killed immediately on your terminal.
grails run-app > output.txt
Then open output.txt and from there you can dissect the problem.
For my case, i got an incorrect JAVA_HOME directory.
Hope it helps.

Grails and Cloudbees

I am following this tutorial on Grails and Cloudbees And it says :
"to use CloudBees databases locally from your application, you first need to add the CloudBees SDK's appserver.jar file to your grails classpath"
Does anyone know what is this appserver.jar? Where can I find it?
Yes, as mentioned in the comment - you can get that jar file from the SDK you download.
However, it is perfectly find (and possibly better) to use the mysql driver directly as mentioned.
When running on cloudbees, you can bind your app to a database - so that at runtime the right database is injected - using the bees db:bind SDK command.

How to start a grails webtest without starting the grails application?

I am working with the webtest plugin as functional test component for grails.
It works fine, but is very slow - the whole application has poor response times (>1min per page) when under test. My feeling is that this is because the app, canoo webtest and the IDE (netbeans) are running in one JVM when I start my test through the IDE (test-app functional:)
So my goal is now to deploy the app to a stand-alone tomcat and run my tests against this tomcat instance.
I googled and found an old option -nostart for webtest which seem to be outdated.
So I googled some more and found the -baseUrl=http://... option in the current documentation. The docs say that with this option, the app will not be started and all tests will run against this baseUrl. But when I give it a try, grails still tries to start up jetty (at least, I get an error message saying that the port 8080 is already in use).
Any ideas? I am already thinking about using webtest stand-alone, but I like the groovy syntax of the plugin...
I'm using grails 1.3.4
You could try interactive mode as mentioned here: Can I run grails integration & functional tests against a running server?
If the -baseUrl option isn't working then I'd raise a JIRA issue.
cheers
Lee

Resources