jijo-paulose / zkgrails

Automatically exported from code.google.com/p/zkgrails
1 stars 0 forks source link

redirect() in Composer throws NullPointer exception #342

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Which version of ZKGrails you're using? 
2.2.0

On what operating system?
Ubuntu 2013.04

Which version of Grails you're using?
2.2.1

What steps will reproduce the problem?
1. Create a Grails controller call Test, which simply renders some text in the 
index action using "render('Sample text');"
2. Create a Zk zul file.  Add a button to the zul.
3. Create a Zk Composer and tie it to the button on the zul. The button handler 
should try to redirect to the Grails Controller using 
"redirect(controller:'test');"
4. Run grails app and load zul page.
5. Click on zk button to redirect to Grails controller

What is the expected output? 
Should see output of Grials Test controller index action.

What do you see instead?
Exception stack print out.

Please provide any additional information below. Attaching a test case to
reproduce it is preferable.
| Error 2013-07-27 20:10:15,915 [http-bio-8080-exec-9] ERROR org.zkoss  - 
>>java.lang.NullPointerException
>>  at 
org.zkoss.zk.grails.composer.GrailsComposer.redirect(GrailsComposer.java:383)
>>  at zk.grails.Composer.redirect(Composer.java)
>>  at com.esl.demo.BookListComposer.redirect(BookListComposer.groovy)
>>  at org.zkoss.zk.grails.composer.GrailsComposer$redirect.callCurrent(Unknown 
Source)
>>  at 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteAr
ray.java:49)
>>  at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSi
te.java:133)
>>  at 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSi
te.java:141)
>>  at 
com.esl.demo.BookListComposer$$EOCquC0W.onClick_btnCreate(BookListComposer.groov
y:19)
>>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>  at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>>  at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:43)
>>  at java.lang.reflect.Method.invoke(Method.java:616)
>>  at 
org.springsource.loaded.ri.ReloadedTypeInvoker$2.invoke(ReloadedTypeInvoker.java
:122)
>>  at 
org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInter
ceptor.java:1272)
>>  at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
>>  at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
>>  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1082)
>>  at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1106)
>>  at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906)
>>  at 
org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:84
8)
>>  at 
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:831)
>>  at 
org.zkoss.zk.grails.composer.GrailsComposer.onEvent(GrailsComposer.java:230)
>>  at zk.grails.Composer.onEvent(Composer.java)
>>  at com.esl.demo.BookListComposer.onEvent(BookListComposer.groovy)
>>  at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2742)
>>  at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2713)
>>  at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2654)
>>  at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
>>  at org.zkoss.zk.ui.event.Events.sendEvent(Events.java:325)
>>  at org.zkoss.zk.ui.event.Events.sendEvent(Events.java:348)
>>  at 
org.zkoss.zk.ui.AbstractComponent$ForwardListener.onEvent(AbstractComponent.java
:3180)
>>  at org.zkoss.zk.ui.AbstractComponent.onEvent(AbstractComponent.java:2742)
>>  at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2713)
>>  at org.zkoss.zk.ui.AbstractComponent.service(AbstractComponent.java:2654)
>>  at org.zkoss.zk.ui.impl.EventProcessor.process(EventProcessor.java:136)
>>  at org.zkoss.zk.ui.impl.UiEngineImpl.processEvent(UiEngineImpl.java:1717)
>>  at org.zkoss.zk.ui.impl.UiEngineImpl.process(UiEngineImpl.java:1502)
>>  at org.zkoss.zk.ui.impl.UiEngineImpl.execUpdate(UiEngineImpl.java:1212)
>>  at 
org.zkoss.zk.au.http.DHtmlUpdateServlet.process(DHtmlUpdateServlet.java:600)
>>  at org.zkoss.zk.au.http.DHtmlUpdateServlet.doGet(DHtmlUpdateServlet.java:482)
>>  at 
org.zkoss.zk.au.http.DHtmlUpdateServlet.doPost(DHtmlUpdateServlet.java:491)
>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
>>  at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:305)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:210)
>>  at 
org.zkoss.zk.grails.web.ZULUrlMappingsFilter.processFilterChain(ZULUrlMappingsFi
lter.java:395)
>>  at 
org.zkoss.zk.grails.web.ZULUrlMappingsFilter.doFilterInternal(ZULUrlMappingsFilt
er.java:135)
>>  at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilte
r.java:76)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:243)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:210)
>>  at 
org.zkoss.zk.grails.web.ZKGrailsPageFilter.doFilter(ZKGrailsPageFilter.java:205)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:243)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:210)
>>  at javax.servlet.FilterChain$doFilter.call(Unknown Source)
>>  at 
org.grails.plugin.resource.DevModeSanityFilter.doFilter(DevModeSanityFilter.groo
vy:44)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:243)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:210)
>>  at 
org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequestFilter.doFilterIntern
al(GrailsWebRequestFilter.java:69)
>>  at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilte
r.java:76)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:243)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:210)
>>  at 
org.codehaus.groovy.grails.web.filters.HiddenHttpMethodFilter.doFilterInternal(H
iddenHttpMethodFilter.java:66)
>>  at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilte
r.java:76)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:243)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:210)
>>  at 
org.zkoss.zk.grails.web.ZKGrailsOpenSessionInViewFilter.doFilterInternal(ZKGrail
sOpenSessionInViewFilter.java:37)
>>  at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilte
r.java:76)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:243)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:210)
>>  at 
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(Characte
rEncodingFilter.java:88)
>>  at 
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilte
r.java:76)
>>  at 
org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFi
lterProxy.java:346)
>>  at 
org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterPr
oxy.java:259)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilt
erChain.java:243)
>>  at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.
java:210)
>>  at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:2
22)
>>  at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:1
23)
>>  at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
>>  at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>>  at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118
)
>>  at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
>>  at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor
.java:1002)
>>  at 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractPro
tocol.java:585)
>>  at 
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
>>  at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
>>  at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>  at java.lang.Thread.run(Thread.java:679)

Original issue reported on code.google.com by vilito.e...@gmail.com on 1 Aug 2013 at 12:46

GoogleCodeExporter commented 9 years ago
Thank you for reporting, Vilito.

Original comment by chanwit on 1 Aug 2013 at 2:50

GoogleCodeExporter commented 9 years ago
I'm having a same error here

Which version of ZKGrails you're using? 
2.2.7

On what operating system?
Ubuntu 2013.04

Which version of Grails you're using?
2.2.4

Original comment by worawat...@gmail.com on 1 Nov 2013 at 8:28

GoogleCodeExporter commented 9 years ago

Original comment by chanwit on 6 Nov 2013 at 6:44

GoogleCodeExporter commented 9 years ago

Original comment by chanwit on 6 Nov 2013 at 6:45

GoogleCodeExporter commented 9 years ago

Original comment by chanwit on 27 Dec 2013 at 8:29

GoogleCodeExporter commented 9 years ago
redirect command is in the form of:

redirect(uri:"/path")

the controller and action parameters are not supported.

Original comment by chanwit on 13 Jan 2014 at 2:54