Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin breaks Grails 3.2.11 #43

Closed
hugheba opened this issue Jun 28, 2017 · 14 comments
Closed

Plugin breaks Grails 3.2.11 #43

hugheba opened this issue Jun 28, 2017 · 14 comments

Comments

@hugheba
Copy link

hugheba commented Jun 28, 2017

If you create a fresh Grails 3.2.11 project and add the dependency

runtime 'org.grails.plugins:grails-melody-plugin:1.67.0'

You'll get errors with Taglibs.

I created a simple view with a g:link and am getting this error.

`2017-06-28 11:46:53.983 ERROR --- [nio-8972-exec-1] .a.c.c.C.[.[.[.[grailsDispatcherServlet] : Servlet.service() for servlet [grailsDispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.grails.gsp.GroovyPagesException: Error processing GroovyPageView: [views/index/index.gsp:12] Error executing tag <g:link>: No signature of method: java.lang.String.encodeAsHTML() is applicable for argument types: () values: []
Possible solutions: encodeAsHex(), encodeAsSHA1(), encodeAsMD5(), encodeAsSHA256()] with root cause

groovy.lang.MissingMethodException: No signature of method: java.lang.String.encodeAsHTML() is applicable for argument types: () values: []
Possible solutions: encodeAsHex(), encodeAsSHA1(), encodeAsMD5(), encodeAsSHA256()`

Mac OS X 10.12.5
Java 1.8.131
Grails 3.2.11

@evernat
Copy link
Member

evernat commented Jul 1, 2017

Sorry, I do not reproduce the issue.
By using the sample project at https://github.com/evernat/grails-ssl it works correctly with Grails 3.2.11 and Java 1.8. https://localhost:8443/ and https://localhost:8443/monitoring are OK.
What would cause this sample project to break?

@jglapa
Copy link

jglapa commented Jul 5, 2017

@evernat just add <g:link controller="test">foo</g:link> to index.gsp and it will start throwing the exception

@jglapa
Copy link

jglapa commented Jul 5, 2017

This was also raised by me in grails repo: grails/grails-core#10715

@demon101
Copy link

demon101 commented Jul 9, 2017

I got the same bug.
Can be reproduced by line in BootStrap.init:
"some text".encodeAsLink()

As I remember, I have had got same error in Grails 3.2.10

@evernat Any workarounds?

@demon101
Copy link

demon101 commented Jul 9, 2017

@graemerocher suggested in grails/grails-core#10715:

My guess is something to do with the Groovy version, Groovy 2.4.11 is used in 3.2.11

@evernat
Copy link
Member

evernat commented Jul 9, 2017

As said in grails/grails-core#10715 (comment), it seems to be caused by a regression between groovy 2.4.8 and groovy 2.4.9.
To workaround the issue, you may want to add compile 'org.codehaus.groovy:groovy-all:2.4.8' in the dependencies of the build.gradle file of your app.

@evernat evernat closed this as completed Jul 9, 2017
@demon101
Copy link

demon101 commented Jul 10, 2017

@evernat using groovy 2.4.8 with grails 3.2 acceptable only as a workaround.
Old version of groovy as long term solution -- bad idea. For example, a performance of Groovy 2.4.10 has been improved by 15-20 %.

Do you plan to fix the plugin?

@graemerocher
Copy link

I recommend reporting the issue to the Groovy issue tracker grails/grails-core#10715

@jglapa
Copy link

jglapa commented Jul 12, 2017

@evernat would it be possible to test the following:

Perhaps the issue goes away if the plugin itself is build by groovy > 2.4.9 ?

@evernat
Copy link
Member

evernat commented Jul 12, 2017

@jglapa @sergiomichels
It seems that building the grails-melody-plugin with the following in gradle.properties of the plugin fixes this issue:

grailsVersion=3.2.11
grailsWrapperVersion=1.0.0
gradleWrapperVersion=3.4.1

But I am not sure of what I was doing in the plugin for testing this. Sergio, could you check that this change in the plugin will fix the error displayed by the sample project: https://github.com/evernat/grails-ssl ?

@evernat evernat reopened this Jul 12, 2017
@jglapa
Copy link

jglapa commented Jul 24, 2017

@jukin-jerry
Copy link
Contributor

Created #50

@jukin-jerry
Copy link
Contributor

jukin-jerry commented Aug 2, 2017

The Pull Request (50) above does indeed fix the problem described in this ticket under Grails 3.3.0, but a new problem emerges: now melody does not load at startup. The only other change is upgrading the java-melody-core dependency to 1.68.1.

Here are the messages at application startup, indicating the problem.

2017-08-02 02:42:16.422  INFO 11581 --- [  restartedMain] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@4443b126: startup date [Wed Aug 02 02:42:16 UTC 2017]; root of context hierarchy
2017-08-02 02:42:18.038  WARN 11581 --- [  restartedMain] org.grails.plugins.CorePluginFinder      : [GrailsPluginManager] Core plugin [grails.melody.plugin.GrailsMelodyPluginGrailsPlugin] not found, resuming load without..

@evernat
Copy link
Member

evernat commented Oct 25, 2017

PR #50 is merged. Thanks to all and in particular to @graemerocher and @bassmartin.

@evernat evernat closed this as completed Oct 25, 2017
bassmartin pushed a commit to bassmartin/grails-melody-plugin that referenced this issue Aug 7, 2018
… services and other stuff. This makes intercepting all service calls work as they were a while ago. The code is done in the doWithSpring to avoid removing metaclass changes done by Grails (see javamelody#43)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants