Re: Grails 1.3.7 and Groovy++

19 views
Skip to first unread message

Daniel Henrique Alves Lima

unread,
Jun 1, 2011, 4:04:04 PM6/1/11
to us...@grails.codehaus.org, groovyp...@googlegroups.com
Hi, everybody. Sorry for the crosspost.

I'll try one last time before giving up of using Groovy++ with
Grails: Which version of Groovy++ should I use with Grails 1.3.7
(Groovy 1.7.8)?
The following code works using older versions of Grails,
Groovy and Groovy++ and it works without Groovy++:


== IpAddressFilter.groovy ==
import org.springframework.web.filter.GenericFilterBean

@Typed(TypePolicy.MIXED) //groovy++
class IpAddressFilter extends GenericFilterBean {

// (...)

private boolean isAllowed(final HttpServletRequest request) {
// (...)
}

// (...)

}


== resources.groovy ==
ipAddressFilter(IpAddressFilter) {
def conf = SpringSecurityUtils.securityConfig
ipRestrictions = conf.ipRestrictions
rolePrefix = "ROLE_"
springSecurityService = ref("springSecurityService")
}


But, when I try groovypp-all-0.4.248_1.7.10.jar or
groovypp-all-0.4.246_1.7.10.jar (I'm using a newer version to make
everyone happy, including Groovy Eclipse), 'grails run-app' ends with
the exception below. Alex, am I missing something? Thanks!


== beans ==
2011-06-01 15:46:02,919 [main] ERROR spring.GrailsRuntimeConfigurator
- [RuntimeConfiguration] Unable to load beans from resources.groovy
org.codehaus.groovy.runtime.InvokerInvocationException:
java.lang.VerifyError: (class: myapp/IpAddressFilter, method:
isAllowed signature: (Ljavax/servlet/http/HttpServletRequest;)Z)
Register 6 contains wrong type
at grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:723)
at grails.spring.BeanBuilder.beans(BeanBuilder.java:573)
at grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:723)
at grails.spring.BeanBuilder.beans(BeanBu

IpAddressFilter.groovy

Alex Tkachman

unread,
Jun 1, 2011, 4:11:48 PM6/1/11
to groovyp...@googlegroups.com, us...@grails.codehaus.org
I don't think I can say anything without seeing body of method

private boolean isAllowed(final HttpServletRequest request) {
// (...)
}

And yes, groovypp-all-0.4.248_1.7.10.jar should be perfectly OK.

Daniel Henrique Alves Lima

unread,
Jun 1, 2011, 4:59:48 PM6/1/11
to us...@grails.codehaus.org, groovyp...@googlegroups.com
Alex, the file is attached to the first msg. Thanks.

2011/6/1, Alex Tkachman <alex.t...@gmail.com>:

> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>

Daniel Henrique

unread,
Jun 7, 2011, 8:46:55 PM6/7/11
to Groovy++
Hi, Alex.

Are you able to reproduce the issue? The attached file is here:
http://groups.google.com/group/groovyplusplus/attach/bc1d9bdecc80068b/IpAddressFilter.groovy?part=2&view=1
Is this a bug or does it work as designed? Am I misusing groovy++?

Thanks in advance.

Regards,

Daniel.

On 1 jun, 17:59, Daniel Henrique Alves Lima
<email_danie...@yahoo.com.br> wrote:
> Alex, the file is attached to the first msg. Thanks.
>
> 2011/6/1, Alex Tkachman <alex.tkach...@gmail.com>:
Reply all
Reply to author
Forward
0 new messages