I tried to add @Order("after:*") to the contributeBeanBlockSource method but the execution order is still random.....

Am 20.10.2008 um 23:40 schrieb Moritz Gmelin:

Hi Howard,

Thanks for taking the time to answer. I understand the licensing thing. However the other problem seems to be more serious.

My own contributed BeanBlockSources to override the standard Date editor is taken into account on a random basis.

I have added some println's in TapestryModule contributeBeanBlockSource and in my AppModules contributeBeanBlockSource method.

The order in which those two methods are called is random. Sometimes yours is called first then mine (in which case my contributed DateTime Editor is used). On other application starts, my contributeBeanBlockSource method is called before yours. Causing my Custom Editor to be ignored (overriden by yours).

Here are two stack traces from within both methods that might help solve this serious issue

Contributing DateTimeField BeanBlockContribution in TapestryModule
java.lang.Throwable
at org .apache .tapestry5 .services .TapestryModule.contributeBeanBlockSource(TapestryModule.java:444)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun .reflect .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun .reflect .DelegatingMethodAccessorImpl .invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
at org .apache .tapestry5 .ioc .internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java: 95) at org .apache .tapestry5 .ioc .internal.ContributionDefImpl.contribute(ContributionDefImpl.java:56) at org .apache .tapestry5 .ioc .internal.RegistryImpl.addToUnorderedConfiguration(RegistryImpl.java: 481) at org .apache .tapestry5 .ioc .internal.RegistryImpl.getUnorderedConfiguration(RegistryImpl.java: 355) at org .apache .tapestry5 .ioc .internal .ServiceResourcesImpl .getUnorderedConfiguration(ServiceResourcesImpl.java:72) at org .apache .tapestry5 .ioc .internal .AbstractServiceCreator .addUnorderedConfigurationParameter(AbstractServiceCreator.java:140) at org .apache .tapestry5 .ioc .internal .AbstractServiceCreator .getParameterDefaultsWithConfiguration(AbstractServiceCreator.java: 106) at org .apache .tapestry5 .ioc .internal .ConstructorServiceCreator .getParameterDefaultsWithConfigurations (ConstructorServiceCreator.java:72) at org .apache .tapestry5 .ioc .internal .ConstructorServiceCreator .createObject(ConstructorServiceCreator.java:47) at org .apache .tapestry5 .ioc .internal .SingletonServiceLifecycle .createService(SingletonServiceLifecycle.java:29) at org .apache .tapestry5 .ioc .internal .LifecycleWrappedServiceCreator .createObject(LifecycleWrappedServiceCreator.java:52) at org .apache .tapestry5 .ioc .internal .InterceptorStackBuilder.createObject(InterceptorStackBuilder.java:50) at org .apache .tapestry5 .ioc .internal .RecursiveServiceCreationCheckWrapper .createObject(RecursiveServiceCreationCheckWrapper.java:60) at org .apache .tapestry5 .ioc .internal .services .JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:65) at $ BeanBlockSource_11d1c2a616c .delegate($BeanBlockSource_11d1c2a616c.java) at $ BeanBlockSource_11d1c2a616c .getEditBlock($BeanBlockSource_11d1c2a616c.java) at org .apache .tapestry5 .corelib.components.PropertyEditor.beginRender(PropertyEditor.java: 253) at org .apache .tapestry5 .corelib.components.PropertyEditor.beginRender(PropertyEditor.java) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl $11$1.run(ComponentPageElementImpl.java:347) at org .apache .tapestry5 .internal .structure .ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:912) at org .apache.tapestry5.internal.structure.ComponentPageElementImpl.access $1(ComponentPageElementImpl.java:904) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl $11.render(ComponentPageElementImpl.java:351) at org .apache .tapestry5 .internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72) at org .apache .tapestry5 .internal .services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:108) at $PageRenderQueue_11d1c2a618f.render($PageRenderQueue_11d1c2a618f.java) at $PageRenderQueue_11d1c2a617e.render($PageRenderQueue_11d1c2a617e.java) at org.apache.tapestry5.services.TapestryModule $19.renderMarkup(TapestryModule.java:1201) at org.apache.tapestry5.services.TapestryModule $28.renderMarkup(TapestryModule.java:1552) at $ MarkupRenderer_11d1c2a6191 .renderMarkup($MarkupRenderer_11d1c2a6191.java) at org.apache.tapestry5.services.TapestryModule $27.renderMarkup(TapestryModule.java:1533) at $ MarkupRenderer_11d1c2a6191 .renderMarkup($MarkupRenderer_11d1c2a6191.java) at org.apache.tapestry5.services.TapestryModule $26.renderMarkup(TapestryModule.java:1515) at $ MarkupRenderer_11d1c2a6191 .renderMarkup($MarkupRenderer_11d1c2a6191.java) at org.apache.tapestry5.services.TapestryModule $25.renderMarkup(TapestryModule.java:1495) at $ MarkupRenderer_11d1c2a6191 .renderMarkup($MarkupRenderer_11d1c2a6191.java) at $ MarkupRenderer_11d1c2a618d .renderMarkup($MarkupRenderer_11d1c2a618d.java) at org .apache .tapestry5 .internal .services .PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java: 64) at $ PageMarkupRenderer_11d1c2a618b .renderPageMarkup($PageMarkupRenderer_11d1c2a618b.java) at org .apache .tapestry5 .internal .services .PageResponseRendererImpl .renderPageResponse(PageResponseRendererImpl.java:57) at $ PageResponseRenderer_11d1c2a6187 .renderPageResponse($PageResponseRenderer_11d1c2a6187.java) at org .apache .tapestry5 .internal .services .PageRenderRequestHandlerImpl .handle(PageRenderRequestHandlerImpl.java:59) at org.apache.tapestry5.services.TapestryModule $33.handle(TapestryModule.java:1733) at $ PageRenderRequestHandler_11d1c2a6188 .handle($PageRenderRequestHandler_11d1c2a6188.java) at $ PageRenderRequestHandler_11d1c2a6127 .handle($PageRenderRequestHandler_11d1c2a6127.java) at org .apache .tapestry5 .internal .services.PageRenderDispatcher.process(PageRenderDispatcher.java:97) at org .apache .tapestry5 .internal .services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:73)
        at $Dispatcher_11d1c2a6132.dispatch($Dispatcher_11d1c2a6132.java)
        at $Dispatcher_11d1c2a6120.dispatch($Dispatcher_11d1c2a6120.java)
at org.apache.tapestry5.services.TapestryModule $17.service(TapestryModule.java:1027)
        at de.avetana.t5app.services.AppModule$5.service(AppModule.java:365)
at $RequestFilter_11d1c2a611e.service($RequestFilter_11d1c2a611e.java) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java)
        at de.avetana.t5app.services.AppModule$6.service(AppModule.java:397)
at $RequestFilter_11d1c2a611f.service($RequestFilter_11d1c2a611f.java) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java) at org .apache .tapestry5 .internal .services.LocalizationFilter.service(LocalizationFilter.java:42) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java) at org .apache .tapestry5 .internal .services.RequestErrorFilter.service(RequestErrorFilter.java:26) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java) at org.apache.tapestry5.services.TapestryModule $3.service(TapestryModule.java:626) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java) at org.apache.tapestry5.services.TapestryModule $2.service(TapestryModule.java:616) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java) at org .apache .tapestry5 .internal.services.StaticFilesFilter.service(StaticFilesFilter.java: 85) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:93) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:1) at org .apache .tapestry5 .ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java: 83) at org .apache .tapestry5 .internal .services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java: 106) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java) at $RequestHandler_11d1c2a6116.service($RequestHandler_11d1c2a6116.java) at org.apache.tapestry5.services.TapestryModule $16.service(TapestryModule.java:1007) at org .apache .tapestry5 .upload .internal .services .MultipartServletRequestFilter .service(MultipartServletRequestFilter.java:44) at $ HttpServletRequestHandler_11d1c2a6117 .service($HttpServletRequestHandler_11d1c2a6117.java) at org .apache .tapestry5 .internal .services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) at $ HttpServletRequestFilter_11d1c2a6114 .service($HttpServletRequestFilter_11d1c2a6114.java) at $ HttpServletRequestHandler_11d1c2a6117 .service($HttpServletRequestHandler_11d1c2a6117.java) at $ HttpServletRequestHandler_11d1c2a6113 .service($HttpServletRequestHandler_11d1c2a6113.java) at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java: 179) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1065) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 365) at org .mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 185) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 689) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 391) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 139)
        at org.mortbay.jetty.Server.handle(Server.java:285)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 457) at org.mortbay.jetty.HttpConnection $RequestHandler.headerComplete(HttpConnection.java:751)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
at org .mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 329) at org.mortbay.thread.BoundedThreadPool $PoolThread.run(BoundedThreadPool.java:475)


Contributing DateTimeField BeanBlockContribution in CustomApplication
java.lang.Throwable
at de .avetana .t5app.services.AppModule.contributeBeanBlockSource(AppModule.java: 133)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun .reflect .NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun .reflect .DelegatingMethodAccessorImpl .invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
at org .apache .tapestry5 .ioc .internal.ContributionDefImpl.invokeMethod(ContributionDefImpl.java: 95) at org .apache .tapestry5 .ioc .internal.ContributionDefImpl.contribute(ContributionDefImpl.java:56) at org .apache .tapestry5 .ioc .internal.RegistryImpl.addToUnorderedConfiguration(RegistryImpl.java: 481) at org .apache .tapestry5 .ioc .internal.RegistryImpl.getUnorderedConfiguration(RegistryImpl.java: 355) at org .apache .tapestry5 .ioc .internal .ServiceResourcesImpl .getUnorderedConfiguration(ServiceResourcesImpl.java:72) at org .apache .tapestry5 .ioc .internal .AbstractServiceCreator .addUnorderedConfigurationParameter(AbstractServiceCreator.java:140) at org .apache .tapestry5 .ioc .internal .AbstractServiceCreator .getParameterDefaultsWithConfiguration(AbstractServiceCreator.java: 106) at org .apache .tapestry5 .ioc .internal .ConstructorServiceCreator .getParameterDefaultsWithConfigurations (ConstructorServiceCreator.java:72) at org .apache .tapestry5 .ioc .internal .ConstructorServiceCreator .createObject(ConstructorServiceCreator.java:47) at org .apache .tapestry5 .ioc .internal .SingletonServiceLifecycle .createService(SingletonServiceLifecycle.java:29) at org .apache .tapestry5 .ioc .internal .LifecycleWrappedServiceCreator .createObject(LifecycleWrappedServiceCreator.java:52) at org .apache .tapestry5 .ioc .internal .InterceptorStackBuilder.createObject(InterceptorStackBuilder.java:50) at org .apache .tapestry5 .ioc .internal .RecursiveServiceCreationCheckWrapper .createObject(RecursiveServiceCreationCheckWrapper.java:60) at org .apache .tapestry5 .ioc .internal .services .JustInTimeObjectCreator.createObject(JustInTimeObjectCreator.java:65) at $ BeanBlockSource_11d1c2a616c .delegate($BeanBlockSource_11d1c2a616c.java) at $ BeanBlockSource_11d1c2a616c .getEditBlock($BeanBlockSource_11d1c2a616c.java) at org .apache .tapestry5 .corelib.components.PropertyEditor.beginRender(PropertyEditor.java: 253) at org .apache .tapestry5 .corelib.components.PropertyEditor.beginRender(PropertyEditor.java) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl $11$1.run(ComponentPageElementImpl.java:347) at org .apache .tapestry5 .internal .structure .ComponentPageElementImpl.invoke(ComponentPageElementImpl.java:912) at org .apache.tapestry5.internal.structure.ComponentPageElementImpl.access $1(ComponentPageElementImpl.java:904) at org.apache.tapestry5.internal.structure.ComponentPageElementImpl $11.render(ComponentPageElementImpl.java:351) at org .apache .tapestry5 .internal.services.RenderQueueImpl.run(RenderQueueImpl.java:72) at org .apache .tapestry5 .internal .services.PageRenderQueueImpl.render(PageRenderQueueImpl.java:108) at $PageRenderQueue_11d1c2a618f.render($PageRenderQueue_11d1c2a618f.java) at $PageRenderQueue_11d1c2a617e.render($PageRenderQueue_11d1c2a617e.java) at org.apache.tapestry5.services.TapestryModule $19.renderMarkup(TapestryModule.java:1201) at org.apache.tapestry5.services.TapestryModule $28.renderMarkup(TapestryModule.java:1552) at $ MarkupRenderer_11d1c2a6191 .renderMarkup($MarkupRenderer_11d1c2a6191.java) at org.apache.tapestry5.services.TapestryModule $27.renderMarkup(TapestryModule.java:1533) at $ MarkupRenderer_11d1c2a6191 .renderMarkup($MarkupRenderer_11d1c2a6191.java) at org.apache.tapestry5.services.TapestryModule $26.renderMarkup(TapestryModule.java:1515) at $ MarkupRenderer_11d1c2a6191 .renderMarkup($MarkupRenderer_11d1c2a6191.java) at org.apache.tapestry5.services.TapestryModule $25.renderMarkup(TapestryModule.java:1495) at $ MarkupRenderer_11d1c2a6191 .renderMarkup($MarkupRenderer_11d1c2a6191.java) at $ MarkupRenderer_11d1c2a618d .renderMarkup($MarkupRenderer_11d1c2a618d.java) at org .apache .tapestry5 .internal .services .PageMarkupRendererImpl.renderPageMarkup(PageMarkupRendererImpl.java: 64) at $ PageMarkupRenderer_11d1c2a618b .renderPageMarkup($PageMarkupRenderer_11d1c2a618b.java) at org .apache .tapestry5 .internal .services .PageResponseRendererImpl .renderPageResponse(PageResponseRendererImpl.java:57) at $ PageResponseRenderer_11d1c2a6187 .renderPageResponse($PageResponseRenderer_11d1c2a6187.java) at org .apache .tapestry5 .internal .services .PageRenderRequestHandlerImpl .handle(PageRenderRequestHandlerImpl.java:59) at org.apache.tapestry5.services.TapestryModule $33.handle(TapestryModule.java:1733) at $ PageRenderRequestHandler_11d1c2a6188 .handle($PageRenderRequestHandler_11d1c2a6188.java) at $ PageRenderRequestHandler_11d1c2a6127 .handle($PageRenderRequestHandler_11d1c2a6127.java) at org .apache .tapestry5 .internal .services.PageRenderDispatcher.process(PageRenderDispatcher.java:97) at org .apache .tapestry5 .internal .services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:73)
        at $Dispatcher_11d1c2a6132.dispatch($Dispatcher_11d1c2a6132.java)
        at $Dispatcher_11d1c2a6120.dispatch($Dispatcher_11d1c2a6120.java)
at org.apache.tapestry5.services.TapestryModule $17.service(TapestryModule.java:1027)
        at de.avetana.t5app.services.AppModule$5.service(AppModule.java:365)
at $RequestFilter_11d1c2a611e.service($RequestFilter_11d1c2a611e.java) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java)
        at de.avetana.t5app.services.AppModule$6.service(AppModule.java:397)
at $RequestFilter_11d1c2a611f.service($RequestFilter_11d1c2a611f.java) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java) at org .apache .tapestry5 .internal .services.LocalizationFilter.service(LocalizationFilter.java:42) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java) at org .apache .tapestry5 .internal .services.RequestErrorFilter.service(RequestErrorFilter.java:26) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java) at org.apache.tapestry5.services.TapestryModule $3.service(TapestryModule.java:626) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java) at org.apache.tapestry5.services.TapestryModule $2.service(TapestryModule.java:616) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java) at org .apache .tapestry5 .internal.services.StaticFilesFilter.service(StaticFilesFilter.java: 85) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:93) at org.apache.tapestry5.internal.services.CheckForUpdatesFilter $2.invoke(CheckForUpdatesFilter.java:1) at org .apache .tapestry5 .ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java: 83) at org .apache .tapestry5 .internal .services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java: 106) at $RequestHandler_11d1c2a6121.service($RequestHandler_11d1c2a6121.java) at $RequestHandler_11d1c2a6116.service($RequestHandler_11d1c2a6116.java) at org.apache.tapestry5.services.TapestryModule $16.service(TapestryModule.java:1007) at org .apache .tapestry5 .upload .internal .services .MultipartServletRequestFilter .service(MultipartServletRequestFilter.java:44) at $ HttpServletRequestHandler_11d1c2a6117 .service($HttpServletRequestHandler_11d1c2a6117.java) at org .apache .tapestry5 .internal .services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62) at $ HttpServletRequestFilter_11d1c2a6114 .service($HttpServletRequestFilter_11d1c2a6114.java) at $ HttpServletRequestHandler_11d1c2a6117 .service($HttpServletRequestHandler_11d1c2a6117.java) at $ HttpServletRequestHandler_11d1c2a6113 .service($HttpServletRequestHandler_11d1c2a6113.java) at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java: 179) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1065) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 365) at org .mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 185) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 689) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java: 391) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 139)
        at org.mortbay.jetty.Server.handle(Server.java:285)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 457) at org.mortbay.jetty.HttpConnection $RequestHandler.headerComplete(HttpConnection.java:751)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
at org .mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 329) at org.mortbay.thread.BoundedThreadPool $PoolThread.run(BoundedThreadPool.java:475)





Am 17.10.2008 um 15:33 schrieb Howard Lewis Ship:

On Fri, Oct 17, 2008 at 2:56 AM, Moritz Gmelin <[EMAIL PROTECTED]> wrote:
Hi,

In our application we override the default editing component for Date types
to be the DateTimeEditor from t5-components (why is that one not the
default. It is so much nicer?).

Licensing.  An Apache project has certain limitations in this regard;
fortunately, Tapestry is so good at late binding that you can bypass
those kinds of issues.



AppModule.java
     public static void contributeBeanBlockSource(
Configuration<BeanBlockContribution>
configuration)
     {

             configuration.add(new BeanBlockContribution("date",
                     "AppPropertyEditBlocks", "date", true));

     }

Now it sometimes happens that dates are still rendered with the T5_Default DateField editor. Re-starting the application most often solves this so that
my contributed renderer is used again.
Is this some kind of timing issue in T5.0.15 with the contributions?

None that I can think of.  If you look at the code, there's not any
room for variations as you describibe; a Map is created when the
BeanBlockSource is realized and then the Map is just used.  Something
else must be going on.


Thanks

Moritz



--
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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



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

Reply via email to