Cloud Foundry unable to deploy grails app [UnknownHostException] - grails

I recently tried to deploy a Grails project on cloud foundry and I got the following error while executing "grails cf-push"
Environment set to production.....
Error Error executing script_ CfPush: org.springframework.web.client.ResourceAccessException: I/O error on POST request for "http://api.cloudfoundry.com/users/username#gmail.com/tokens":api.cloudfoundry.com; nested exception is java.net.UnknownHostException: api.cloudfoundry.com (Use --stacktrace to see the full trace)
and for "grails cf-push --stacktrace":
Error Error executing script_ CfPush: org.springframework.web.client.ResourceAccessException: I/O error: api.cloudfoundry.com; nested exception is java.net.UnknownHostException: api.cloudfoundry.com (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
org.springframework.web.client.ResourceAccessException: I/O error: api.cloudfoundry.com; nested exception is java.net.UnknownHostException: api.cloudfoundry.com
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:461)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:409)
at org.springframework.web.client.RestTemplate.postForObject(RestTemplate.java:287)
at org.cloudfoundry.client.lib.CloudFoundryClient.login(CloudFoundryClient.java:210)
at ClientWrapper.methodMissing(_CfCommon_groovy:536)
at _CfCommon_groovy$_run_closure5.doCall(_CfCommon_groovy:110)
at _CfCommon_groovy$_run_closure5.call(_CfCommon_groovy)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at CfPush$_run_closure1.doCall(CfPush:40)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at java_util_concurrent_Callable$call.call(Unknown Source)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at java_util_concurrent_Callable$call.call(Unknown Source)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at java_util_concurrent_Callable$call.call(Unknown Source)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:591)
at gant.Gant.executeTargets(Gant.groovy:590)
Caused by: java.net.UnknownHostException: api.cloudfoundry.com
at grails.plugin.cloudfoundry.GrailsHttpRequestFactory$1.intercept(GrailsHttpRequestFactory.java:91)
at $java.net.HttpURLConnection$$EnhancerByCGLIB$$7c6bfa30.connect(<generated>)
at grails.plugin.cloudfoundry.GrailsHttpRequest.executeInternal(GrailsHttpRequest.java:75)
at grails.plugin.cloudfoundry.GrailsHttpRequest.executeInternal(GrailsHttpRequest.java:89)
at org.springframework.http.client.AbstractClientHttpRequest.execute(AbstractClientHttpRequest.java:49)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:446)
... 30 more
Everything was working fine just couple of months ago but I had to stop working on the project for some time. When I came back to it I realized that it is no longer possible to deploy it in the way I always did.
I assumed that I needed to upgrade my cloud-foundry plugin so all in a day's work I upgraded the whole groovy/grails environment:
groovy 2.0.5 to 2.1.9
grails 2.1.2 to 2.3.1
along with the project itself using these instructions:
http://grails.org/doc/2.3.0.M1/guide/upgradingFromPreviousVersionsOfGrails.html
Dependencies resolved themselves rather smoothly (along with the latest cloud-foundry 1.2.3 plugin). But deployment still fails with the same error.
"vmc info" tells me that "api.cloudfoundry.com" does not exist.
I'm out ideas. Was the address changed? Is there any by-the-book way to fix it or is it something else going on here?

"api.cloudfoundry.com" is the URL for the hosted Cloud Foundry v1, which no longer exists. "cloudfoundry.com" has been replaced by http://run.pivotal.io, which is Cloud Foundry v2.
The Cloud Foundry Grails plugin has not been updated to support CF v2 yet. You should use the "cf" CLI to interact with CF instead of the Grails plugin scripts. See http://docs.cloudfoundry.com/docs/using/managing-apps/cf/index.html and http://docs.cloudfoundry.com/docs/using/deploying-apps/jvm/index.html.

Related

Install rest-client-builder 2.1.1 in grails 2.4.3 manually

I need install rest-client-builder 2.1.1 in grails 2.4.3 but my internet access is very limited and behind a proxy. I download from https://repo.grails.org the entire folder of plugin, the files are:
rest-client-builder-2.1.1-plugin.xml
rest-client-builder-2.1.1-plugin.xml.md5
rest-client-builder-2.1.1-plugin.xml.sha1
rest-client-builder-2.1.1.pom rest-client-builder-2.1.1.pom.md5
rest-client-builder-2.1.1.pom.sha1 rest-client-builder-2.1.1.zip
rest-client-builder-2.1.1.zip.md5 rest-client-builder-2.1.1.zip.sha1
I copy that to my .m2 folder in that address:
.m2/repository/org/grails/plugins/rest-client-builder/2.1.1
But when i run : grails install-plugin rest-client-builder 2.1.1, I have the following error:
Error installing plugin: grails.org (Use --stacktrace to see the full trace)
This is the full trace (with --stacktrace)
Error installing plugin: grails.org (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.net.UnknownHostException: grails.org
at InstallPlugin$_run_closure1.doCall(InstallPlugin.groovy:70)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners$0.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:591)
at gant.Gant.executeTargets(Gant.groovy:590)
| Error Error installing plugin: grails.org
¿Any help?
Thanks in advance
Well, for me it worked:
Install cntlm and configure settings of my proxy
Run in a terminal:
grails add-proxy client "--host=http://localhost/" "--port=3128"
(3128 is the defaul port of cntlm)
Add this config on BuildConfig.groovy
repositories {
...
mavenRepo "http://repo.grails.org/grails/plugins"
mavenRepo "http://repo1.maven.org/maven2"
}
plugins {
...
//REST plugin
compile ":rest-client-builder:2.1.1"
}

grails fail generated war (assets)

i have a strange error when i generate war with grails war commande
| Processing File 53 of 1214 - yuiApplication/dial/assets/dial-core.css.
| Error WAR packaging error: /Users/sovlin/IdeaProjects/revelido/grails-app/assets/javascripts/yuiApplication/dial/assets (Is a directory)
I don't understand why this folder make problem. I check it but nothing of suspect.
I test clean-clean without success.
The run-app commande working.
Error with StackTrace
war --stacktrace | Processing File 53 of 1214 -
yuiApplication/dial/assets/dial-core.css. | Error WAR packaging error:
/Users/sovlin/IdeaProjects/revelido/grails-app/assets/javascripts/yuiApplication/dial/assets
(Is a directory) | Error Error running script war --stacktrace:
org.codehaus.groovy.grails.cli.ScriptExitException (NOTE: Stack trace
has been filtered. Use --verbose to see entire trace.)
org.codehaus.groovy.grails.cli.ScriptExitException
at _GrailsWar$_run_closure2.doCall(_GrailsWar.groovy:43)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at org.codehaus.gant.GantMetaClass.processClosure(GantMetaClass.java:81)
at org.codehaus.gant.GantMetaClass.processArgument(GantMetaClass.java:95)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:128)
at War$_run_closure1.doCall(War.groovy:38)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners$0.callCurrent(Unknown Source)
at gant.Gant$this$2$withBuildListeners$0.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:591)
at gant.Gant.executeTargets(Gant.groovy:590) | Error Error running script war --stacktrace:
org.codehaus.groovy.grails.cli.ScriptExitException
Here my plugin configuration
asset-pipeline 2.0.17 -- Asset Pipeline Plugin
cache 1.1.8 -- Cache Plugin
database-migration 1.4.0 -- Grails Database Migration Plugin
hibernate4 4.3.6.1 -- Hibernate 4 for Grails
jquery 1.11.1 -- jQuery for Grails
scaffolding 2.1.2 -- Grails Scaffolding Plugin
spring-security-core2.0-RC4 -- Spring Security Core Plugin
tomcat 8.0.15 -- Apache Tomcat plugin
webxml 1.4.1 -- WebXmlConfig
Thanks you for your help
It definitely has to do with a folder that is named as if it was a file that needs processing. Asset-Pipeline however should be correcting for this and I have modded core to ensure a check and make sure File is not a Directory. This is released in 2.0.18

Grails Reverse Engineer Database

I'm trying to evaluate Grails as a solution for an upcoming project. There is already a large database in use that won't be modified much if it all. I wan't to reverse engineer the database into GORM domain objects as a starting point.
I found one here http://www.grails.org/plugin/db-reverse-engineer. I got it installed and configured however when I run it I see the same error over and over. The stacktrace is below.
Can someone help me correct the error, or recommend another tool for reverse engineering to grails? I've used Netbeans in the past to reverse engineer databases to JPA entities that worked out pretty well. I'm hoping for something similar with Grails.
| Error Error executing script DbReverseEngineer: javax/transaction/Transaction (NOTE: Stack trace has been filtered. Us
e --verbose to see entire trace.)
java.lang.NoClassDefFoundError: javax/transaction/Transaction
at grails.plugin.reveng.GrailsJdbcBinder.readDatabaseSchema(GrailsJdbcBinder.groovy:51)
at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:93)
at org.hibernate.cfg.JDBCBinder$readFromDatabase.call(Unknown Source)
at grails.plugin.reveng.GrailsJdbcMetaDataConfiguration.readFromJDBC(GrailsJdbcMetaDataConfiguration.groovy:32)
at grails.plugin.reveng.GrailsJdbcMetaDataConfiguration$readFromJDBC.call(Unknown Source)
at grails.plugin.reveng.Reenigne.buildConfiguration(Reenigne.groovy:114)
at grails.plugin.reveng.Reenigne.execute(Reenigne.groovy:60)
at grails.plugin.reveng.Reenigne$execute.call(Unknown Source)
at grails.plugin.reveng.RevengRunner.run(RevengRunner.groovy:81)
at grails.plugin.reveng.RevengRunner$run.call(Unknown Source)
at DbReverseEngineer$_run_closure1.doCall(DbReverseEngineer:36)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:1
85)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners$0.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:591)
at gant.Gant.executeTargets(Gant.groovy:590)
Caused by: java.lang.ClassNotFoundException: javax.transaction.Transaction
... 29 more
| Error Error executing script DbReverseEngineer: javax/transaction/Transaction
Actually this plugin is not compatible with Hibernate 4... yet. But since the last push was like ages ago, it doesn't look like that you will get a new version soon enough to work with it :)
However, you can still keep using this version of Grails and the db-reverse-engineer:0.5 plugin, by switching your Hibernate version, back to 3. And it is quite easy to do so !
In BuildConfig.groovy, comment the line
runtime ":hibernate4:4.X.X.X"
And add instead:
runtime ":hibernate:3.6.10.17"
(And btw, do not forget to add the correct connector to your database, I use myself this dependency:
compile 'mysql:mysql-connector-java:5.1.22'
)
Well, the plugin uses Hibernate Tools to do the reverse-engineering, so you could try just using those directly.
There is a new version which fixs many bugs such this :It is 0.5.1 insead of 0.5
BuildConfig.groovy
runtime ':db-reverse-engineer:0.5.1'
I too faced the same problem but I didn't switch to hibernate 3.x version the main problem is connector, un comment the mysql connector in BuildConfig.groovy
and I have added the javax.transaction jar in lib folder of grails application this solved the problem

grails 2.3 spock integration test No WebApplicationContext found error

I just upgraded an existing App from Grails 2.2.4 to 2.3.0. All spock Integration tests are broken since then. The error message I got is shown below. There is no problem running unit test or run-app. Thanks advance for any advice.
| Error Fatal error running tests: No WebApplicationContext found: no ContextLoaderListener registered? (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)
java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:90)
at grails.util.Holders.getApplicationContext(Holders.java:78)
at _GrailsTest_groovy$_run_closure1.doCall(_GrailsTest_groovy:95)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at TestApp$_run_closure1.doCall(TestApp.groovy:32)
at org.codehaus.gant.GantMetaClass.invokeMethod(GantMetaClass.java:133)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16_closure18.doCall(GantBinding.groovy)
at org.codehaus.gant.GantBinding.withTargetEvent(GantBinding.groovy:90)
at org.codehaus.gant.GantBinding.this$4$withTargetEvent(GantBinding.groovy)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy:185)
at org.codehaus.gant.GantBinding$_initializeGantBinding_closure5_closure16.doCall(GantBinding.groovy)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:591)
at gant.Gant.executeTargets(Gant.groovy:590)
| Error Fatal error running tests: No WebApplicationContext found: no ContextLoaderListener registered?
You no longer need to add the Spock plugin to your projects for grails >= 2.3.
Simply create Spock specifications as before and they will be run as unit tests. In fact, don't install the Spock plugin, otherwise your specifications will run twice and potentially fail. This also means that the spock test type no longer exists.
Specifications and JUnit tests run as the same type now.
OK. I figured this out a while ago.
The reason is I tried to mock servletcontext in the integration test while it is already provided for in Grails 2.3.2. After removing the mocked servletContext, everything worked lie before.

Tomcat ClassNotFound exception when trying to run Application

I have a grails application that I was running fine until yesterday when I decided to download an Email plugin into the STS. The download failed for some reason and I got around the issue with a few searches around. Once I resolved the plugin issues, my application stopped to work. I tried a lot of things including re-installing STS. I was maintaining a GIT repository and I reverted all my changes to the last known working one. This did not help either. I created a new Grails project and copied all my source files over there and everything was working fine.
I compared all the build paths and properties files between the working one and the non working one and they seem to be the same except the .classpath which is getting changed every time I try to run the application like the below
+ <classpathentry exported="true" kind="con" path="GROOVY_DSL_SUPPORT"/>
<classpathentry kind="con" path="com.springsource.sts.grails.core.CLASSP
- <classpathentry kind="src" path=".link_to_grails_plugins/tomcat-1.3.7/sr
- <attributes>
- <attribute name="com.springsource.sts.grails.core.SOURCE
- </attributes>
- </classpathentry>
Can anyone please help me with where I should be looking to get this application back on track??
Here is the Error that I get:
Welcome to Grails 1.3.7 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /Users/mymac/springsource/grails-1.3.7/
Base Directory: /Users/mymac/MyProjects/MyGitSources/books_grails/books
Resolving dependencies...
Dependencies resolved in 862ms.
Running script /Users/mymac/springsource/grails-1.3.7/scripts/RunApp.groovy
Environment set to development
[copy] Copying 1 file to /Users/mymac/.grails/1.3.7/projects/books
WARNING: No default container found, installing Tomcat..
Resolving plugin tomcat. Please wait...
Error executing script RunApp: java.lang.ClassNotFoundException: org.grails.tomcat.TomcatServerFactory
java.lang.ClassNotFoundException: org.grails.tomcat.TomcatServerFactory
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:391)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)
Caused by: java.lang.ClassNotFoundException: org.grails.tomcat.TomcatServerFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java_lang_ClassLoader$loadClass.call(Unknown Source)
at _GrailsRun_groovy$_loadServerFactory_closure11.doCall(_GrailsRun_groovy:85)
at _GrailsRun_groovy.loadServerFactory(_GrailsRun_groovy:101)
at _GrailsRun_groovy.this$4$loadServerFactory(_GrailsRun_groovy)
at _GrailsRun_groovy$this$4$loadServerFactory.callCurrent(Unknown Source)
at _GrailsRun_groovy.runInline(_GrailsRun_groovy:114)
at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
at RunApp$_run_closure1.doCall(RunApp:33)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
... 10 more
--- Nested Exception ---
java.lang.ClassNotFoundException: org.grails.tomcat.TomcatServerFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java_lang_ClassLoader$loadClass.call(Unknown Source)
at _GrailsRun_groovy$_loadServerFactory_closure11.doCall(_GrailsRun_groovy:85)
at _GrailsRun_groovy.loadServerFactory(_GrailsRun_groovy:101)
at _GrailsRun_groovy.this$4$loadServerFactory(_GrailsRun_groovy)
at _GrailsRun_groovy$this$4$loadServerFactory.callCurrent(Unknown Source)
at _GrailsRun_groovy.runInline(_GrailsRun_groovy:114)
at _GrailsRun_groovy.this$4$runInline(_GrailsRun_groovy)
at _GrailsRun_groovy$_run_closure1.doCall(_GrailsRun_groovy:59)
at RunApp$_run_closure1.doCall(RunApp:33)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)
Error executing script RunApp: java.lang.ClassNotFoundException: org.grails.tomcat.TomcatServerFactory
[UPDATE]:
When I tried to install the mail plugin in my new working project again, The same error is reproduced if I try to run my application. Somehow the plugin is screwing up my application. Now I don't know how the plugins are installed and what they change in a project :-(
Thanks!!
Posting it as an answer just in case anybody needs to find a solution...
I removed all the projects from under ~/.grails and also cleared the files that had my Project references. I re-imported my project into STS and it started to work again.
I guess the issue was because of the mail plugin. Since my maven repositories was commented out in the BuildConfig.groovy
//mavenLocal()
//mavenCentral()
installation of plugin failed and somehow messed up my project. I created a temp project, installed these plugins with the above lines uncommented, cleaned the original project as mentioned above and re-built my project.
Since now my plugins are locally available, I was able to install them into my main project without any hassle.
Though not a clean one and not sure if there is an existing issue with the failed plugin installations, I am posting this in case anyone runs into the same issue again!
Thanks!!

Resources