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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Jacek Furmankiewicz
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

Graeme Rocher-2
Did you move it around? Try and do a clean

Cheers


On Mon, May 2, 2016 at 9:24 PM, Jacek Furmankiewicz <[hidden email]> wrote:
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

--
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 [hidden email].
To post to this group, send email to [hidden email].
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.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/1462985006336-ee3a5856-928a7866-a6be97c4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

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

ajayjain01
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

On Wednesday, 11 May 2016 22:13:29 UTC+5:30, Graeme Rocher wrote:
Did you move it around? Try and do a clean

Cheers

Graeme

On Mon, May 2, 2016 at 9:24 PM, Jacek Furmankiewicz <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="N1GSyW4SJgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jac...@...> wrote:
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

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="N1GSyW4SJgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">grails-dev-discuss+unsubscribe@....
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="N1GSyW4SJgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">grails-de...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/grails-dev-discuss/8734a649-c240-44bc-be60-c0383ddbf684%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/grails-dev-discuss/8734a649-c240-44bc-be60-c0383ddbf684%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/grails-dev-discuss/8734a649-c240-44bc-be60-c0383ddbf684%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/grails-dev-discuss/8734a649-c240-44bc-be60-c0383ddbf684%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/be8f7782-2987-472f-b3ec-593cb2171973%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...