Code Monkey home page Code Monkey logo

grails-gsp's Introduction

grails-gsp's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grails-gsp's Issues

Comparison issue in select TagLib

Hello,

I'm mainly a JS developer. I have found a glitch marking items as selected in g:select TagLib, I have discovered that the comparison between a string "0" and a Long("48") is equals, strong "1" is equals to Long("49") till string "9" is equals to Long("57").

I have made a little gist (https://groovyconsole.appspot.com/edit/5164137747316736)

def num = new Long("48")
def str = "0"
println(num == str)​

And here is the exact line where the comparison is made

Maybe changing that comparison to a strict comparison will fix the problem.

Regards

MetaClass Updates on TagLibs with missing properties causing thread blocks under load

While profiling a Grails 4 application, we observed some thread blocking that was root caused to meta class updates occuring withing the propertyMissing method of the TagLibrary trait.

See: https://github.com/grails/grails-gsp/blob/4.0.x/grails-web-taglib/src/main/groovy/grails/artefact/TagLibrary.groovy#L128

What appears to be occurring, is that in non-development environments if a result is identified for a missing property, the ExpandoMetaClass for the class is retrieved and updated so that subsequent attempts to use the same property will not need to be retrieved. That logic is present here:

if (result != null && !Environment.isDevelopmentMode()) {
  MetaClass mc = GrailsMetaClassUtils.getExpandoMetaClass(getClass())
  TagLibraryMetaUtils.registerPropertyMissingForTag(mc, name, result);
}

In practice, the ExpandoMetaClass change impacts tag libraries that extend from the updated tag library, but not the existing instance of the tag library itself. This repeat lookups for missing properties and repeat updates to the ExpandoMetaClass even though the change has already been made.

Task List

  • Steps to reproduce provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. See: https://github.com/JasonTypesCodes/tag-missing-prop
  2. Run the application with: ./gradlew bootRun -Dgrails.env=test -- It is important that it isn't run in development mode.
  3. Retrieve the index curl http://localhost:8080/
  4. Retrieve the index an additional time

Expected Behaviour

There should not be more than one instance of the printed message showing for ChildTagLib or SomeTagLib

Actual Behaviour

You will see 1 hit to ChildTagLib and multiple hits to SomeTagLib. Subsequent requests will continue to show hits to SomeTagLib (But not ChildTagLib because the ExpandoMetaClass update of the parent impacts the child tag lib correctly.

Environment Information

  • Operating System: Debian Linux
  • Grails Version: 4.1.2
  • JDK Version: openjdk version "1.8.0_302"

Example Application

groovyTemplateEngine.writeTo(out) throws nullpointer when executed ASYNC (in a task)

Thanks for reporting an issue for Grails framework, please review the task list below before submitting the
issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.

NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (http://stackoverflow.com/tags/grails) or Slack (http://slack-signup.grails.org). DO NOT use the issue tracker to ask questions.

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Full description

We have code that processes GSP templates from a database for emails so they can be edited regularly. When using the GroovyPagesTemplateEngine within ASYNC code a nullpointer is thrown from the method writeTo(). Outside of a promise task everything works fine.

There is no stacktrace.

Steps to Reproduce

  1. take mrhaki example from blog
    http://mrhaki.blogspot.com/2010/05/grails-goodness-use-gsp-template-engine.html
    and execute within futures task

  2. Code to reproduce issue

Example service with test method that displays issue:

class TestService {
def groovyPagesTemplateEngine
void test() {
def p1 = task{

    def templateText = '''\

GSP Template Engine

This is just a sample with template text.

<g:if test="${show}">

We can use taglibs in our template!

</g:if>

  • ${item}
''' def output = new StringWriter() groovyPagesTemplateEngine.createTemplate(templateText, 'sample').make([show: true, items: ['Grails','Groovy']]).writeTo(output) output.toString() } p1.onComplete{ results -> log.info(results) } } }

Expected Behaviour

nullpointer not thrown when executed async.

Actual Behaviour

nullpointer is thrown from groovyPagesTemaplteEngine.writeTo() when executed from within promise.

Environment Information

  • Operating System: Mac OS/X
  • Grails Version: 3.2.11
  • JDK Version: 1.8
  • Container Version (If Applicable): N/A

Example Application

  • the entire example code is within this issue in steps to reproduce.

I am copying it here as well.

class TestService {
def groovyPagesTemplateEngine
void test() {
def p1 = task{

    def templateText = '''\

GSP Template Engine

This is just a sample with template text.

<g:if test="${show}">

We can use taglibs in our template!

</g:if>

  • ${item}
''' def output = new StringWriter() groovyPagesTemplateEngine.createTemplate(templateText, 'sample').make([show: true, items: ['Grails','Groovy']]).writeTo(output) output.toString() } p1.onComplete{ results -> log.info(results) } } }

f:table collection is generating invalid hyperlinks in Grails 3.3.2

Hello There,

I have unidirectional Domain class in my project, List page generated with invalid hyperlinks.
<td><a href="/parent/show/1"><a href="/child/show/1">com.sample.Child : 1</a></a></td>

Steps to re-produce the issue

Grails 3.3.2
grails create-app Grails3-UniDirectional-Relationship
grails create-domain-class com.sample.Child
grails create-domain-class com.sample.Parent

Add two properties in Child class
package com.sample
class Child {

String name
String description

static constraints = {
}

}

Add Child property in Parent class like below
package com.sample
class Parent {

//Parent - to - Child (One-To-One) UniDirectional
Child child
static constraints = {
}

}

Generare controllers and views
grails generate-all com.sample.Child
grails generate-all com.sample.Parent

check: parent/index.gsp has <f:table collection="${parentList}" />

Run-app
grails run-app or Run Application.groovy

Add new child
http://localhost:8080/child/create
give values for name and desctiption

Add new parent
http://localhost:8080/parent/create
select a child* (created earlier) and save

Now go to Parent list page
http://localhost:8080/parent/index

List page has Child1 Which has hyperlink of Child1
If you click that , it leads to http://localhost:8080/child/show/1 instead of http://localhost:8080/parent/show/1

See view-source of Parent list page (view-source:http://localhost:8080/parent/index),
you will find like this
<td><a href="/parent/show/1"><a href="/child/show/1">com.sample.Child : 1</a></a></td>

/parent/show/1 override by /child/show/1

if we repeat this in Grails 2.4.4 or any 2.x version
parent/index.gsp has below tag to list the values and its working fine
<g:each in="${parentInstanceList}" status="i" var="parentInstance"><tr class="${(i % 2) == 0 ? 'even' : 'odd'}"><td><g:link action="show" id="${parentInstance.id}">${fieldValue(bean: parentInstance, field: "child")}</g:link></td></tr></g:each>

Please suggest how can we disable or not to appear child hyperlink (/child/show/1). Or any fix for this in Grails 3.3.2

Thanks

grails-web-taglib:4.1.0.M3 bad JAR file structure breaks sitemesh layouts when running via JAR

The grails-web-taglib 4.1.0.M3 jar has two META-INF/grails.factories entries in the zip manifest:

Archive:  /Users/leebutts/.gradle/caches/modules-2/files-2.1/org.grails/grails-web-taglib/4.1.0.M3/5336cff5cb5d53b6ae06611d5dbeb281dd7335b0/grails-web-taglib-4.1.0.M3.jar
Zip file size: 34973 bytes, number of entries: 47
...
-rw-r--r--  2.0 unx      137 b- defN 20-Dec-14 17:04 META-INF/grails.factories
...
-rw-r--r--  2.0 unx      183 b- defN 20-Dec-14 17:04 META-INF/grails.factories
47 files, 64608 bytes uncompressed, 27503 bytes compressed:  57.4%

The first smaller grails.factories is missing

org.grails.taglib.encoder.OutputContextLookup=org.grails.web.taglib.encoder.WebOutputContextLookup

This causes sitemesh layouts to fail when running via the executable jar (WebOutputContextLookup is not loaded so DefaultOutputContextLookup is used) but it works via run-app which for some reason will load the second entry.

g:checkBox name attribute is not escaped, allowing potential XSS attacks

Steps to Reproduce

  1. Create a checkBox element in a gsp with a specially crafted name attribute, which involves closing the raw input tag's name attribute.
    e.g. `<g:checkBox name='" onClick="console.log(1)"' />
  2. Load the gsp with the malicious checkbox and click it.

Expected Behaviour

Nothing. The name attribute is treated as a literal string.

Actual Behaviour

In the example given above in the Steps to Reproduce, clicking the checkbox will log a 1 in the console, as the onclick piece of the value for the name attribute is treated as a literal attribute.

Environment Information

  • Operating System: Arch Linux 5.3.13
  • Grails Version: 4.0.0
  • JDK Version: 1.8.0_232

Example Application

https://github.com/zack-baker/demo-grails-checkbox-vulnerability

On its own, this issue is not of major concern, since a developer would be unlikely to intentionally exploit this vulnerability maliciously in their own application. However if (for whatever reason) an application allows users to submit values which are then used as the name attributes for checkbox elements in the future, users could submit malicious values to undesireably alter the checkbox for future users.

g:render with body and g:set bug

Task List

  • Full description of the issue provided (see below)
  • Steps to reproduce provided
  • Example that reproduces the problem uploaded to Github

Steps to Reproduce

index.gsp:

<g:render template="someTemplate">
    <g:set var="someVariable" value="Yes!"/>
    value: ${someVariable}
</g:render>

someTemplate.gsp

<%@ page contentType="text/html;charset=UTF-8" %>
Bla bla!
${raw(body())}
End

Expected Behaviour

render

Bla bla!
value: Yes
End

Actual Behaviour

Bla bla!
value:
End

Variable value is missing, null

Can be fixed by moving set out of render:

<g:set var="someVariable" value="Yes!"/>
<g:render template="someTemplate">
    value: ${someVariable}
</g:render>

Environment Information

  • Grails Version: 3.1.15, 3.2.8

Example Application

https://github.com/demon101/grails-trigers/tree/master/grails-app/views/test

g:formatDate doesn't fully support LocalDate

Generally speaking, grails fully supports LocalDate as a replacement for Date. However I found a bug where it doesn't work.

<g:formatDate date="${ java.time.LocalDate.now()}"/>

Error processing GroovyPageView: [views/index.gsp:32] Error executing tag <g:formatDate>: Unsupported field: HourOfDay

Note that this does work:

<g:formatDate date="${ java.time.LocalDate.now()}" format="yyyy-MM-dd"/>

as does this:

<g:formatDate date="${ new java.util.Date()}"/>

Oh, one other thing... since g:formatDate actually seems supposed to support times as well... according to the documentation... it should really support LocalDateTime as well. The Date class needs to be consigned to the dustbin of history, and Grails domain classes seem to support LocalDate and LocalDateTime just fine, so grails is oh so close to being fully compliant. But LocalDateTime scenarios don't seem to work at all.

It would also be nice if the documentation for g:formatDate was updated to mention LocalDate
`

Task List

Put this in your GSP

<g:formatDate date="${ java.time.LocalDate.now()}"/>

crash

Expected Behaviour

Not crash.

Actual Behaviour

Error processing GroovyPageView: [views/index.gsp:32] Error executing tag <g:formatDate>: Unsupported field: HourOfDay

Environment Information

  • Grails Version: 4.0.9
  • JDK Version: 8

Query in Grails, IMPORTANT

I have a table consisting of 2 parameters(name and calendar).I have created the dropdown using <g:select> tag that consists list of names from the table,on selection I want to fetch the corresponding calendar and display it.Any idea how can I fetch the calendar related to name?

this is my gsp code which gives list of names as dropdown

<g:select class="form-control" id="savedCalendar" name="savedCalendar.id" noSelection="['null':'']" from="${globalCalendar?.name}" onchange="return showcal()"/>

what should I do in function so that I can fetch calendar and display it

`function showcal(){

       ????

}`

Please guide me on this, I searched everywhere and coudn't get the approach for this
Thanks in advance

Missing JSP feature: dynamic attributes

Steps to Reproduce

  1. Use any JSP taglib that utilizes dynamic attributes

Expected Behaviour

The JSP tag is properly rendered.

Actual Behaviour

The actual error depends on the tag implementation, but the issue is that Grails doesn't pass the dynamic attributes to the tag implementation through the DynamicAttributes interface.

A possible fix is to extend JspTagImpl#applyAttributes method with this functionality.

Environment Information

  • Operating System: Windows 10 Version 1607
  • Grails Version: 3.0.16
  • JDK Version: 1.8.0_74

GSP taglib syntax error (extra comma) fails silently

If an extra comma , is present in use of a taglib tag, it is flagged as a syntax error by IDEA, but seems to be ignored by gsp compiler, causing the remaining attributes of the tag to be silently dropped.

e.g. we had <g:message code="by.you", default="by you"/> (note extra comma after code attribute) however the by.you message did not exist, but was still rendered as by.you instead of the default. The extraneous comma was the culprit.

Steps to Reproduce

  1. Use invalid syntax <g:message code="missing.message", default="default value"/> (see extra comma)

Expected Behaviour

The gsp should not render due to invalid syntax (extra comma ,)

Actual Behaviour

The g:message tag works but ignores attributes after the comma. The text "missing.message" is displayed.

Environment Information

  • Operating System: macosX/linux
  • Grails Version: 2.5.6/3.3.5
  • JDK Version: 1.8

Documentation incorrect on the behaviour of how grails.gsp.view.dir is working for custom environments or inconsistent bevaviour of grails.gsp.view.dir for different enviroments

The value of grails.gsp.view.dir is applied differently for different grails environment. I consider this a bug.
If you don't consider it a bug, then you should update the documentation, because it drove me nuts.
Thanks to stackoverflow I managed to resolve the issue:
https://stackoverflow.com/questions/18927812/grails-gsp-view-dir-works-in-dev-but-not-when-deployed-as-war

Grails 5.0.0.M2: GroovyPageLayoutFinder is not properly inititialized during BootStrap

The GroovyPageLayoutFinder is not yet fully initialized during the BootStrap sequence. The field viewResolver is still null during BootStrap, which results in the exception below.

I did some debugging and it seems that both GroovyPageLayoutFinder and GrailsApplicationPostProcessor are Spring listeners that handle the ContextRefreshedEvent. Since both have no order specified, the default order is applied and it seems that GrailsApplicationPostProcessor comes before GroovyPageLayoutFinder. This results in the problem of this issue, as the viewResolver is set in the event handler onApplicationEvent.

BootStrap.groovy:

class BootStrap {

    def groovyPageRenderer

    def init = { servletContext ->
        groovyPageRenderer.render(view: '/email/test')
    }

    def destroy = {
    }
}

/grails-app/views/email/test.gsp:

<g:applyLayout name="/email">
</g:applyLayout>

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. create new grails 4.1.0.M1 application
  2. use BootStrap class and GSP file from the description above
  3. run application

Expected Behaviour

Tell us what should happen

Actual Behaviour

org.grails.taglib.GrailsTagException: [views/email/test.gsp:11] Error executing tag <g:applyLayout>: Unable to resolve view
	at org.grails.gsp.GroovyPage.throwRootCause(GroovyPage.java:473)
	at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:415)
	at org.grails.gsp.GroovyPage$invokeTag$4.callCurrent(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
	at C__Users_david_IdeaProjects_grails_410_grails_app_views_email_test_gsp.run(C__Users_david_IdeaProjects_grails_410_grails_app_views_email_test_gsp:31)
	at org.grails.gsp.GroovyPageWritable.doWriteTo(GroovyPageWritable.java:162)
	at org.grails.gsp.GroovyPageWritable.writeTo(GroovyPageWritable.java:82)
	at groovy.lang.Writable$writeTo.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
	at grails.gsp.PageRenderer.renderViewToWriter(PageRenderer.groovy:122)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.runtime.callsite.PlainObjectMetaMethodSite.doInvoke(PlainObjectMetaMethodSite.java:43)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:193)
	at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:61)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:194)
	at grails.gsp.PageRenderer.render(PageRenderer.groovy:66)
	at grails.gsp.PageRenderer$render.call(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:139)
	at grails_410.BootStrap$_closure1.doCall(BootStrap.groovy:8)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1029)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1143)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1029)
	at groovy.lang.Closure.call(Closure.java:412)
	at groovy.lang.Closure.call(Closure.java:406)
	at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:594)
	at grails.util.Environment.executeForEnvironment(Environment.java:587)
	at grails.util.Environment.executeForCurrentEnvironment(Environment.java:563)
	at org.grails.web.servlet.boostrap.DefaultGrailsBootstrapClass.callInit(DefaultGrailsBootstrapClass.java:74)
	at org.grails.web.servlet.context.GrailsConfigUtils.executeGrailsBootstraps(GrailsConfigUtils.java:83)
	at org.grails.plugins.web.servlet.context.BootStrapClassRunner.onStartup(BootStrapClassRunner.groovy:56)
	at grails.boot.config.GrailsApplicationPostProcessor.onApplicationEvent(GrailsApplicationPostProcessor.groovy:269)
	at grails.boot.config.GrailsApplicationPostProcessor.onApplicationEvent(GrailsApplicationPostProcessor.groovy)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:403)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:360)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:897)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
	at grails.boot.GrailsApp.run(GrailsApp.groovy:96)
	at grails.boot.GrailsApp.run(GrailsApp.groovy:456)
	at grails.boot.GrailsApp.run(GrailsApp.groovy:443)
	at grails_410.Application.main(Application.groovy:11)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.RuntimeException: Unable to resolve view
	at org.grails.web.sitemesh.GroovyPageLayoutFinder.getNamedDecorator(GroovyPageLayoutFinder.java:201)
	at org.grails.web.sitemesh.GroovyPageLayoutFinder.getNamedDecorator(GroovyPageLayoutFinder.java:176)
	at org.grails.web.sitemesh.GrailsLayoutDecoratorMapper.getNamedDecorator(GrailsLayoutDecoratorMapper.java:79)
	at com.opensymphony.module.sitemesh.mapper.AbstractDecoratorMapper.getNamedDecorator(AbstractDecoratorMapper.java:50)
	at org.grails.plugins.web.taglib.RenderTagLib.findDecorator(RenderTagLib.groovy:195)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1262)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1029)
	at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:1027)
	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:1010)
	at org.codehaus.groovy.runtime.InvokerHelper.invokeMethodSafe(InvokerHelper.java:99)
	at org.grails.plugins.web.taglib.RenderTagLib$_closure1.doCall(RenderTagLib.groovy:157)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:263)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1029)
	at groovy.lang.Closure.call(Closure.java:412)
	at org.grails.gsp.GroovyPage.invokeTagLibClosure(GroovyPage.java:446)
	at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:364)
	... 68 common frames omitted
Caused by: java.lang.NullPointerException: null
	at org.grails.web.sitemesh.GroovyPageLayoutFinder.getNamedDecorator(GroovyPageLayoutFinder.java:193)
	... 95 common frames omitted

Environment Information

  • Operating System: Windows 10
  • Grails Version: 4.1.0.M1
  • JDK Version: JDK 11

GroovyPageCompilerForkTask ignores config

Task List

  • [ x ] Steps to reproduce provided
  • [ x ] Full description of the issue provided (see below)

Steps to Reproduce

  1. create a new grails 4.0.13 application
  2. set the codecs in application.yml to the following
grails:
  views:
    gsp:
      codecs:
        expression: none
  1. add view with
    ${'<h1>Hello World!</h1>'}

Expected Behaviour

View in browser should display
Hello World!

Actual Behaviour

View in browser displays
<h1>Hello World!</h1>

Problem

The Problem is a bug in class GroovyPageCompilerForkTask where an array of file paths is assigned to a string. Therefore the path then starts with a '[' and is not found in GroovyPageCompiler.compile()

Solution

The line in GroovyPageCompilerForkTask.createPageCompiler()
String configPaths = configs.collect{new File(it)}.findAll{it.exists()}?.collect{it.canonicalPath}.toArray()
should be replaced with
String[] configPaths = configs.collect{new File(it)}.findAll{it.exists()}.collect{it.canonicalPath}.toArray(new String[0])

g:formatDate issue with java.sql.Date class instances

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Add the following code in any action
java.sql.Date date = new java.sql.Date(Calendar.getInstance().getTime().getTime())
g.formatDate(date: date, format: 'yyyy/MM/dd')
  1. Run the application and hit that action
  2. you will get java.lang.UnsupportedOperationException

Expected Behaviour

java.sql.Date instance should be formated.

Actual Behaviour

Getting java.lang.UnsupportedOperationException

Environment Information

  • Operating System: Any
  • Grails Version: 4.0.2
  • JDK Version: 8
  • Container Version (If Applicable): NA

Example Application

  1. Run the application
  2. Hit http://localhost:8080/test/testDateFormat url
  3. Error page displayed with message java.lang.UnsupportedOperationException

From the tag select, when using dataAttrs I'm getting can't getAt on null value

Steps to Reproduce

Use the select tag including dataAttrs.

Expected Behaviour

  1. The tag should check for errors like null element
  2. It should report what when wrong instead of failing with a generic exception
  3. The documentation could be improved with an example of using dataAttrs
  4. Add test cases for select using dataAttrs (couldn't find any)

Actual Behaviour

I tracked the issue in the code to this line https://github.com/grails/grails-gsp/blob/5.2.x/grails-plugin-gsp/src/main/groovy/org/grails/plugins/web/taglib/FormTagLib.groovy#L1122

It seems when passing a map like this [name: it.name] the 'it' used by other select options doesn't work, and there is no check for null to provide a correct message of what the error is.

I have found, by looking at the code that only this works, which is a little obscure: [name: 'name'], so for other options like optionValue (this works: optionValue="${{it.templateId +' (v'+ it.versionNumber +')'}}")

So since dataAttrs don't support using it.xxx we neither can compose values like we can for optionValue, which would be useful for certain cases.

Environment Information

$ grails -version
| Grails Version: 5.3.2
| JVM Version: 11.0.10

  • Operating System: Linux Mint 17.3

Example Application

  • TODO

TagLibraryInvoker should not modify globally registered ExpandoMetaClass in development mode

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

this is a follow-up of grails/grails-core#11358

pull-request follows.

Expected Behaviour

TagLibraryInvoker ExpandoMetaClass modifications should not survive a boot devtools restart in development mode.

Actual Behaviour

the ExpandoMetaClass methods used for cross-taglib tag-as-method invocations are persisted across devtools restarts (as they are set on a globally registered ExpandoMetaClass).

note that while TagLibraryInvoker.methodMissing is lacking the development guard, TagLibraryInvoker.propertyMissing does it already:
https://github.com/grails/grails-gsp/blob/v4.0.0.RC1/grails-web-taglib/src/main/groovy/grails/artefact/gsp/TagLibraryInvoker.groovy#L115-L117

Environment Information

  • Operating System: win x64
  • Grails Version: 4.0.0.RC2
  • JDK Version: oracle 8u121
  • Container Version (If Applicable): n/a

Example Application

see referenced issue

IncrementalTaskInputs has been deprecated - On method 'GroovyPageForkCompileTask.execute'

The use of IncrementalTaskInputs has been deprecated and will be removed in Gradle 8. Use 'org.gradle.work.InputChanges' instead. We are using this in org.grails.grails-gsp Gradle plugin on method 'GroovyPageForkCompileTask.execute`.

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Goto https://start.grails.org/
  2. Select the default options
  3. Click "Generate" button and Download ZIP.
  4. Run the application using ./gradlew build --warning-mode all

Expected Behaviour

The project should be compatible with Gradle 8.

Actual Behaviour

You would notice warning message that the project is not compatible with Gradle 8. See https://ge.grails.org/s/f3obytlfx2omc/deprecations?details=5&expanded=WyI0Il0

Environment Information

  • Operating System: macOS
  • Grails Version: 6.0.0
  • JDK Version: 11.0.6

Render template with relative paths work in dev but not in prod

A view uses a template that is on a different folder (that part is reused by many other views).

Steps to Reproduce

This worked in prod and in dev in Grails 3.x

<g:render template="./../version/versionRow" model="[version:version]"/>

In Grails 5.x dev that works, but in prod that doesn't work:

org.grails.taglib.GrailsTagException: [views/versionedActor/show.gsp:101] Template not found for name [../version/versionRow] and path [/_version/versionRow.gsp]
	at org.grails.gsp.GroovyPage.throwRootCause(GroovyPage.java:469)
	at org.grails.gsp.GroovyPage.invokeTag(GroovyPage.java:415)
	at jdk.internal.reflect.GeneratedMethodAccessor641.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:107)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:323)
	at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:362)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:61)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:171)
	at gsp_EHRServerNG_versionedActorshow_gsp$_run_closure2.doCall(gsp_EHRServerNG_versionedActorshow_gsp.groovy:53)

In Grails 5.x prod this works: (this is correctly documented as / will be resolved against the views folder)

<g:render template="/version/versionRow" model="[version:version]"/>

What I think is inconsistent is that in dev it works and not in prod. In fact I detected the issue in prod which is not ideal.

Expected Behaviour

Just to have a consistent dev and prod behavior.

Actual Behaviour

Inconsistent dev and prod behavior.

Environment Information

  • Operating System: Linux Mint
  • Grails Version: 5.3.2
  • JDK Version: 11.0.10

GroovyPagesTemplateEngine cache is not rendering in cluster environment

Pages has been build dynamic using GroovyPagesTemplateEngine and it got cached in local file system for better performance. page content update has not pushing out into One Node to another Node in Cluster Environment. after invocation of clearPageCache(), it rendering page content from Database which it has page meta data in the form of JSON format. Every time we have to invoke clearPageCache() or restart Nodes. For your information we are in Grails 2.5.

what could be the best solution to resolve this issue?

FormTagLib.form passes wrong method to RequestDataValueProcessor

Steps to Reproduce

  1. Create a Grails web application and add Spring Security Web as a dependency
  2. Configure CSRF protection in resources.groovy:
requestDataValueProcessor(org.springframework.security.web.servlet.support.csrf.CsrfRequestDataValueProcessor)
csrfFilter(org.springframework.security.web.csrf.CsrfFilter, new org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository())
  1. Create a GSP file containing a g:form element

Expected Behaviour

I expect that the CSRF token is added to the form.

Actual Behaviour

It isn't added.

Environment Information

  • Operating System: Linux
  • Grails Version: 2.5.1 (the relevant code did not change since then however)
  • JDK Version: 8
  • Container Version (If Applicable): 2.5

-

I think the problem is

link= requestDataValueProcessor.processAction(request, link, request.method)

Here the method of the form should be passed, not the method used to request the page containing the form.
See also the documentaton for the RequestDataValueProcessor interface.

Rendering a JSP view in a Grails 3 application

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided: stacktrace.log
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Go to http://localhost:8080/index/start

Expected Behaviour

The JSP should be rendered.

Actual Behaviour

The JSP is not rendered and the following error is shown:

Could not resolve view with name '/index/first.jsp' in servlet with name 'grailsDispatcherServlet'

Adding DEBUG level to the log, the following relevant information is shown:

2021-07-08 13:13:18.971 DEBUG --- [nio-8080-exec-2] o.g.w.s.view.GrailsLayoutViewResolver    : Resolving view for name /index/first.jsp and locale en
2021-07-08 13:13:18.971 DEBUG --- [nio-8080-exec-2] o.g.w.s.view.GroovyPageViewResolver      : Locating GSP view for controller es.salenda.test.entrada.IndexController@2ffd5d39 and path /index/first.jsp
2021-07-08 13:13:18.971 DEBUG --- [nio-8080-exec-2] org.grails.core.io.StaticResourceLoader  : Loading resource for path /grails-app/views/index/first.jsp.gsp from base resource URL [file:/Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/]
2021-07-08 13:13:18.971 DEBUG --- [nio-8080-exec-2] org.grails.gsp.GroovyPageResourceLoader  : Resolved GSP location [/grails-app/views/index/first.jsp.gsp] to resource [URL [file:/Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/grails-app/views/index/first.jsp.gsp]] (exists? [false]) using base resource [URL [file:/Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/]]
[...]

Where it can be checked that it's trying to obtain the view name first.jsp.gsp, so the suffix .gsp is added.

Digging deeper into the classes involved, it seems that when the method GroovyPagesUriSupport#getAbsoluteViewURIInternal is called, the .gsp suffix is automatically added. I have debugged this method an storing includeSuffix as false, the suffix is not added and it works as expected, and this is the log shown:

2021-07-08 13:18:26.273 DEBUG --- [nio-8080-exec-9] o.g.w.s.view.GroovyPageViewResolver      : Locating GSP view for controller es.salenda.test.entrada.IndexController@2ffd5d39 and path /index/first.jsp
2021-07-08 13:18:37.490 DEBUG --- [nio-8080-exec-9] org.grails.core.io.StaticResourceLoader  : Loading resource for path /grails-app/views/index/first.jsp from base resource URL [file:/Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/]
2021-07-08 13:18:37.490 DEBUG --- [nio-8080-exec-9] org.grails.core.io.StaticResourceLoader  : Found resource for path /grails-app/views/index/first.jsp from base resource URL [file:/Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/]
2021-07-08 13:18:37.490 DEBUG --- [nio-8080-exec-9] org.grails.gsp.GroovyPageResourceLoader  : Resolved GSP location [/grails-app/views/index/first.jsp] to resource [URL [file:/Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/grails-app/views/index/first.jsp]] (exists? [true]) using base resource [URL [file:/Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/]]
2021-07-08 13:18:37.490 DEBUG --- [nio-8080-exec-9] o.g.w.s.view.GroovyPageViewResolver      : Resolved GSP view at URI [/index/first.jsp]
2021-07-08 13:18:37.491 DEBUG --- [nio-8080-exec-9] o.grails.gsp.compiler.GroovyPageParser   : Preprocessing /Users/miguelangelgarciagomez/Projects/testGrails3.3.9.JSP/grails-app/views/index/first.jsp for sitemesh. Replacing head, title, meta and body elements with sitemesh:capture*.

So I'm not sure whether is a configuration that I missed or it's a bug.

Environment Information

  • Operating System: macOS Big Sur 11.4
  • Grails Version: 3.3.9
  • JDK Version: openjdk version "1.8.0_212"

Example Application

Migrate to Gradle 5 throws NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest

Stesps to reproduce

Clone branch:
https://github.com/grails/grails-gsp/tree/gradle-5

Run ./gradlew check

startup failed:
General error during conversion: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest

java.lang.RuntimeException: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest
        at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1129)
        at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1109)
        at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:649)
        at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:627)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:604)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:583)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:179)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:57)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:80)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:68)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:86)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:74)
        at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:42)
        at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:36)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest
        at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveClass(AsmReferenceResolver.java:48)
        at org.codehaus.groovy.ast.decompiled.TypeSignatureParser.visitEnd(TypeSignatureParser.java:112)
        at groovyjarjarasm.asm.signature.SignatureReader.parseType(SignatureReader.java:206)
        at groovyjarjarasm.asm.signature.SignatureReader.accept(SignatureReader.java:124)
        at org.codehaus.groovy.ast.decompiled.ClassSignatureParser.parseClassSignature(ClassSignatureParser.java:77)
        at org.codehaus.groovy.ast.decompiled.ClassSignatureParser.configureClass(ClassSignatureParser.java:35)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lazyInitSupers(DecompiledClassNode.java:182)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.getInterfaces(DecompiledClassNode.java:97)
        at org.codehaus.groovy.ast.ClassNode.getInterfaces(ClassNode.java:375)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:438)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:440)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:430)
        at org.codehaus.groovy.control.ResolveVisitor.setRedirect(ResolveVisitor.java:454)
        at org.codehaus.groovy.control.ResolveVisitor.resolveNestedClass(ResolveVisitor.java:413)
        at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:390)
        at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:356)
        at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:340)
        at org.codehaus.groovy.control.ResolveVisitor.visitAnnotations(ResolveVisitor.java:1260)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:120)
        at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:55)
        at org.codehaus.groovy.control.ResolveVisitor.visitConstructorOrMethod(ResolveVisitor.java:254)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:132)
        at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1103)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:54)
        at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1395)
        at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:227)
        at org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit$1.call(JavaAwareCompilationUnit.java:76)
        at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1095)
        ... 32 more

General error during conversion: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest

java.lang.RuntimeException: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest
        at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1129)
        at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1109)
        at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:649)
        at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:627)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:604)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:583)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:179)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:57)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:80)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:68)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:86)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:74)
        at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:42)
        at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:36)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest
        at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveClass(AsmReferenceResolver.java:48)
        at org.codehaus.groovy.ast.decompiled.TypeSignatureParser.visitEnd(TypeSignatureParser.java:112)
        at groovyjarjarasm.asm.signature.SignatureReader.parseType(SignatureReader.java:206)
        at groovyjarjarasm.asm.signature.SignatureReader.accept(SignatureReader.java:124)
        at org.codehaus.groovy.ast.decompiled.ClassSignatureParser.parseClassSignature(ClassSignatureParser.java:77)
        at org.codehaus.groovy.ast.decompiled.ClassSignatureParser.configureClass(ClassSignatureParser.java:35)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lazyInitSupers(DecompiledClassNode.java:182)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.getInterfaces(DecompiledClassNode.java:97)
        at org.codehaus.groovy.ast.ClassNode.getInterfaces(ClassNode.java:375)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:438)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:440)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:430)
        at org.codehaus.groovy.control.ResolveVisitor.setRedirect(ResolveVisitor.java:454)
        at org.codehaus.groovy.control.ResolveVisitor.resolveNestedClass(ResolveVisitor.java:413)
        at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:390)
        at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:356)
        at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:340)
        at org.codehaus.groovy.control.ResolveVisitor.visitAnnotations(ResolveVisitor.java:1260)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:51)
        at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1395)
        at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:227)
        at org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit$1.call(JavaAwareCompilationUnit.java:76)
        at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1095)
        ... 32 more

General error during conversion: java.lang.NoClassDefFoundError: org.grails.testing.GrailsUnitTest

java.lang.RuntimeException: java.lang.NoClassDefFoundError: org.grails.testing.GrailsUnitTest
        at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1129)
        at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1109)
        at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:649)
        at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:627)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:604)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:583)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:179)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:57)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:80)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:68)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:86)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:74)
        at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:42)
        at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:36)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org.grails.testing.GrailsUnitTest
        at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveClass(AsmReferenceResolver.java:48)
        at org.codehaus.groovy.ast.decompiled.ClassSignatureParser.configureClass(ClassSignatureParser.java:45)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lazyInitSupers(DecompiledClassNode.java:182)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.getInterfaces(DecompiledClassNode.java:97)
        at org.codehaus.groovy.ast.ClassNode.getInterfaces(ClassNode.java:375)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:438)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:440)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:430)
        at org.codehaus.groovy.control.ResolveVisitor.setRedirect(ResolveVisitor.java:454)
        at org.codehaus.groovy.control.ResolveVisitor.resolveNestedClass(ResolveVisitor.java:413)
        at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:390)
        at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:356)
        at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:340)
        at org.codehaus.groovy.control.ResolveVisitor.visitAnnotations(ResolveVisitor.java:1260)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:120)
        at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:55)
        at org.codehaus.groovy.control.ResolveVisitor.visitConstructorOrMethod(ResolveVisitor.java:254)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:132)
        at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1103)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:54)
        at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1395)
        at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:227)
        at org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit$1.call(JavaAwareCompilationUnit.java:76)
        at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1095)
        ... 32 more

General error during conversion: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest

java.lang.RuntimeException: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest
        at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1129)
        at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1109)
        at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:649)
        at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:627)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:604)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:583)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:179)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:57)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:80)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:68)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:86)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:74)
        at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:42)
        at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:36)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest
        at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveClass(AsmReferenceResolver.java:48)
        at org.codehaus.groovy.ast.decompiled.TypeSignatureParser.visitEnd(TypeSignatureParser.java:112)
        at groovyjarjarasm.asm.signature.SignatureReader.parseType(SignatureReader.java:206)
        at groovyjarjarasm.asm.signature.SignatureReader.accept(SignatureReader.java:124)
        at org.codehaus.groovy.ast.decompiled.ClassSignatureParser.parseClassSignature(ClassSignatureParser.java:77)
        at org.codehaus.groovy.ast.decompiled.ClassSignatureParser.configureClass(ClassSignatureParser.java:35)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lazyInitSupers(DecompiledClassNode.java:182)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.getInterfaces(DecompiledClassNode.java:97)
        at org.codehaus.groovy.ast.ClassNode.getInterfaces(ClassNode.java:375)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:438)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:440)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:430)
        at org.codehaus.groovy.control.ResolveVisitor.setRedirect(ResolveVisitor.java:454)
        at org.codehaus.groovy.control.ResolveVisitor.resolveNestedClass(ResolveVisitor.java:413)
        at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:390)
        at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:356)
        at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:340)
        at org.codehaus.groovy.control.ResolveVisitor.visitAnnotations(ResolveVisitor.java:1260)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:120)
        at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:55)
        at org.codehaus.groovy.control.ResolveVisitor.visitConstructorOrMethod(ResolveVisitor.java:254)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:132)
        at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1103)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:54)
        at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1395)
        at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:227)
        at org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit$1.call(JavaAwareCompilationUnit.java:76)
        at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1095)
        ... 32 more

General error during conversion: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest

java.lang.RuntimeException: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest
        at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1129)
        at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1109)
        at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:649)
        at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:627)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:604)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:583)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:179)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:57)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:80)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:68)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:86)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:74)
        at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:42)
        at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:36)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest
        at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveClass(AsmReferenceResolver.java:48)
        at org.codehaus.groovy.ast.decompiled.TypeSignatureParser.visitEnd(TypeSignatureParser.java:112)
        at groovyjarjarasm.asm.signature.SignatureReader.parseType(SignatureReader.java:206)
        at groovyjarjarasm.asm.signature.SignatureReader.accept(SignatureReader.java:124)
        at org.codehaus.groovy.ast.decompiled.ClassSignatureParser.parseClassSignature(ClassSignatureParser.java:77)
        at org.codehaus.groovy.ast.decompiled.ClassSignatureParser.configureClass(ClassSignatureParser.java:35)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lazyInitSupers(DecompiledClassNode.java:182)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.getInterfaces(DecompiledClassNode.java:97)
        at org.codehaus.groovy.ast.ClassNode.getInterfaces(ClassNode.java:375)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:438)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:440)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:430)
        at org.codehaus.groovy.control.ResolveVisitor.setRedirect(ResolveVisitor.java:454)
        at org.codehaus.groovy.control.ResolveVisitor.resolveNestedClass(ResolveVisitor.java:413)
        at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:390)
        at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:356)
        at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:340)
        at org.codehaus.groovy.control.ResolveVisitor.visitAnnotations(ResolveVisitor.java:1260)
        at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitField(ClassCodeExpressionTransformer.java:68)
        at org.codehaus.groovy.control.ResolveVisitor.visitField(ResolveVisitor.java:266)
        at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1095)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:54)
        at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1395)
        at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:227)
        at org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit$1.call(JavaAwareCompilationUnit.java:76)
        at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1095)
        ... 32 more

General error during conversion: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest

java.lang.RuntimeException: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest
        at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1129)
        at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1109)
        at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:649)
        at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:627)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:604)
        at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:583)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:179)
        at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:57)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:80)
        at org.gradle.api.internal.tasks.compile.GroovyCompilerFactory$DaemonSideCompiler.execute(GroovyCompilerFactory.java:68)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:86)
        at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerCallable.call(AbstractDaemonCompiler.java:74)
        at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:42)
        at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:36)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.process.internal.worker.request.WorkerAction.run(WorkerAction.java:102)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
        at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:175)
        at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:157)
        at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.NoClassDefFoundError: org.grails.testing.ParameterizedGrailsUnitTest
        at org.codehaus.groovy.ast.decompiled.AsmReferenceResolver.resolveClass(AsmReferenceResolver.java:48)
        at org.codehaus.groovy.ast.decompiled.TypeSignatureParser.visitEnd(TypeSignatureParser.java:112)
        at groovyjarjarasm.asm.signature.SignatureReader.parseType(SignatureReader.java:206)
        at groovyjarjarasm.asm.signature.SignatureReader.accept(SignatureReader.java:124)
        at org.codehaus.groovy.ast.decompiled.ClassSignatureParser.parseClassSignature(ClassSignatureParser.java:77)
        at org.codehaus.groovy.ast.decompiled.ClassSignatureParser.configureClass(ClassSignatureParser.java:35)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.lazyInitSupers(DecompiledClassNode.java:182)
        at org.codehaus.groovy.ast.decompiled.DecompiledClassNode.getInterfaces(DecompiledClassNode.java:97)
        at org.codehaus.groovy.ast.ClassNode.getInterfaces(ClassNode.java:375)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:438)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:440)
        at org.codehaus.groovy.ast.ClassNode.getAllInterfaces(ClassNode.java:430)
        at org.codehaus.groovy.control.ResolveVisitor.setRedirect(ResolveVisitor.java:454)
        at org.codehaus.groovy.control.ResolveVisitor.resolveNestedClass(ResolveVisitor.java:413)
        at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:390)
        at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:356)
        at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:340)
        at org.codehaus.groovy.control.ResolveVisitor.visitAnnotations(ResolveVisitor.java:1260)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitConstructorOrMethod(ClassCodeVisitorSupport.java:120)
        at org.codehaus.groovy.ast.ClassCodeExpressionTransformer.visitConstructorOrMethod(ClassCodeExpressionTransformer.java:55)
        at org.codehaus.groovy.control.ResolveVisitor.visitConstructorOrMethod(ResolveVisitor.java:254)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:132)
        at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1103)
        at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:54)
        at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1395)
        at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:227)
        at org.codehaus.groovy.tools.javac.JavaAwareCompilationUnit$1.call(JavaAwareCompilationUnit.java:76)
        at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1095)
        ... 32 more

New GroovyPageCompilerForkTask seems to ignore Configuration (of codecs)

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. create a new grails 4.0.4 application
  2. edit the generated grails-app/views/index.gsp add
<head>
...
  <script>
    var foo = ${[a:23, b:42, c:666] as grails.converters.JSON};
  </script>
</head>
  1. set the codecs in application.yml to the following
grails:
  views:
    gsp:
      codecs:
        expression: none

Expected Behaviour

grails-app/views/index.gsp shows up as

var foo = {"a":23,"b":42,"c":666};

Actual Behaviour

The same when running in development. In the packaged war file (deployed to Tomcat or running with java -jar build/libs/foo.war) the grails-app/views/index.gsp shows up as

var foo = {&quot;a&quot;:23,&quot;b&quot;:42,&quot;c&quot;:666};

Environment Information

  • Operating System: Linux
  • Grails Version: 4.0.4
  • JDK Version: 11
  • Container Version (If Applicable): Tomcat

Full Description

Since this was working in grails 4.0.3 (see Stackoverflow) the problem seems to be in the new GroovyPageCompilerForkTask. The GroovyPageCompilerForkTask is invoked with the config file location but never used:

File configFile = new File(args[6])
String encoding = args[7] ?: 'UTF-8'
// configuration.readConfiguration(configFile)

The calling site in grails-core has a hard coded argument https://github.com/grails/grails-core/blob/ae8e2738821fcef78fb40dae51a6131a392baab8/grails-gradle-plugin/src/main/groovy/org/grails/gradle/plugin/web/gsp/GroovyPageForkCompileTask.groovy#L96 (which is probably not the best idea as well ;-))

Thanks for the great work on Grails and @frnktrgr for the digging!

TagLib: pageScope.hasVariable doesn't see variables from parent scope

When I try to check if a variable exists in the pageScope with pageScope.hasVariable(name) inside a taglib, the parent pageScope is not considered, e.g. when I put the taglib call inside a template rendered by <g:render>

I discovered this problem by using the fields-plugin, which internally uses the pageScope to access its bean stack (<f:with>). I have posted an in-depth analysis of the error in case of the fields-plugin in their issue tracker: https://github.com/grails-fields-plugin/grails-fields/issues/194

Other discoveries:

  • pageScope.setVariable seems to consider the parent scope
  • pageScope.variables.containsKey(name) works with parent scope

Steps to Reproduce

  • create a tag which calls pageScope.hasVariable(name)
  • create a template which calls this tag
  • render template with <g:render>

MyTagLib.groovy

class MyTagLib {

    static namespace = "my"

    def scopeTest = {
        // doesn't work in sub-scope
        def a = pageScope.hasVariable('myVar') 
   
        // does work in sub-scope
        def b = pageScope.variables.containsKey('myVar')

        out << a << ' ' << b
    }
}

_test.gsp

<my:scopeTest/>

index.gsp

<g:set var="myVar" value="test"/>
<g:render template="test"/>

Expected Behaviour

Taglib will print the string "true true".

Actual Behaviour

Taglib prints the string "false true".

Environment Information

  • Grails Version: 3.2.8

g:checkBox does not properly enforce the requirement of the name attribute

Steps to Reproduce

  1. Add a checkBox element to a gsp without providing the name attribute.
    e.g. <g:checkBox />

  2. Load the modified page

Expected Behaviour

The page throws a GrailsTagException specifying that the name attribute in the checkBox tag is missing

Actual Behaviour

Inside the tag, name is assumed to be non-null, and results in a NullPointerException when indexOf is called on name

Environment Information

  • Operating System: Arch Linux 5.3.13
  • Grails Version: 4.0.0
  • JDK Version: 1.8.0_232

Enable trimDirectiveWhitespaces JSP directive in GSPs

I'm following up on grails/grails-core#4128 to enable trimDirectiveWhitespaces in GSPs. The issue was closed and redirected to this repository, but an issue was never created in grails-gsp.

The trimDirectiveWhitespaces directive is available at page-level for JSP pages:
<%@page trimDirectiveWhitespaces="true"%>

We have a rather large HTML page that's rendering 15MB of HTML, though it crunches down to 670KB with gzip. It seems there's a large volume of whitespace introduced by whitespace in GSP templates, so this setting would definitely be useful.

f:field should be enhanced to treat required specially

FormTagLib.groovy, line 64 looks like this....

private List<String> booleanAttributes = ['disabled', 'checked', 'readonly']

However, this is missing the HTML "required" attribute, which is also boolean.

That means you have to work around this in GSP by doing this...

<g:if test="${isRequired}">
<g:field name="foo" required>
</g:if>
<g:else>
<g:field name="foo">
</g:else>

Which is a pain in the ass

One might think this might work:

<g:field name="${property}" ${required?'required':''}/>
However the templating doesn't seem to like that.
`

Task List

FormTagLib.groovy, line 64 should be changed to...

private List<String> booleanAttributes = ['disabled', 'checked', 'readonly', 'required']

Steps to Reproduce

<g:field name="foo" required="${false}">
should expands to this:
<input name="foo">
with no required attribute.

Actual Behaviour

It expands to:
<input name="foo" required="false">
which browsers interpret to mean required is true.

select tag missing required boolean attribute and inconsistency in defaults

Before I get to talking about the main issue, a sub-issue.. sometime during the grails 4.x release, in org.grails.plugins.web.taglib.FormTagLib, the list of booleanAttributes on line 65 was expanded to include 'required'... a change that I think was done as a result of a previous bug report of mine, and that I approve of. However...

What I didn't know was that the defaults seem to be actually set on line 1223 in the method setConfiguration() and there are different defaults there. In fact, I'm not sure if the defaults on line 65 actually do anything. The default boolean attributes on line 1223 should be changed to match those on line 65 to include 'required'. I don't get why anyone would ever want anything but the full boolean behavior for all 4 attributes, but anyway...

The main point of this bug report is to point out that the g:select tag doesn't respect the required as a boolean attribute, whether or not configured with grails.tags.booleanToAttributes. This is because in FormTagLib select() closure, around line 958 to line 968, it has lines:

     booleanToAttribute(attrs, 'disabled')
     booleanToAttribute(attrs, 'readonly')

But it also needs to mention 'required' here as a boolean attribute.

Task List

add

<g:select ..... required="${false}">

to your gsp. The field will be required, even though we've set the value as false.

You may need to set this in your application.yml:

grails:
    tags:
        booleanToAttributes:
            - disabled
            - checked
            - readonly
            - required

though you shouldn't have to do that if you fix the problem of the default on line 1223 of FormTagLib, setConfiguration() method to match the default set on line 65.

After doing that, someone should update the doco.

Expected Behaviour

required attribute of g:select should behave as a groovy boolean.

Actual Behaviour

attribute is passed straight through as html

Environment Information

  • Operating System: Windows
  • Grails Version: 4.0.11
  • JDK Version: 1.8

Task: Document CompileStatic support in GSPs

There is CompileStatic support in the code base, but it hasn't been documented.
The features have been tested in this test class:
https://github.com/grails/grails-gsp/blob/master/grails-gsp/src/test/groovy/org/grails/gsp/GspCompileStaticSpec.groovy

Features

  • defining types for model attributes. this turns on CompileStatic mode for GSPs implicitly.
  • model attributes can have default values
  • possibility to turn off CompileStatic mode while keeping model type definitions
  • tag library prefixes have to be defined with taglibs when it's not g' or tmpl`

id attribute of <g:form> is ignored

Steps to Reproduce

  1. Create a new Grails 3.3.2 app with the web profile
  2. Add a User domain class with a name property
  3. Run grails generate-all user
  4. Add an id property to the form for creating a new user
<g:form resource="${this.user}" method="POST" id="create-user-form">
...
</g:form>

Expected Behaviour

The HTML for this form should have an id="create-user-form" attribute

Actual Behaviour

The HTML for this form does not have an id="create-user-form" attribute.
Incidentally, the resource attribute of the g:form tag is not documented

Environment Information

  • Operating System: Mac OS X
  • Grails Version: 3.3.2
  • JDK Version: 1.8.0_66
  • Container Version (If Applicable): Tomcat

error creating GroovyPagesException if nested exception has no stack trace

GroovyPageView#createGroovyPageException(..) expects the exception that it is building around to have a stack trace. It is possible for an exception not to have a stack trace. This causes a problem in the following code:

        StackTraceElement[] stackTrace = exception.getStackTrace();
        String className = stackTrace[0].getClassName();

Stack trace:

java.lang.ArrayIndexOutOfBoundsException: 0
        at org.grails.web.servlet.view.GroovyPageView.createGroovyPageException(GroovyPageView.java:118)
        at org.grails.web.servlet.view.GroovyPageView.handleException(GroovyPageView.java:112)
        at org.grails.web.servlet.view.GroovyPageView.renderTemplate(GroovyPageView.java:80)
        at org.grails.web.servlet.view.AbstractGrailsView.renderWithinGrailsWebRequest(AbstractGrailsView.java:71)
        at org.grails.web.servlet.view.AbstractGrailsView.renderMergedOutputModel(AbstractGrailsView.java:55)
        at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
        at org.grails.web.sitemesh.GrailsLayoutView.renderInnerView(GrailsLayoutView.java:150)
        at org.grails.web.sitemesh.GrailsLayoutView.obtainContent(GrailsLayoutView.java:128)
        at org.grails.web.sitemesh.GrailsLayoutView.renderTemplate(GrailsLayoutView.java:63)
        at org.grails.web.servlet.view.AbstractGrailsView.renderWithinGrailsWebRequest(AbstractGrailsView.java:71)
        at org.grails.web.servlet.view.AbstractGrailsView.renderMergedOutputModel(AbstractGrailsView.java:55)
        at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:303)
        at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1286)
        at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1041)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:984)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
...

Steps to Reproduce

This is not an easily reproducible bug.

Expected Behaviour

I expect to see the original error in my log files or on an error page.

Actual Behaviour

The log files contain a stack trace from the process of creating a nesting exception, losing the context of the underlying problem.

Environment Information

  • Operating System: Centos 6.9
  • Grails Version: 3.2.1
  • JDK Version: Oracle 1.8.0_171
  • Container Version (If Applicable): n/a

checkbox doesn't respect form parameter.

If one declares a checkbox:

<g:checkBox name="foo">

This actually results in 2 input fields...

<input type="hidden" name="_foo">
<input type="checkbox" name="foo">

As I understand it, this supports unchecking the field, since html throws away unchecked boxes.

However here's the problem, if I put in this:

<g:form name="myForm"></g:form>
<g:checkBox name="foo" form="myForm">

Then it results in this:

<form id="myForm"></form>
<input type="hidden" name="_foo">
<input type="checkbox" name="foo" form="myForm">

And then, the underscore field is thrown away by the browser, and checkboxes don't work.

To explain this further, to support complex form layouts, html has a form= parameter so that you can label each input field what form it belongs to without it actually being within those form tags. Because the g:checkBox tag generates two input fields for one tag, both tags need to pass on the form= parameter. In other words, it should generate this:

<form id="myForm"></form>
<input type="hidden" name="_foo" form="myForm">
<input type="checkbox" name="foo" form="myForm">

Grails 4.0.12

'Template not found' sticky even after creation of .gsp file till application restart.

Steps to Reproduce

in development mode

  1. call <g:render template="newTemplate"></g:render> somewhere on existing page without creating _newTemplate.gsp
  2. run code - 'Template not found' will arise
  3. create relevant _newTemplate.gsp
  4. run code again - 'Template not found' is sticky

Expected Behaviour

After creation of template file template should be compiled and rendered.

Actual Behaviour

Error of non-existing template is sticky till restart of application. That's VERY annoying

Environment Information

  • Operating System: Linux
  • Grails Version: 3.3
  • JDK Version: 1.8
  • Container Version (If Applicable): TODO

Example Application

error situation is dynamic, so hard to prepare sample

GSP processing behaves differently in containerized app on different systems

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. We run the following command:
docker container run -it --rm -p 1506:1506 -v ~/Downloads/devtestlic.xml:/devtest/devtestlic.xml --name dradis -e JAVA_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000" -p 8000:8000  isl-dsdc.ca.com:5000/sv/dradis:d4
  1. We then try and access the default homepage at http://localhost:1506

Expected Behaviour

Tell us what should happen

The home page should be displayed.

Actual Behaviour

Tell us what happens instead

Depending on what system the container is run on, the gsp processing behaves differently. Basically GroovyPagesGrailsPlugin.groovy#177 file,

def defaultViews = getClass().classLoader.getResource('gsp/views.properties')

The defaultViews references the views.properties file in our jar that was built. However, when the processing fails, the defaultViews variable references the view.properties in the spring-security-core jar file.

In GroovyPagesGrailsPlugin.groovy#L180-L189,
It looks through all plugins adding their views to the allViewsProperties variable which will contain 2 entries for spring-security-core-3.0.2 and fields-2.1.2.

At GroovyPagesGrailsPlugin.groovy#L191 when working, our jar is added to the allViewsProperties list. However, when not working the spring-security-core views are added a 2nd time to the allViewsProperties variable. This is the ultimate cause of access to the homepage resulting in the whitelabel error page.

2018-11-13 21:43:44,015Z (21:43) [qtp391269430-35] WARN  org.eclipse.jetty.servlet.ServletHandler - 
javax.servlet.ServletException: Could not resolve view with name '/index' in servlet with name 'grailsDispatcherServlet'
        at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1229)
        at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1029)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:973)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:858)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1689)
        at com.ca.devtest.http.XSSFilter.doFilter(XSSFilter.java:55)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at javax.servlet.FilterChain$doFilter.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at javax.servlet.FilterChain$doFilter.call(Unknown Source)
        at grails.plugin.springsecurity.rest.RestAuthenticationFilter.doFilter(RestAuthenticationFilter.groovy:143)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at javax.servlet.FilterChain$doFilter.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at javax.servlet.FilterChain$doFilter.call(Unknown Source)
        at com.ca.ad.common.security.SVTokenUpdateFilter.doFilter(SVTokenUpdateFilter.groovy:43)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at javax.servlet.FilterChain$doFilter.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
        at grails.plugin.springsecurity.rest.RestLogoutFilter.doFilter(RestLogoutFilter.groovy:80)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at javax.servlet.FilterChain$doFilter.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
        at grails.plugin.springsecurity.rest.RestTokenValidationFilter.processFilterChain(RestTokenValidationFilter.groovy:122)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:210)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:52)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:154)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:190)
        at grails.plugin.springsecurity.rest.RestTokenValidationFilter.doFilter(RestTokenValidationFilter.groovy:90)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextHeaderFilter.doFilterInternal(EndpointWebMvcAutoConfiguration.java:281)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:115)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at javax.servlet.FilterChain$doFilter.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
        at com.ca.ad.common.security.SVTokenUpdateFilter.doFilter(SVTokenUpdateFilter.groovy:43)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.groovy:53)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:149)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:169)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at javax.servlet.FilterChain$doFilter.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:133)
        at grails.plugin.springsecurity.rest.RestAuthenticationFilter.doFilter(RestAuthenticationFilter.groovy:143)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:205)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.groovy:62)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.groovy:58)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:75)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at org.springframework.boot.actuate.autoconfigure.MetricsFilter.doFilterInternal(MetricsFilter.java:103)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1676)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
        at org.eclipse.jetty.server.Server.handle(Server.java:524)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:319)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:253)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
        at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148)
        at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589)
        at java.lang.Thread.run(Thread.java:745)

Environment Information

  • Operating System: macOS 10.14.1
  • Grails Version: 3.1.10
  • JDK Version: OpenJDK Runtime Environment (build 1.8.0_111-internal-alpine-r0-b14)
  • Container Version (If Applicable): N/A

Example Application

  • We can't link the application as it requires licensing and would kill itself before the homepage could be displayed, but here is a link to a debugging session that 1st shows the gsp processing working correctly on a desktop and then the same container running on a laptop with the failing behavior.
    https://ent.box.com/s/fz6vlb4z20abg02ix2wetfr2r0z87tqz

Reloading not enabled in GroovyPagesTemplateRenderer

The GroovyPagesTemplateRenderer is not being initialized properly.

Expected Behaviour

Tell us what should happen

GroovyPagesGrailsPlugin:223 should register the bean with reloading:
     groovyPagesTemplateRenderer(GroovyPagesTemplateRenderer) { bean ->
            bean.autowire = true
            if (enableReload) {
                reloadEnabled = enableReload
            }
        }

Actual Behaviour

The GroovyPagesTemplateRenderer is currently getting the reloadEnabled from the GroovyPagesTemplateEngine, but when it checks for reloading it hasn't been set on the GroovyPagesTemplateEngine yet so it always ends up as false.

Environment Information

Grails 5.0.1

grails taglib html builder mix tags

Task List

  • [ Y ] Steps to reproduce provided
  • [ N ] Stacktrace (if present) provided
  • [ N ] Example that reproduces the problem uploaded to Github
  • [ Y ] Full description of the issue provided (see below)

Steps to Reproduce

  1. create new taglib
  2. use MarkupBuilder, html tag and grails tag (sample code below)
  3. call the tag lib in gsp

Expected Behaviour

Using TagLibs for grails 3.1 with HTML tag - object:

def objectImage = { attrs, body ->
def mb = new groovy.xml.MarkupBuilder(out)
mb.object(data: attrs.data, class: attrs.class, type: attrs.type) {
asset.image(src: attrs.src, class: attrs.class) {}
}
mb.span() { mkp.yield attrs.text }
}

Produce:

text

instead of
text

Adding quotes to the taglib value: 'object or " object" doesn;t work too.
Even if the usage is

<g:objectImage ... >text

the result is the same.

Actual Behaviour

Tell us what happens instead

Environment Information

  • Operating System: Windows and Linux
  • Grails Version: 3.1.7
  • JDK Version: 1.8

g:include not working without default URL mapping

Task List

  • Steps to reproduce provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Remove default mapping from URLMappings.groovy.
  2. Add a g:include tag in a view.
  3. Render the view: the content from the g:include tag is not rendered.

What I'm refering to with default URL mapping:

 "/$controller/$action?/$id?(.$format)?"{
    constraints {
        // apply constraints here
    }
}

Expected Behaviour

When the default URL mapping is removed the content from g:include tags should be rendered.

Actual Behaviour

The content originated fromg:include tags is not being rendered when the default URL mapping is removed.

Environment Information

  • Operating System: Ubuntu 14.04
  • Grails Version: 3.3.3
  • JDK Version: 1.8

Example Application

  1. Check that the default URL mapping is commented in URLMapping.groovy file.
  2. Run the app.
  3. Go to /hello.
  4. The word "world" originated from a g:include tag isn't rendered.

g:sortableColumn generates wrong links when used with a controller with a specific mapping

Hej!

The issue is known since 2017 and was not merged because of a missing test.
I create a pull-request with the required tests as requested in the original pull request made to grails core grails/grails-core#10839.

Original issue: grails/grails-core#10819
Related issue:

the issue was reported before, but was closed because the issue was not described properly.

Fortunately it is very straightforward ...

Steps to Reproduce

  1. Create a controller with a mapping like this: "/somepath/mycontroller/$action?/$id?" controller: 'mycontroller'
  2. use sortable column tag on a GSP rendered by mycontroller: <g:sortableColumn property="prop" title="Title"/>

Expected Behaviour

The generated link should be "/somepath/mycontroller/index?sort=...".

Actual Behaviour

The link misses the "/somepath" part. Wrong URL: "/mycontroller/index?sort=...".

Environment Information

  • Grails Version: 3.3.0
  • JDK Version: 8

Fix

As described here, replace def namespace = attrs.namespace ? attrs.remove("namespace") : "" with def namespace = attrs.remove("namespace") in org.grails.plugins.web.taglib.UrlMappingTagLib#sortableColumn

Feature request: type checked view references

Hello

As I understand, the next Grails version 3.3 will have support for type checked GSPs, which I think is a great feature and I can't wait to use it!

I don't know if this is possible from a technical point of view, but I think this "type checked views" idea could be even better, if it could expand throughout the whole framework and not only the view layer: My idea would be to also provide type checked references to views. Currently, views in controllers are rendered by providing a string in the render method, like render(view: 'myView'). It would be great if such calls could also be used in a type checked manner (find missing views before runtime).

I have seen something like this implemented in the Play framework:
Content html = views.html.Application.index.render(customer, orders);

I don't know if this is possible, but at least for me, this would be a very useful addition.

Tests for taglibs with custom namespace don't work

FYI: found this test but it's @ignored

Task List

When the tests are executed, the one for the taglibs fail: Tag [isLoggedIn] does not exist. No tag library found for namespace: sa

The tablig is defined in the 'sa" namespace:

package com.cabolabs.security

class SimpleAuthTagLib {
   static namespace = 'sa'
   static defaultEncodeAs = [taglib:'html']
   //static encodeAsForTags = [tagName: [taglib:'html'], otherTagName: [taglib:'none']]

   def isLoggedIn = { attrs, body ->
      def man = SessionManager.getInstance()
      if (man.hasSession(session.id.toString()))
      {
         out << body()
      }
   }
}

The issue is in the def output = applyTemplate('<sa:isLoggedIn>hidden content</sa:isLoggedIn>')

https://github.com/ppazos/grails-simple-auth/blob/master/src/test/groovy/com/cabolabs/security/SimpleAuthTagLibSpec.groovy#L28

Steps to Reproduce

  1. clone https://github.com/ppazos/grails-simple-auth
  2. use grails 3.3.10
  3. grails test-app

Expected Behaviour

Should execute the taglib and return some output to compare with the expected behavior.

Actual Behaviour

ERROR: Tag [isLoggedIn] does not exist. No tag library found for namespace: sa

Environment Information

  • Operating System: Linux Mint 19
  • Grails Version: 3.3.10
  • JDK Version: openjdk version "1.8.0_252"
    OpenJDK Runtime Environment (build 1.8.0_252-b09)
    OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

Example Application

it's a plugin: https://github.com/ppazos/grails-simple-auth

BUG: GroovyPageParser config loaded too late therefore ignored

GroovyPageParser is configured after initialization which is totally useless.

For instance, in the constructor the method isSitemeshPreprocessingEnabled is run which looks to see if enableSitemeshPreprocessing is set, but the variable isn't set until AFTER initialization!

GroovyPagesTemplateEngine

    String gspSource = IOUtils.toString(inputStream, getGspEncoding());
    parser = new GroovyPageParser(name, path, path, decorateGroovyPageSource(new StringBuilder(gspSource)).toString());

    if (grailsApplication != null) {
        Config config = grailsApplication.getConfig();
        parser.configure(config);
    }

GroovyPageParser

    public GroovyPageParser(String name, String uri, String filename, String gspSource, String expressionCodecName) throws IOException {

        this.expressionCodecDirectiveValue = expressionCodecName;
        if (expressionCodecDirectiveValue == null) {
            expressionCodecDirectiveValue = OutputEncodingSettings.getDefaultValue(OutputEncodingSettings.EXPRESSION_CODEC_NAME);
        }

        Map<String, String> directives = parseDirectives(gspSource);

        if (isSitemeshPreprocessingEnabled(directives.get(SITEMESH_PREPROCESS_DIRECTIVE))) {
            // GSP preprocessing for direct sitemesh integration: replace head -> g:captureHead, title -> g:captureTitle, meta -> g:captureMeta, body -> g:captureBody
            gspSource = sitemeshPreprocessor.addGspSitemeshCapturing(gspSource);
            sitemeshPreprocessMode=true;
        }
        scan = new GroovyPageScanner(gspSource, uri);
        pageName = uri;
        environment = Environment.getCurrent();
        makeName(name);
        makeSourceName(filename);
    }

Fix: Put configuration in the constructor.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/docs.yml
  • actions/checkout v4
  • actions/setup-java v4
  • actions/checkout v4
  • gradle/gradle-build-action v3
.github/workflows/gradle.yml
  • actions/checkout v4
  • actions/setup-java v4
  • gradle/gradle-build-action v3
  • actions/upload-artifact v4
  • actions/checkout v4
  • actions/setup-java v4
  • gradle/gradle-build-action v3
  • actions/checkout v4
  • actions/setup-java v4
  • gradle/gradle-build-action v3
  • grails/github-pages-deploy-action v2
.github/workflows/groovy-joint-workflow.yml
  • actions/setup-java v4
  • actions/cache v4
  • gradle/gradle-build-action v3
  • actions/checkout v4
  • actions/setup-java v4
  • actions/cache v4
  • gradle/gradle-build-action v3
.github/workflows/release-notes.yml
  • actions/checkout v4
  • release-drafter/release-drafter v6
  • ncipollo/release-action v1
.github/workflows/release.yml
  • actions/checkout v4
  • actions/setup-java v4
  • gradle/gradle-build-action v3
  • actions/upload-artifact v4
  • gradle/gradle-build-action v3
  • actions/checkout v4
  • gradle/gradle-build-action v3
  • actions/checkout v4
  • actions/setup-java v4
  • gradle/gradle-build-action v3
gradle
gradle.properties
  • org.grails:grails-gradle-plugin 6.2.0
  • org.codehaus.groovy:groovy-dateutil 3.0.21
  • javax.servlet:javax.servlet-api 4.0.1
  • org.codehaus.groovy:groovy-test-junit5 3.0.21
  • org.junit.jupiter:junit-jupiter-api 5.10.2
  • org.junit.platform:junit-platform-runner 1.10.2
  • org.junit.jupiter:junit-jupiter-engine 5.10.2
  • org.grails:grails-core 6.2.0
  • org.codehaus.groovy:groovy-templates 3.0.21
  • org.grails:grails-plugin-codecs 6.2.0
  • org.grails:grails-web 6.2.0
  • org.grails:grails-plugin-controllers 6.2.0
  • org.grails:grails-web-testing-support 3.2.2
  • org.grails:grails-testing-support 3.2.2
  • org.grails:grails-gorm-testing-support 3.2.2
  • javax.servlet.jsp:jsp-api 2.1
  • taglibs:standard 1.1.2
  • javax.servlet:jstl 1.1.2
  • org.grails:grails-plugin-url-mappings 6.2.0
  • org.grails:grails-encoder 6.2.0
  • org.apache.ant:ant 1.10.14
  • org.grails:grails-web-common 6.2.0
  • org.grails:grails-spring 6.2.0
  • opensymphony:sitemesh 2.4.4
settings.gradle
  • com.gradle.enterprise 3.17.2
  • com.gradle.common-custom-user-data-gradle-plugin 2.0.1
build.gradle
  • io.github.gradle-nexus:publish-plugin 2.0.0
grails-gsp/build.gradle
grails-plugin-gsp/build.gradle
  • commons-lang:commons-lang 2.6
grails-plugin-sitemesh2/build.gradle
grails-taglib/build.gradle
grails-web-gsp/build.gradle
grails-web-gsp-taglib/build.gradle
grails-web-jsp/build.gradle
grails-web-sitemesh/build.gradle
grails-web-taglib/build.gradle
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 7.6.4
html
src/main/docs/resources/style/layout.html
  • clipboard.js 2.0.11

  • Check this box to trigger a request for Renovate to run again on this repository

Trouble Testing Tag That Interacts With pageScope

By @jeffbrown from grails/grails-core#9576 where it was closed.

It still seems to be an issue

package demo

class DemoTagLib {
    static namespace = 'demo'

    def putSomethingInPageScope = { attrs ->
        pageScope.someValue = attrs.foo
    }
}
package demo

import grails.test.mixin.TestFor
import spock.lang.Specification

@TestFor(DemoTagLib)
class DemoTagLibSpec extends Specification {

    void "use applyTemplate to test tag that puts something in pageScope"() {
        when:
        applyTemplate '<demo:putSomethingInPageScope foo="42"/>'

        then:
        tagLib.pageScope.someValue == '42'
    }

    void "use tag as method to test tag that puts something in pageScope"() {
        when:
        tagLib.putSomethingInPageScope(foo: '42')

        then:
        tagLib.pageScope.someValue == '42'
    }
}

The applyTemplate approach does not work. I think multiple pageScope (TemplateVariableBinding) objects are being created and the one populated by the tag is not the same one retrieved in the test.

Support custom namespace when invoking TagLib of GroovyPage

Feature Request

Currently, GSP only support custom namespace like <tmp:person <link:mapping,
have not support this feature in Grails Plugins.

In my new plugin grails-plugin-view-components, I want to implement this feature, support dynamic tags like below:

<vc:button type="button" name="Icon Button" cssClasses="btn-primary" icon="box" />

<vc:card title="My First Component" content="This is the first Card" />

<vc:icon name="alarm" />
<vc:icon name="apple" />
<vc:icon name="bag" />
<vc:icon name="bank" />
<vc:icon name="box" />

I read the source code of GroovyPage, the hard-coded part is below:

org.grails.gsp.GroovyPage

https://github.com/grails/grails-gsp/blob/6b368cc732d1b6f172bc35b10ea33b010bf205f5/grails-gsp/src/main/groovy/org/grails/gsp/GroovyPage.java#L335..L354

If you find it useful, I can submit the relevant code implementation, and I really hope that the framework will support this feature.

Thank you~

Can not find views from other plugins

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Create App and Plugin A and Plugin B with Grails Multi-Project Build
  2. Create view in Plugin A 'grails-app/views/templates/example.gsp'
  3. Create Controller in Plugin B.
  4. Render GSP from plugin A in controller in plugin B.
    render(view: 'templates/example', plugin: 'plugina')

Expected Behaviour

Grails will find the view and as usual.

Actual Behaviour

Throw Exception

2017-08-21 02:07:38.989 ERROR --- [nio-8080-exec-1] .a.c.c.C.[.[.[.[grailsDispatcherServlet] : Servlet.service() for servlet [grailsDispatcherServlet] in context with path [] threw exception [Could not resolve view with name '/plugins/stuff-core-backend-2.0dev/vue/modules/stuff/BusinessTrip' in servlet with name 'grailsDispatcherServlet'] with root cause

javax.servlet.ServletException: Could not resolve view with name '/plugins/stuff-core-backend-2.0dev/vue/modules/stuff/BusinessTrip' in servlet with name 'grailsDispatcherServlet'
        at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1266)
        at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1041)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:984)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127)
        at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
        at grails.plugin.springsecurity.web.UpdateRequestContextHolderExceptionTranslationFilter.doFilter(UpdateRequestContextHolderExceptionTranslationFilter.groovy:64)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.groovy:53)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:158)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.groovy:62)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at grails.plugin.springsecurity.web.SecurityRequestHolderFilter.doFilter(SecurityRequestHolderFilter.groovy:58)
        at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331)
        at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214)
        at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterInternal(GrailsWebRequestFilter.java:77)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:67)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.springframework.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:96)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:478)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:80)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:799)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1455)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:745)

Environment Information

  • Operating System: OS X El Capitan 10.11.6 (15G1611)
  • Grails Version: 3.3.0
  • JDK Version: build 1.8.0_111-b14

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.