groovy.lang.MissingMethodException | Community
Skip to main content
New Member
November 28, 2022
Solved

groovy.lang.MissingMethodException

  • November 28, 2022
  • 1 reply
  • 2979 views

Has anyone run into the issue, when attempting to run a Groovy script in the "generic" script console?

I am trying to run what I assume is a valid script (I got it from https://hashimkhan.in/aem-adobecq5-code-templates/groovy-script/  )

 

The script is:

import javax.jcr.Node

noOfPages = 0
path = '/content/dam/we-retail/en/products/apparel/'
findAllPages()


def findAllPages() {
getPage(path).recurse {
page ->
println 'Title:' + page.title
println 'Path:' + page.path
noOfPages++
}
}

 

The error I receive is:

groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getPage()

 

Has anyone run into this?

 

Thanks in advance, 

Glenn

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Avinash_Gupta_

Hi @geveret 

 

Download the Groovy console package from the below path:-

 

  1. Download the console package. Install this package

  2. Verify the installation.

Once package installation is done,

1. Go to system/console/configmgr and search for Groovy Console Configuration Service

2. Configure the Allowed Groups for script execution. List of group names that are authorized to use the console. By default, only the 'admin' user has permission to execute scripts.

 

Try this it should work but in case if it's not let me now what's the AEM instance version you are trying to run the groovy console on and what's the service packs deployed on it?

1 reply

Avinash_Gupta_
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
November 29, 2022

@geveret I tried it in my system and it works perfectly fine. Difference between your script and mine is that I ran it for content pages instead of images and when I tried to run for assets, got a null pointer exception.  I think the script that you have mentioned works only for the content pages not for the dam assets. Try updating the content page path instead of dam path in your script and let me know if you are still facing this issue.

 

 

Hope this helps!

geveretAuthor
New Member
November 30, 2022

Thanks for the reply, but I'm still getting the same error, regardless of the content.

I have another issue, in that I'm using the generic script console because my Groovy console does not display the buttons, and I can't execute scripts with it.  I had opened a separate ticket with Adobe on this and they have not been able to help me.  You don't by chance know why I don't see the buttons do you?

Avinash_Gupta_
Community Advisor and Adobe Champion
Avinash_Gupta_Community Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
November 30, 2022

Hi @geveret 

 

Download the Groovy console package from the below path:-

 

  1. Download the console package. Install this package

  2. Verify the installation.

Once package installation is done,

1. Go to system/console/configmgr and search for Groovy Console Configuration Service

2. Configure the Allowed Groups for script execution. List of group names that are authorized to use the console. By default, only the 'admin' user has permission to execute scripts.

 

Try this it should work but in case if it's not let me now what's the AEM instance version you are trying to run the groovy console on and what's the service packs deployed on it?