Vagrant box for Groovy and Grails Development - grails

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.

Related

How to deploy to GlassFish4 instance in Docker through IntelliJ?

I'm currently trying to use IntelliJ to deploy to a local GlassFish instance running in Docker on my Windows 10 box.
I'm following the instructions here on deployment, using the remote server setup.
However, when calling the run command, I get the following error from IntelliJ:
Artifact my-project:war: java.io.IOException: com.sun.enterprise.admin.remote.RemoteFailureException: File not found : /opt/glassfish4/glassfish/domains/my-domain/config/C:[PATH_TO_MY_TARGET_DIR]\my-project.war
It seems like it's trying to pass too much of the path when uploading.
Interestingly, I tried this same setup (different IP addy) deploying to a GlassFish instance running in Docker in a local Ubuntu VM, and it has no problem.
Anyone gone down this road?
I have the same problem and contacted JetBrains.
It seems to be a bug in IntelliJ wich will be hopefully fixed quite soon. Here is the link for reference https://youtrack.jetbrains.com/issue/IDEA-180292.

IntelliJ can't find my Grails install

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?

Jenkins running on WAS 8.5.5 with JDK 1.7

We have Jenkins installed and running on a WebSphere Application Server. We recently upgraded the server to version 8.5.5 and switched the profile to use JDK version 1.7. Doing this Jenkins Crashes the WebSphere Application Server and we cannot tell why. Any hints or suggestions on things to look at? Switching the server back to JDK 1.6 seems to work just fine, can Jenkins not run on JDK 1.7 or is it something else?
I'll assume that by crash the websphere application server you mean either a fatal error at startup or a java process crash. Those can have many causes.
Just to give some ideas, it may be related to the fact that you had somewhat customized your JDK install and forgot to re-apply those customization to your new JDK. Or that switching SDK requires you to switch command line options, or that you indeed hit an incompatible class in the stack, or that your process crash because of bad luck, etc.
So please find more information in the logs, either the corresponding stack traces in your WAS server logs or the javacores crash files.
Please also report your jenkins version.
As for JDK 7 compatibility, latest jenkins itself should be compatible, yet some plugins are not
You may also want to read this: https://stackoverflow.com/questions/17411717/jenkins-on-websphere-reports-java-lang-noclassdeffounderror-jenkins-model-jenki. Maybe you have the same issue.
If you indeed find out an incompatibility, please report an issue in jenkins issue tracker and consider updating the Jenkins Websphere wiki.

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.

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