icfnext / aem-groovy-console

The AEM Groovy Console provides an interface for running Groovy scripts in the AEM container. Scripts can be created to manipulate content in the JCR, call OSGi services, or execute arbitrary code using the CQ, Sling, or JCR APIs.
Other
159 stars 94 forks source link

Unresolved compilation problem #52

Closed royteeuwen closed 7 years ago

royteeuwen commented 7 years ago

After installing the aem groovy console 8.0.2 on an AEM 6.1-SP2, I get the following exception:

Unresolved compilation problem: The type groovy.lang.GroovyObject cannot be resolved. It is indirectly referenced from required .class files

Exception:

java.lang.Error: Unresolved compilation problem: 
    The type groovy.lang.GroovyObject cannot be resolved. It is indirectly referenced from required .class files
at org.apache.jsp.apps.groovyconsole.components.console.head_jsp.<init>(head_jsp.java:1)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)

This is on author, on publish it works. Any clue on how to fix this? Can I clear some cache files somwehere?

Greets Roy

markdaugherty commented 7 years ago

Is the groovy-all bundle started and running on author? Outside of more rare/unusual OSGi container issues, the typical cause for unresolved Groovy classes is a missing or not-running bundle.

royteeuwen commented 7 years ago

Hey,

Jup, all the bundles are running

Greets, Roy

screen shot 2017-01-12 at 15 56 14 screen shot 2017-01-12 at 15 56 37 screen shot 2017-01-12 at 15 57 25

markdaugherty commented 7 years ago

OK, now we're getting into more obscure causes... let me get an SP2 instance running and see if I can replicate your issue. Thanks for your patience!

royteeuwen commented 7 years ago

Hey @lykorian,

Thanks! Just to make sure that you have all the info ;) this is an updated AEM from AEM 5.6.1 which used to have the groovy console version 5 running on it. I am not sure if that has anything to do with it though, seeing as it did work for a while after the upgrade..

Greets, Roy

toniedzwiedz commented 7 years ago

@royteeuwen I vaguely recall running into similar issues when we upgraded the console from 5.. to 8+ on one of my projects.

IIRC that had to do with the fact that the CRX Package name changed between versions, from cq-groovy-console to aem-groovy-console so simply uploading the new package and installing it did not update the old version. It was treated as a separate package, not a new version of the same thing.

Make sure version 5 is properly uninstalled. Remove the contents of /etc/groovyconsole as well as the CRX Package and the OSGi bundles (it's possible you still have the old ones running).

Check /var/classes for potentially cached JSPs and wipe them out as well.

After a thorough cleanup of the old version, restarting the instance and installing the new console, it started working for me.