'Could not find or load main class' after upgrading to latest Grails

60 views
Skip to first unread message

Jacek Furmankiewicz

unread,
May 2, 2016, 3:24:21 PM5/2/16
to Grails Dev Discuss
I am attempting to port an ancient version of Grails to the latest and greatest of everything.
However, when trying to run

    gradlew bootRun

I get this error

    Could not find or load main class

I am not sure why it is not finding my main class, it is sitting in the proper default package name (gsp in the case of this app):


package gsp

import grails.boot.GrailsApp
import grails.boot.config.GrailsAutoConfiguration

class Application extends GrailsAutoConfiguration {
 
static void main(String[] args) {
 
GrailsApp.run(Application, args)
 
}
}



located in 'grails-app/init/gsp/Application.groovy'.

Is there some reason Grails cannot find this class? Do I need to set some other config file to point to it?

Thank you
Jacek

Graeme Rocher

unread,
May 11, 2016, 12:43:29 PM5/11/16
to grails-de...@googlegroups.com, Grails Dev Discuss
Did you move it around? Try and do a clean

Cheers

Graeme

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-disc...@googlegroups.com.
To post to this group, send email to grails-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/8734a649-c240-44bc-be60-c0383ddbf684%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ajay Jain

unread,
Jul 13, 2017, 1:56:57 AM7/13/17
to Grails Dev Discuss
Hi,

I am facing the same issue with run-app which is failing at bootRun. And when run >gradlew bootRun i see 
Error: Could not find or load main class <app>.Application

I have upgraded an app from grails 2.4.3 to 3.2.10. I am able to 
  1. run the application using Application.groovy
  2. generate war file 
  3. deploy the same in tomcat

I have tried moving around Application.groovy, did grails clean, gradlew clean, project clean in ggts,
Also i can see Application.class sitting under build folder 


Regards,
Ajay
Cheers

Graeme

To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages