tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Howard Lewis Ship <hls...@gmail.com>
Subject Re: Error creating implicit component in 3.1
Date Tue, 01 Mar 2005 15:26:07 GMT
DO NOT create a page loader instance; of course its not nearly configured!

If you override the publid finishLoad() method, it will be provided to you.

Alternately, you should be able to have it injected into your component class.

Changing the structure of the page at render time is uncharted
territory in Tapestry.


On Tue, 01 Mar 2005 12:15:47 +0000, Hugo Palma <hpalma@digitalis.pt> wrote:
> Ok, i think i might have hidden the real problem with some not very
> pretty code.
> After some debugging i think that the problem is that the property
> componentResolver of the PageLoader class doesn't get initialized.
> In my code i have:
> 
> IPageLoader loader = new PageLoader();
> Location location = getLocation();
> Block block = (Block) loader.createImplicitComponent(cycle, this, id,
> BLOCK, location);
> 
> with this i get a NPE in
> org.apache.tapestry.pageload.PageLoader.createImplicitComponent(PageLoader.java:417)
> because the componentResolver property is NULL.
> 
> It's only when i do this:
> 
> IPageLoader loader = new PageLoader();
> loader.setComponentResolver(new ComponentSpecificationResolverImpl());
> Location location = getLocation();
> Block block = (Block) loader.createImplicitComponent(cycle, this, id,
> BLOCK, location);
> 
> that i get the exception from the previous post. That exception comes
> from the fact that the log property of the
> ComponentSpecificationResolverImpl class is NULL.
> 
> Hope this helps.
> 
> 
> Hugo
> 
> Howard Lewis Ship wrote:
> > Try enabling logging for Logger org.apache.tapestry.resolver
> >
> > I think the component's namespace, or namespace location, must be null
> > to cause an NPE.
> >
> > I've been adding more defensive programming checks for this throughout
> > Tapestry.  I hate NPEs that don't describe what's wrong!
> >
> > I really appreciate you doing early 3.1 alpha testing!
> >
> >
> > On Mon, 28 Feb 2005 16:52:35 +0000, Hugo Palma <hpalma@digitalis.pt> wrote:
> >
> >>I have a component that calls the method createImplicitComponent. It
> >>worked fine in 3.0.2 but now i'm getting an exception in 3.1.
> >>The stack trace is:
> >>
> >>java.lang.NullPointerException
> >>org.apache.tapestry.resolver.ComponentSpecificationResolverImpl.searchForComponent(ComponentSpecificationResolverImpl.java:65)
> >>org.apache.tapestry.resolver.ComponentSpecificationResolverImpl.resolve(ComponentSpecificationResolverImpl.java:56)
> >>org.apache.tapestry.resolver.ComponentSpecificationResolverImpl.resolve(ComponentSpecificationResolverImpl.java:40)
> >>org.apache.tapestry.pageload.PageLoader.createImplicitComponent(PageLoader.java:417)
> >>pt.digitalis.dif.view.components.dynamicblock.DynamicBlock.constructBlock(DynamicBlock.java:81)
> >>pt.digitalis.dif.view.components.dynamicblock.DynamicBlock.findBlockForComponentNamed(DynamicBlock.java:43)
> >>pt.digitalis.dif.view.components.dynamicblock.DynamicBlock.getBlock(DynamicBlock.java:34)
> >>sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >>sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >>java.lang.reflect.Method.invoke(Method.java:324)
> >>ognl.OgnlRuntime.invokeMethod(OgnlRuntime.java:491)
> >>ognl.OgnlRuntime.getMethodValue(OgnlRuntime.java:904)
> >>ognl.ObjectPropertyAccessor.getPossibleProperty(ObjectPropertyAccessor.java:54)
> >>ognl.ObjectPropertyAccessor.getProperty(ObjectPropertyAccessor.java:122)
> >>ognl.OgnlRuntime.getProperty(OgnlRuntime.java:1616)
> >>ognl.ASTProperty.getValueBody(ASTProperty.java:96)
> >>ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:171)
> >>ognl.SimpleNode.getValue(SimpleNode.java:213)
> >>ognl.Ognl.getValue(Ognl.java:333)
> >>ognl.Ognl.getValue(Ognl.java:310)
> >>org.apache.tapestry.services.impl.ExpressionEvaluatorImpl.readCompiled(ExpressionEvaluatorImpl.java:84)
> >>$ExpressionEvaluator_10259d67d0c.readCompiled($ExpressionEvaluator_10259d67d0c.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)
> >>$RenderBlock_4.getBlock($RenderBlock_4.java)
> >>org.apache.tapestry.components.RenderBlock.renderComponent(RenderBlock.java:54)
> >>org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:606)
> >>org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
> >>org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:606)
> >>org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:428)
> >>org.apache.tapestry.html.Body.renderComponent(Body.java:235)
> >>org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:606)
> >>org.apache.tapestry.AbstractComponent.renderBody(AbstractComponent.java:428)
> >>org.apache.tapestry.html.Shell.renderComponent(Shell.java:114)
> >>org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:606)
> >>org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
> >>org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:606)
> >>org.apache.tapestry.BaseComponent.renderComponent(BaseComponent.java:92)
> >>org.apache.tapestry.AbstractComponent.render(AbstractComponent.java:606)
> >>org.apache.tapestry.AbstractPage.renderPage(AbstractPage.java:280)
> >>org.apache.tapestry.engine.RequestCycle.renderPage(RequestCycle.java:351)
> >>org.apache.tapestry.services.impl.ResponseRendererImpl.renderResponse(ResponseRendererImpl.java:53)
> >>$ResponseRenderer_10259d67c92.renderResponse($ResponseRenderer_10259d67c92.java)
> >>$ResponseRenderer_10259d67c91.renderResponse($ResponseRenderer_10259d67c91.java)
> >>org.apache.tapestry.engine.HomeService.service(HomeService.java:67)
> >>org.apache.tapestry.engine.AbstractEngine.service(AbstractEngine.java:358)
> >>org.apache.tapestry.services.impl.InvokeEngineTerminator.service(InvokeEngineTerminator.java:57)
> >>$RequestServicer_10259d67c6b.service($RequestServicer_10259d67c6b.java)
> >>$RequestServicer_10259d67c6a.service($RequestServicer_10259d67c6a.java)
> >>org.apache.tapestry.services.impl.RequestGlobalsInitializer.service(RequestGlobalsInitializer.java:52)
> >>$RequestServicerFilter_10259d67c6d.service($RequestServicerFilter_10259d67c6d.java)
> >>$RequestServicerFilter_10259d67c6c.service($RequestServicerFilter_10259d67c6c.java)
> >>$RequestServicer_10259d67c6e.service($RequestServicer_10259d67c6e.java)
> >>$RequestServicer_10259d67c65.service($RequestServicer_10259d67c65.java)
> >>$RequestServicer_10259d67c64.service($RequestServicer_10259d67c64.java)
> >>org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:128)
> >>org.apache.tapestry.ApplicationServlet.doGet(ApplicationServlet.java:94)
> >>javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
> >>javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> >>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
> >>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
> >>org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)
> >>org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
> >>org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
> >>org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
> >>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> >>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> >>org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
> >>org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
> >>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> >>org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:44)
> >>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
> >>org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:169)
> >>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
> >>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> >>org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
> >>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> >>org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
> >>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
> >>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> >>org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> >>org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
> >>org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
> >>org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
> >>org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
> >>org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
> >>org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
> >>org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
> >>org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
> >>java.lang.Thread.run(Thread.java:534)
> >>
> >>Any ideas ?
> >>
> >>Thanks
> >>
> >>Hugo
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> >>
> >>
> >
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 
> 


-- 
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message