If you’re developing on a Windows platform for an application targeted for Linux or Unix that deals with email, then this article will be useful.
Let us begin by understand the problem.
Problem If you are a Java/Spring developer, (developing in Java is platform independent - runs on any platform where a JVM is available) then you have two options in front of you for sending emails from a Java application:
Most likely you’ve landed on this page because you’ve searched for the error in a search engine and it brought you here.
Symptom: When you run “grails” under an existing project that you previously had (either on a different PC or from a source-control like GIT or SVN and you’ve mistakenly included the “build” directory).
The associated error would have been one of the following:
Grails No profile found for name [web] or java.
If you’re implementing any projects with Spring and Gradle (for build), as your project grows you may run into this issue. Or you’ve landed on this page by searching on Google for “Unable to locate Spring NamespaceHandler for XML schema namespace” (your actual XML that it’s error-ing out may vary).
Either way, you’re in luck! Most likely, you’re using the fatjar gradle plugin to create a single JAR for executing as “java -jar one-big-bundle.
If you’re using Grails 2.3.X and you’re developing, most likely you’re running your app like this:
[sourcecode language=“jscript”] grails run-app #in one command-prompt/shell-terminal and grails stop-app #in another command-prompt/shell-terminal [/sourcecode]
With the latest version of Grails (version 2.3.5), the stop-app say:
[sourcecode language=“jscript”] grails stop-app | Server Stopped
But nothing happens and the server-process continues to run# [/sourcecode]
Here’s an undocumented fix that can come in handy:
On terminal/command-prompt #1 Run the way you do today grails run-app
Here is an example illustrating the problem:
SamplePage.gsp [sourcecode language=“html”]
MyThinkPond.com Custom Page ... Some this page content [/sourcecode]
and the layout page (layoutPage.gsp) [sourcecode language=“html”]
... Some template (header) content [/sourcecode]
With a new Grails 2.X project you run into challenges on which folders to check-in into a GIT repository. You want to remove any non-essential files that Grails can rebuild at run-time. And if you are using either GITHub or BitBucket for your GIT repo’s the default .gitignore file created or provided by GITHub is setup for configured for a Grails 1.X project and not a Grails 2.X project.
Developing with Grails and Groovy can be a blessing and and pain all at the same time. The development moves at a rapid rate but when you decide to include libraries that depend on other libraries, your pain starts to build up. For example, when you include the module “HttpBuilder"in your project you may run into issues with Xerces and xml-apis, especially when you attempt to deploy the WAR file under Tomcat.
I’ve noticed a peculiar behavior that I’m documenting here for others. I’m using Grails 1.4.M1 and it bundles with it H2 database version [H2 1.2.147 (2010-11-21)]
If you decide to run H2 in a server mode, you would most likely download the latest version of H2 Database from the website. As of writing this article, the stable version of H2 is [H2 1.3.158 (2011-07-17)].
Issue: If you run your Grails application using 1.
Today, while doing some Grails development I came across a peculiar issue that perplexed me and I’m documenting it for all others to benefit. (Also see my other blog from today for the issue that started this journey).
Here are my specifications:
java version “1.6.0_24” Java(TM) SE Runtime Environment (build 1.6.0_24-b07) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
I’m sure if you have been developing with Java and Tomcat for sometime, you are likely to run into the infamous debug error.
SEVERE: Error listenerStart
You will most likely start Googling it trying to find out what the heck is going on. And in trying to see the extended logging on what that “listenerStart” error means. After some lucky searches, you will see links asking you to drop a “log4j.
The directions below will help you move the Grails user work and cache directory to a different location.
Sometimes your default “primary drive” may be running out of space and you need to move your workspace else where.
Create a file called “settings.groovy” under “C:/Users/.grails” directory.
Edit this file and add the following line: [sourcecode language=“jscript”]
Make sure that the defined folder exists.