[ http://issues.apache.org/jira/browse/TAPESTRY-763?page=all ]
     
Howard M. Lewis Ship closed TAPESTRY-763:
-----------------------------------------

    Fix Version: 4.0
     Resolution: Fixed

> RequestCycle is not available during page initialization
> --------------------------------------------------------
>
>          Key: TAPESTRY-763
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-763
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>     Reporter: Mike Perham
>     Assignee: Howard M. Lewis Ship
>      Fix For: 4.0

>
> I have a page with a property defined as such:
>       <property name="query" initial-value="spring('resourceQuery')" />
> This was my simple way to inject Spring services in 3.0 pages.  This just 
> uses the requestcycle to get access to the ServletContext and look up the 
> named bean in the Spring Context associated with the ServletContext.  
> Unfortunately it looks like AbstractPage.getRequestCycle() is returning null 
> when the page is being constructed.
> java.lang.NullPointerException
> # com.webify.framework.bsc.BscPage.getCurrentServletContext(BscPage.java:145)
> # com.webify.framework.bsc.BscPage.getSpringContext(BscPage.java:137)
> # com.webify.framework.bsc.BscPage.spring(BscPage.java:66)
> # sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> # 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled
>  Code))
> # 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled
>  Code))
> # 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled
>  Code))
> # java.lang.reflect.Method.invoke(Method.java(Compiled Code))
> # ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:491)
> # ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:785)
> # ognl.ObjectMethodAccessor.callMethod(ObjectMethodAccessor.java:61)
> # ognl.OgnlRuntime.callMethod(OgnlRuntime.java:819)
> # ognl.ASTMethod.getValueBody(ASTMethod.java:75)
> # ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:170)
> # ognl.SimpleNode.getValue(SimpleNode.java:210)
> # ognl.Ognl.getValue(Ognl.java:333)
> # ognl.Ognl.getValue(Ognl.java:310)
> # 
> org.apache.tapestry.services.impl.ExpressionEvaluatorImpl.readCompiled(ExpressionEvaluatorImpl.java:91)
> # 
> $ExpressionEvaluator_107a1397f6e.readCompiled($ExpressionEvaluator_107a1397f6e.java)
> # 
> org.apache.tapestry.binding.ExpressionBinding.resolveExpression(ExpressionBinding.java:110)
> # 
> org.apache.tapestry.binding.ExpressionBinding.getObject(ExpressionBinding.java:103)
> # 
> org.apache.tapestry.binding.AbstractBinding.getObject(AbstractBinding.java:87)
> # $SearchPage_25.finishLoad($SearchPage_25.java)
> # 
> org.apache.tapestry.pageload.PageLoader.constructComponent(PageLoader.java:424)
> # org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:593)
> # $IPageLoader_107a1397f01.loadPage($IPageLoader_107a1397f01.java)
> # $IPageLoader_107a1397f02.loadPage($IPageLoader_107a1397f02.java)
> # org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:118)
> # $IPageSource_107a1397e6d.getPage($IPageSource_107a1397e6d.java)
> # org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:265)
> # org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:248)
> # org.apache.tapestry.engine.RequestCycle.activate(RequestCycle.java:609)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to