Exception running 'grails clean' after upgrade to Grails 4.0.2

434 views
Skip to first unread message

Milan Zimmermann

unread,
Mar 24, 2020, 10:34:00 PM3/24/20
to Grails Dev Discuss
After upgrading to  Grails 4.0.2, on an existing project, I get an error:

grails clean --stacktrace --verbose
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/home/mzimmermann/software/java-based/grails/lib/org.codehaus.groov
y/groovy/jars/groovy-2.5.6.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
| Error Error occurred running Grails CLI: null
java.lang.NullPointerException
       at org.grails.cli.GrailsCli.initializeProfile(GrailsCli.groovy:515)
       at org.grails.cli.GrailsCli.initializeApplication(GrailsCli.groovy:306)
       at org.grails.cli.GrailsCli.execute(GrailsCli.groovy:269)
       at org.grails.cli.GrailsCli.main(GrailsCli.groovy:159)
| Error Error occurred running Grails CLI: null


I tried multiple things with no luck. I am tracing this issue by looking at Grails sources:

this.profile = profileRepository.getProfile(profileName)

and from there to 

createMavenProfileRepository()

where it looks like 

def profileRepos = getSetting(BuildSettings.PROFILE_REPOSITORIES, Map.class, Collections.emptyMap())

is getting a null profileRepos. But I am not sure what to do; there was no issue in the previous version of Grails: 2.2.0

Anyone has any pointers?

Thanks



Jeff Scott Brown

unread,
Mar 25, 2020, 11:03:46 AM3/25/20
to Grails Dev Discuss

Are you using Java 7?

Grails 4 is not compatible with Java 7.




Jeff

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/83a0886c-4fa3-443d-b4b7-b6b6387fc4a1%40googlegroups.com.


--
Jeff Scott Brown
Partner and Practice Lead, Grails and Micronaut

Disruptive solutions for a connected world.™
http://objectcomputing.com

Autism Strikes 1 in 166
Find The Cause ~ Find The Cure
http://www.autismspeaks.org/

Milan Zimmermann

unread,
Mar 25, 2020, 12:31:45 PM3/25/20
to Grails Dev Discuss
Thanks for getting back! I am using Java 11. Only Java 11 present on my system. Java, Groovy and Grails configured manually  using GROOVY_HOME and GRAILS_HOME. I am quite confident that part of the configuration is correct.

I should also say that on a freshly created app 'grails create-app' the 'grails clean' works. The problem is on an existing project (rather large) that I am trying to migrate. That was using Java 7 and I assume the reference to /home/mzimmermann/software/java-based/grails/lib/org.codehaus.gro
ovy/groovy/jars/groovy-2.5.6.jar
 
is from an pre-existing plugin.

Thanks
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.

Milan Zimmermann

unread,
Mar 25, 2020, 2:05:00 PM3/25/20
to Grails Dev Discuss
I wanted to say, I just managed to solve the 'grails clean' exception by creating a project with the same name, and gradually copying over some elements of the project. 

I still am having a huge amount of compile issues, but at least a step ahead.

To ask for help, what venue would you recommend? Slack? StackOverflow? 

Thanks again for getting back to me.

Jeff Scott Brown

unread,
Mar 25, 2020, 2:41:51 PM3/25/20
to Grails Dev Discuss
On 25 Mar 2020, at 13:05, Milan Zimmermann wrote:

> I wanted to say, I just managed to solve the 'grails clean' exception
> by
> creating a project with the same name, and gradually copying over some
> elements of the project.

We have done many many upgrades and in general, that is the approach
that I advocate for. Having done it a bunch, it really isn’t as
tedious as it might sound at first. That usually goes quite smoothly.
I am glad you got it worked out.

>
> I still am having a huge amount of compile issues, but at least a step
> ahead.
>
> To ask for help, what venue would you recommend? Slack? StackOverflow?
>

There won’t be a general answer to how to fix compilation issues. The
resolutions will depend on what the errors are.

You can ask questions about how to address those here on the mailing
list, or in Slack, or on StackOverflow. Most folks have migrated away
from the mailing list in favor of the other 2, Slack for conversational
questions and StackOverflow for specific questions that have a specific
answer (not likely to require a discussion).

I hope that helps.



JSB

Milan Zimmermann

unread,
Mar 27, 2020, 12:18:25 AM3/27/20
to Grails Dev Discuss
Thanks James. I will follow up on slack or stackoverflow - while making steps ahead, still having an overwheliming amount of issues and uncertainties. The differences between Grails 2.2 and 4 (well, 3 really) as huge on the size of app we have here.

Appreciate your help!

Milan

Jeff Scott Brown

unread,
Mar 27, 2020, 2:02:09 PM3/27/20
to Grails Dev Discuss
On 26 Mar 2020, at 23:18, Milan Zimmermann wrote:

> Thanks James. I will follow up on slack or stackoverflow - while
> making
> steps ahead, still having an overwheliming amount of issues and
> uncertainties. The differences between Grails 2.2 and 4 (well, 3
> really) as
> huge on the size of app we have here.
>
> Appreciate your help!
>

We have updated scores of apps from Grails 2 to Grails 3 and more
recently Grails 4. If there is anything we can do to help, never
hesitate to reach out. We are happy to help.

Milan Zimmermann

unread,
Mar 27, 2020, 6:24:01 PM3/27/20
to Grails Dev Discuss
Thank you, will do that. I still feel I am able to move along for now. Not sure the direction is right, just making a step-by-step to get rid of errors as they show up.
Reply all
Reply to author
Forward
0 new messages