Grails clean command throwing Null Pointer Exception - grails

We are planning to upgrade Grails for our application from version 2.0.1 to 3.1.1. On executing
grails clean --stacktrace --verbose
I am getting the exception given below:
| Error Error occurred running Grails CLI: null
java.lang.NullPointerException
at org.grails.cli.GrailsCli.initializeProfile(GrailsCli.groovy:504)
at org.grails.cli.GrailsCli.initializeApplication(GrailsCli.groovy:308)
at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:271)
at org.grails.cli.GrailsCli.main(GrailsCli.groovy:162)
| Error Error occurred running Grails CLI: null
I also tried by setting GRAIL_OPTS but it is still not working.
set GRAILS_OPTS="-XX:-UseSplitVerifier -Xverify:none"
Environment details:
| Grails Version: 3.1.1
| Groovy Version: 2.4.5
| JVM Version: 1.8.0_74
Any pointers will be appreciated.
Thanks.

In a grails 3.2.11 project you would solve this in the following way.
Look in /gradle.properties to see what grailsVersion is set to. Mine looks like this:
grailsVersion=3.2.11
Open a command window and check your grails version
$ grails -version
| Grails Version: 3.2.11
| Groovy Version: 2.4.11
| JVM Version: 1.8.0_144
They should match. If they do not, use sdkman to set or install the correct version
$ sdk list grails
================================================================================
Available Grails Versions
================================================================================
* 3.3.3 3.2.12 3.1.14 3.0.17
* 3.3.2 > * 3.2.11 3.1.13 3.0.16
3.3.1 3.2.10 3.1.12 3.0.15
* 3.3.0.RC1 3.2.1 3.1.11 3.0.14
3.3.0.M2 3.2.0 3.1.10 3.0.13
* 3.3.0.M1 3.1.9 3.1.1 3.0.12
3.3.0 3.1.8 3.1.0 3.0.11
* 3.2.9 3.1.7 3.0.9 3.0.10
* 3.2.8 3.1.6 3.0.8 3.0.1
3.2.7 3.1.5 3.0.7 3.0.0
3.2.6 3.1.4 3.0.6 * 2.5.6
3.2.5 3.1.3 3.0.5 * 2.5.5
* 3.2.4 3.1.2 3.0.4 * 2.5.4
* 3.2.3 3.1.16 3.0.3 2.5.3
3.2.2 3.1.15 3.0.2 2.5.2
================================================================================
+ - local version
* - installed
> - currently in use
================================================================================
If you don't see your version, install it
$ sdk install grails 3.2.11
Then set it to your default
$ sdk default grails 3.2.11

Generally, this exception is encountered when you try to run Grails CLI (grails command) within a directory holding an app based on an older version of Grails.
Also it's always worth checking the $PWD for leftovers of a previous Grails app.

Related

unable to upgrade to ruby 3.1.2

I am trying to upgrade ruby version 3.1.2 I am getting this error and when it says to install messing dependencies I get the error unable to locate the package now my ruby version is 2.7.4 and I installed using rbenv, and I use Ubuntu 21.10

How fix rails errors installation?

When Running this command
rails new test --api
I found this error
/.rbenv/versions/2.5.0/lib/ruby/gems/2.5.0/gems/railties-6.0.2.1/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt:10: syntax error, unexpected ')', expecting end-of-input (SyntaxError)); if spring_install?
what is the solution??
this error face in 2.5.0 version ,
so you can install ruby 2.5.3
rbenv install -l
this will tell you the versions of ruby like that
2.5.0
2.5.1
2.5.2
2.5.3
2.5.4
2.5.5
2.5.6
2.5.7
then run this
rbenv install 2.5.3
rbenv global 2.5.3
gem install rails

How to upgrade Grails 2.4 to 2.5

How to upgrade Grails 2.4.4 to 2.5.0 ?
I am using STS
Version: 3.6.4.RELEASE
Build Id: 201503100339
Platform: Eclipse Luna SR1 (4.4.2)
Grails 2.4.4.
Mac 10.10
Java jdk1.8.0_45.jdk
The grails upgrade command is gone from 2.4. You have to run set-grails-version
grails set-grails-version 2.5.6
Then go into BuildConfig.groovy and manually upgrade your dependencies/plugins:
https://github.com/grails/grails-core/releases/tag/v2.5.0

how to Upgrade grails 1.3.7 project into grails 2.2.1 using GGTS 3.2.0

I have imported the grails 1.3.7 project into grails 2.2.1 using ggts 3.2.0. I have changed grails version,hibernate
and tomcat version with 2.2.1 in application.properties file. But i am getting the following Error
Error loading plugin manager: java.lang.NoClassDefFoundError: org/springframework/core/convert/support/PropertyTypeDescriptor
Because GGTS's Grails dependencies spring core 3.1.1 have not PropertyTypeDescriptor. What is a solution?
Run grails dependency-report to see if there is any clashing dependency for spring core.

Upgrading webxml 1.4 to 1.4.1

I have an irritating problem with webxml plugin. I need version 1.4.1. I have webxml 1.4 and when I try to upgrade it from STS 2.8.1 it gets upgraded but it's like it rolls back the changes immediately. I also tried upgrading it from Grails console and from command prompt. When I upgrade webxml from command promt it gets upgraded but then in STS I lose dependencies. And when I refresh dependencies from Grails tools STS downgrades webxml to 1.4. Please help.
Grails 1.3.7
STS 2.8.1
Plugins:
calendar 1.2.1
hibernate 1.3.7
mail 1.0-SNAPSHOT
spring-security-core 1.2.6
tomcat 1.3.7
That's coming from the spring-security-core dependencies - update spring-security-core to 1.2.7.1.

Resources