Re: Page pool hard limit and page instance usage
Hi list, I am also facing the problem that 9902468 had. I have -according to Howard's suggestion- replaced every pageLink with a customPageLink to prevent targeted pages from being created unecessarily. The problem persists. Trying to load the index-Page of my application with a browser I have to wait about two minutes before I get an empty page. In the app's log the following Exception appears: java.lang.RuntimeException: The page pool for page 'Index' (in locale de) has been exausted: there are 20 instances currently being used and no more can be created. Try increasing the hard limit (symbol tapestry.page-pool.hard-limit) to allow additional instances to be created, or increasing the soft wait (symbol tapestry.page-pool.soft-wait) to trade away some throughput for more efficient use of page instances. at org.apache.tapestry5.internal.services.PagePoolCache.checkout(PagePoolCache.java:199) at org.apache.tapestry5.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:107) at $PagePool_11c76f8cf9a.checkout($PagePool_11c76f8cf9a.java) at org.apache.tapestry5.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:43) at $RequestPageCache_11c76f8cf99.get($RequestPageCache_11c76f8cf99.java) at $RequestPageCache_11c76f8cf91.get($RequestPageCache_11c76f8cf91.java) ... In development and in production environment I use Java 6 and Tomcat 6. Tapestry is 5.0.14. The strange thing is that I am only seeing this in production environment. Has anyone a suggestion how to track this down? I am pretty stuck with this. Thanks in advance, nillehammer Howard Lewis Ship wrote Tapestry is obtaining page instances to see if there is an activation context for the page. I expect to optimize this in the future, to check to see if the page has an event handler for the passivate event. In the meantime, you could build your own PageLink component that generates the link by invoking ComponentResources.createPageLink(pagename, true) ... that will tell Tapestry to generate a link to the page with no activation context, and the page will NOT be queried for its context, and therefore, won't need to be attached to the current request. On Fri, Aug 29, 2008 at 3:58 AM, 9902468 [EMAIL PROTECTED] wrote: Hi, we are experiencing strange hard pool limit reached exceptions. (For the user count that we have.) After debugging a little, it seems that our left menu component, which is full of page links, instantiates not only the page that we are at, but also the ones that are referenced in page link. This can be seen also in that exception page is shown, if one of the pages that are referenced in page links have an error. Is this correct behavior? And should we really use common a href= tags to avoid this? Further more, is it possible to create infinite loop, when page a has page link to page b, which has page link to page a? - 99 -- View this message in context: http://www.nabble.com/Page-pool-hard-limit-and-page-instance-usage-tp19217773p19217773.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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]
Re: Page pool hard limit and page instance usage
Hi, Eventually we had to add these to appmodule: configuration.add(tapestry.page-pool.hard-limit, 60); configuration.add(tapestry.page-pool.soft-limit, 20); configuration.add(tapestry.page-pool.soft-wait, 20 ms); as instructed here: http://tapestry.apache.org/tapestry5/guide/conf.html This solved our problems, and you can go up as long as your server has memory. Our problems were only in production, as development stress just isn't enough. (This is why one really should do load testing with jmeter or similar tool.) The defaults could be a bit more? Or considerably less, so that the developer would hit these walls during development and understands to load test / tune the parameters. - 99 nille hammer wrote: Hi list, I am also facing the problem that 9902468 had. I have -according to Howard's suggestion- replaced every pageLink with a customPageLink to prevent targeted pages from being created unecessarily. The problem persists. Trying to load the index-Page of my application with a browser I have to wait about two minutes before I get an empty page. In the app's log the following Exception appears: java.lang.RuntimeException: The page pool for page 'Index' (in locale de) has been exausted: there are 20 instances currently being used and no more can be created. Try increasing the hard limit (symbol tapestry.page-pool.hard-limit) to allow additional instances to be created, or increasing the soft wait (symbol tapestry.page-pool.soft-wait) to trade away some throughput for more efficient use of page instances. at org.apache.tapestry5.internal.services.PagePoolCache.checkout(PagePoolCache.java:199) at org.apache.tapestry5.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:107) at $PagePool_11c76f8cf9a.checkout($PagePool_11c76f8cf9a.java) at org.apache.tapestry5.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:43) at $RequestPageCache_11c76f8cf99.get($RequestPageCache_11c76f8cf99.java) at $RequestPageCache_11c76f8cf91.get($RequestPageCache_11c76f8cf91.java) ... In development and in production environment I use Java 6 and Tomcat 6. Tapestry is 5.0.14. The strange thing is that I am only seeing this in production environment. Has anyone a suggestion how to track this down? I am pretty stuck with this. Thanks in advance, nillehammer Howard Lewis Ship wrote Tapestry is obtaining page instances to see if there is an activation context for the page. I expect to optimize this in the future, to check to see if the page has an event handler for the passivate event. In the meantime, you could build your own PageLink component that generates the link by invoking ComponentResources.createPageLink(pagename, true) ... that will tell Tapestry to generate a link to the page with no activation context, and the page will NOT be queried for its context, and therefore, won't need to be attached to the current request. On Fri, Aug 29, 2008 at 3:58 AM, 9902468 [EMAIL PROTECTED] wrote: Hi, we are experiencing strange hard pool limit reached exceptions. (For the user count that we have.) After debugging a little, it seems that our left menu component, which is full of page links, instantiates not only the page that we are at, but also the ones that are referenced in page link. This can be seen also in that exception page is shown, if one of the pages that are referenced in page links have an error. Is this correct behavior? And should we really use common a href= tags to avoid this? Further more, is it possible to create infinite loop, when page a has page link to page b, which has page link to page a? - 99 -- View this message in context: http://www.nabble.com/Page-pool-hard-limit-and-page-instance-usage-tp19217773p19217773.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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] -- View this message in context: http://www.nabble.com/Page-pool-hard-limit-and-page-instance-usage-tp19217773p19567417.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] loading tapestry configuration from properties file?
Ulrich Stärk wrote: Russell Brown schrieb: What 'it'? You mean symbol names? Well the 'it' was the class, or moreover the approach but that does result in specifically the symbol names in this instance, so: Yes that it, or they. Indeed. I think I could just load everything into a Map, thereby making it all lower case, and call toLowerCase() on valueForSymbol()'s argument during lookup. I'll see if I can find time to do that this evening. Looking at the built-in MapSymbolProvider, I do not see any special handling of case-sensitivity either. Is it a possible bug or is this handled elsewhere? http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/MapSymbolProvider.java?view=markup Rgds, Neeme - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page pool hard limit and page instance usage
Man that was a quick answer! Thanks for that. I am aware of this options in the configuration. I had not tuned them before, because load is not my problem. Anyway I have tuned them now and am currently waiting for the admistrator to deploy the newest war. According to acces-logs I was the only user accessing the page. So as far as I understand the mechanism only one instance of index should have been created and not 20. I think it is an issue with configuration in production environment. But I have no idea where to take a closer look (i.e. where to build in log-messages, which of Tomcat's configuration options to check etc.). So suggestions are still more than welcome. Nillehammer 9902468 schrieb: Hi, Eventually we had to add these to appmodule: configuration.add(tapestry.page-pool.hard-limit, 60); configuration.add(tapestry.page-pool.soft-limit, 20); configuration.add(tapestry.page-pool.soft-wait, 20 ms); as instructed here: http://tapestry.apache.org/tapestry5/guide/conf.html This solved our problems, and you can go up as long as your server has memory. Our problems were only in production, as development stress just isn't enough. (This is why one really should do load testing with jmeter or similar tool.) The defaults could be a bit more? Or considerably less, so that the developer would hit these walls during development and understands to load test / tune the parameters. - 99 nille hammer wrote: Hi list, I am also facing the problem that 9902468 had. I have -according to Howard's suggestion- replaced every pageLink with a customPageLink to prevent targeted pages from being created unecessarily. The problem persists. Trying to load the index-Page of my application with a browser I have to wait about two minutes before I get an empty page. In the app's log the following Exception appears: java.lang.RuntimeException: The page pool for page 'Index' (in locale de) has been exausted: there are 20 instances currently being used and no more can be created. Try increasing the hard limit (symbol tapestry.page-pool.hard-limit) to allow additional instances to be created, or increasing the soft wait (symbol tapestry.page-pool.soft-wait) to trade away some throughput for more efficient use of page instances. at org.apache.tapestry5.internal.services.PagePoolCache.checkout(PagePoolCache.java:199) at org.apache.tapestry5.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:107) at $PagePool_11c76f8cf9a.checkout($PagePool_11c76f8cf9a.java) at org.apache.tapestry5.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:43) at $RequestPageCache_11c76f8cf99.get($RequestPageCache_11c76f8cf99.java) at $RequestPageCache_11c76f8cf91.get($RequestPageCache_11c76f8cf91.java) ... In development and in production environment I use Java 6 and Tomcat 6. Tapestry is 5.0.14. The strange thing is that I am only seeing this in production environment. Has anyone a suggestion how to track this down? I am pretty stuck with this. Thanks in advance, nillehammer Howard Lewis Ship wrote Tapestry is obtaining page instances to see if there is an activation context for the page. I expect to optimize this in the future, to check to see if the page has an event handler for the passivate event. In the meantime, you could build your own PageLink component that generates the link by invoking ComponentResources.createPageLink(pagename, true) ... that will tell Tapestry to generate a link to the page with no activation context, and the page will NOT be queried for its context, and therefore, won't need to be attached to the current request. On Fri, Aug 29, 2008 at 3:58 AM, 9902468 [EMAIL PROTECTED] wrote: Hi, we are experiencing strange hard pool limit reached exceptions. (For the user count that we have.) After debugging a little, it seems that our left menu component, which is full of page links, instantiates not only the page that we are at, but also the ones that are referenced in page link. This can be seen also in that exception page is shown, if one of the pages that are referenced in page links have an error. Is this correct behavior? And should we really use common a href= tags to avoid this? Further more, is it possible to create infinite loop, when page a has page link to page b, which has page link to page a? - 99 -- View this message in context: http://www.nabble.com/Page-pool-hard-limit-and-page-instance-usage-tp19217773p19217773.html Sent from the Tapestry - User mailing list archive at Nabble.com. - 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]
Upgrade from T4 to T4.1: Javascript problem
Hi, I was just trying to upgrade from T4 to T4.1 (4.1.6). When Javascript is enabled, the page will be blank. With Javascript disabled in the browser, the page renders just fine. I replaces the ajaxDelegate in the Shell component with an empty render method. This works, but of course I get Javascript errors, that Tapestry is not defined. I'm not sure why the Page is blank. I guess that Tapestry hides the content and waits for the whole DOM tree to be available before it shows the content, but the last steps fails. Can this be? Thanks and Regards, Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] loading tapestry configuration from properties file?
I also revisited my code now. :-P Changes: * if not logger is supplied, it wraps all errors as IllegalArgumentException (fail-fast, as requested by Russell) * supports loading properties from existing Propeties/Dictionary object * extends MapSymbolProvider - so it delegates all case sensitivity issues to that class instead of handling those itself. So it becomes a mere adapter to convert from Properties to Map. As I'm still lazy and you didn't like me overwriting your code, I will just attach it here. If you want, you can overwrite it yourself in wiki, Rgds, Neeme Ulrich Stärk wrote: Neeme Praks schrieb: PS. Sorry about the curly braces style in the refactored class - my eclipse autoformatted it to my coding style and I was too lazy to change it back Please don't be too lazy next time... I revised it a bit because I personally don't like to have several initialization methods (you called them load) for something as simple as loading a properties file. Also all Exceptions are now re-thrown as runtime exceptions so that Tapestry will fail to start when the properties file can not be found or loaded. Cheers, Uli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.net.URL; import java.util.Collections; import java.util.Dictionary; import java.util.Enumeration; import java.util.HashMap; import java.util.Map; import java.util.Properties; import org.apache.tapestry5.ioc.internal.services.MapSymbolProvider; import org.slf4j.Logger; public class PropertiesFileSymbolProvider extends MapSymbolProvider { public PropertiesFileSymbolProvider(Logger logger, String resourceName, boolean loadFromClassPath) { super(convert(logger, resourceName, loadFromClassPath)); } public PropertiesFileSymbolProvider(Logger logger, URL url) { super(convert(logger, url)); } public PropertiesFileSymbolProvider(Logger logger, InputStream in) { super(convert(logger, in)); } public PropertiesFileSymbolProvider(Logger logger, Dictionary?, ? properties) { super(convert(properties)); } private static MapString, String convert(Logger logger, String resourceName, boolean loadFromClassPath) { try { if (loadFromClassPath) { URL url = ClassLoader.getSystemResource(resourceName); if (url == null) throw new FileNotFoundException( properties file resource not found on classpath: + resourceName); return convert(logger, url); } else { return convert(logger, new FileInputStream(resourceName)); } } catch (IOException e) { return handleError(logger, e, error while loading ' + resourceName + ' + (loadFromClassPath ? from classpath : from filesystem)); } } private static MapString, String convert(Logger logger, URL url) { if (url == null) throw new IllegalArgumentException(URL is required!); try { return convert(logger, url.openStream()); } catch (IOException e) { return handleError(logger, e, error while opening URL ' + url + '); } } private static MapString, String convert(Logger logger, InputStream in) { if (in == null) throw new IllegalArgumentException(input stream is required!); Properties properties = new Properties(); try { properties.load(in); return convert(properties); } catch (IOException e) { return handleError(logger, e, error while loading properties file); } } private static MapString, String convert(Dictionary?, ? properties) { if (properties == null) throw new IllegalArgumentException(properties is required!); HashMapString, String map = new HashMapString, String(properties.size()); for (Enumeration? en = properties.keys(); en.hasMoreElements();) { Object key = en.nextElement(); Object value = properties.get(key); map.put(key != null ? key.toString() : null, value != null ? value.toString() : null); } return map; } private static MapString, String handleError(Logger logger, Exception e, String msg) { if (logger != null) { logger.error(msg, e); return Collections.emptyMap(); } else { throw new IllegalArgumentException(msg, e); } } } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upgrade from T4 to T4.1: Javascript problem
No, this shouldn't be the cause of this... Does this happen on FF? Does firebug show any resources not loading? On Fri, Sep 19, 2008 at 11:56 AM, Christian Haselbach [EMAIL PROTECTED] wrote: Hi, I was just trying to upgrade from T4 to T4.1 (4.1.6). When Javascript is enabled, the page will be blank. With Javascript disabled in the browser, the page renders just fine. I replaces the ajaxDelegate in the Shell component with an empty render method. This works, but of course I get Javascript errors, that Tapestry is not defined. I'm not sure why the Page is blank. I guess that Tapestry hides the content and waits for the whole DOM tree to be available before it shows the content, but the last steps fails. Can this be? Thanks and Regards, Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [T5] loading tapestry configuration from properties file?
Neeme Praks schrieb: Ulrich Stärk wrote: Russell Brown schrieb: What 'it'? You mean symbol names? Well the 'it' was the class, or moreover the approach but that does result in specifically the symbol names in this instance, so: Yes that it, or they. Indeed. I think I could just load everything into a Map, thereby making it all lower case, and call toLowerCase() on valueForSymbol()'s argument during lookup. I'll see if I can find time to do that this evening. Looking at the built-in MapSymbolProvider, I do not see any special handling of case-sensitivity either. Is it a possible bug or is this handled elsewhere? http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/MapSymbolProvider.java?view=markup When the value type of the Map is String, Tapestry automatically instantiates an object of type CaseInsensitiveMap. Uli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upgrade from T4 to T4.1: Javascript problem
Hi Andreas Andreou wrote: No, this shouldn't be the cause of this... Does this happen on FF? Does firebug show any resources not loading? It happens on Firefox and IE. No, firebug reports nothing suspicious. I think I saw someone reporting a similar problem, but there was no further response. Regards, Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page pool hard limit and page instance usage
I always keep nabble open when I'm at work :) These parameters can be transferred to web.xml, so that recompile is not needed when changing these parameters: public static void contributeApplicationDefaults(MappedConfigurationString, String configuration, ApplicationGlobals globals) { configuration.add(tapestry.page-pool.hard-limit, globals.getServletContext().getInitParameter(page_hard_limit)); } and in web.xml web-app display-nameSome Tapestry 5 Application/display-name context-param !-- The only significant configuration for Tapestry 5, this informs Tapestry of where to look for pages, components and mixins. -- param-nametapestry.app-package/param-name param-valuefi.hanken.resbuilder.tapestry5/param-value /context-param context-param param-namepage_hard_limit/param-name param-value60/param-value /context-param This can be used through out every single service and page and component. To access this in a page or component use: @Property @Inject @Value(${page_hard_limit}) private String pageHardLimit; Injection can be used in service constructor also (I think) or by using buildSomeService method instead of the usual binder.bind Of course T5 makes it easy to read these from a file or database or from what not, but I have noticed that many admins accept editing web.xml and restarting the app ok. Hopefully this helps. (And makes it easier to say to admins that just configure the app according to the load they are experiencing.) -99 nille hammer wrote: Man that was a quick answer! Thanks for that. I am aware of this options in the configuration. I had not tuned them before, because load is not my problem. Anyway I have tuned them now and am currently waiting for the admistrator to deploy the newest war. According to acces-logs I was the only user accessing the page. So as far as I understand the mechanism only one instance of index should have been created and not 20. I think it is an issue with configuration in production environment. But I have no idea where to take a closer look (i.e. where to build in log-messages, which of Tomcat's configuration options to check etc.). So suggestions are still more than welcome. Nillehammer 9902468 schrieb: Hi, Eventually we had to add these to appmodule: configuration.add(tapestry.page-pool.hard-limit, 60); configuration.add(tapestry.page-pool.soft-limit, 20); configuration.add(tapestry.page-pool.soft-wait, 20 ms); as instructed here: http://tapestry.apache.org/tapestry5/guide/conf.html This solved our problems, and you can go up as long as your server has memory. Our problems were only in production, as development stress just isn't enough. (This is why one really should do load testing with jmeter or similar tool.) The defaults could be a bit more? Or considerably less, so that the developer would hit these walls during development and understands to load test / tune the parameters. - 99 nille hammer wrote: Hi list, I am also facing the problem that 9902468 had. I have -according to Howard's suggestion- replaced every pageLink with a customPageLink to prevent targeted pages from being created unecessarily. The problem persists. Trying to load the index-Page of my application with a browser I have to wait about two minutes before I get an empty page. In the app's log the following Exception appears: java.lang.RuntimeException: The page pool for page 'Index' (in locale de) has been exausted: there are 20 instances currently being used and no more can be created. Try increasing the hard limit (symbol tapestry.page-pool.hard-limit) to allow additional instances to be created, or increasing the soft wait (symbol tapestry.page-pool.soft-wait) to trade away some throughput for more efficient use of page instances. at org.apache.tapestry5.internal.services.PagePoolCache.checkout(PagePoolCache.java:199) at org.apache.tapestry5.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:107) at $PagePool_11c76f8cf9a.checkout($PagePool_11c76f8cf9a.java) at org.apache.tapestry5.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:43) at $RequestPageCache_11c76f8cf99.get($RequestPageCache_11c76f8cf99.java) at $RequestPageCache_11c76f8cf91.get($RequestPageCache_11c76f8cf91.java) ... In development and in production environment I use Java 6 and Tomcat 6. Tapestry is 5.0.14. The strange thing is that I am only seeing this in production environment. Has anyone a suggestion how to track this down? I am pretty stuck with this. Thanks in advance, nillehammer Howard Lewis Ship wrote Tapestry is obtaining page instances to see if there is an activation context for the page. I expect to optimize this in the future, to check to see if the page has an event handler for the passivate event. In the meantime, you could build your
Re: Page pool hard limit and page instance usage
Why not instantiate a ServletContextSymbolProvider (the ServletContext is available from the ApplicationGlobals service) and contribute it to the SymbolProvider before ApplicationDefaults and FactoryDefaults. That way you can directly override tapestry.page-pool.hard-limit and automatically have all other init parameters as symbols, too. Uli 9902468 schrieb: I always keep nabble open when I'm at work :) These parameters can be transferred to web.xml, so that recompile is not needed when changing these parameters: public static void contributeApplicationDefaults(MappedConfigurationString, String configuration, ApplicationGlobals globals) { configuration.add(tapestry.page-pool.hard-limit, globals.getServletContext().getInitParameter(page_hard_limit)); } and in web.xml web-app display-nameSome Tapestry 5 Application/display-name context-param !-- The only significant configuration for Tapestry 5, this informs Tapestry of where to look for pages, components and mixins. -- param-nametapestry.app-package/param-name param-valuefi.hanken.resbuilder.tapestry5/param-value /context-param context-param param-namepage_hard_limit/param-name param-value60/param-value /context-param This can be used through out every single service and page and component. To access this in a page or component use: @Property @Inject @Value(${page_hard_limit}) private String pageHardLimit; Injection can be used in service constructor also (I think) or by using buildSomeService method instead of the usual binder.bind Of course T5 makes it easy to read these from a file or database or from what not, but I have noticed that many admins accept editing web.xml and restarting the app ok. Hopefully this helps. (And makes it easier to say to admins that just configure the app according to the load they are experiencing.) -99 nille hammer wrote: Man that was a quick answer! Thanks for that. I am aware of this options in the configuration. I had not tuned them before, because load is not my problem. Anyway I have tuned them now and am currently waiting for the admistrator to deploy the newest war. According to acces-logs I was the only user accessing the page. So as far as I understand the mechanism only one instance of index should have been created and not 20. I think it is an issue with configuration in production environment. But I have no idea where to take a closer look (i.e. where to build in log-messages, which of Tomcat's configuration options to check etc.). So suggestions are still more than welcome. Nillehammer 9902468 schrieb: Hi, Eventually we had to add these to appmodule: configuration.add(tapestry.page-pool.hard-limit, 60); configuration.add(tapestry.page-pool.soft-limit, 20); configuration.add(tapestry.page-pool.soft-wait, 20 ms); as instructed here: http://tapestry.apache.org/tapestry5/guide/conf.html This solved our problems, and you can go up as long as your server has memory. Our problems were only in production, as development stress just isn't enough. (This is why one really should do load testing with jmeter or similar tool.) The defaults could be a bit more? Or considerably less, so that the developer would hit these walls during development and understands to load test / tune the parameters. - 99 nille hammer wrote: Hi list, I am also facing the problem that 9902468 had. I have -according to Howard's suggestion- replaced every pageLink with a customPageLink to prevent targeted pages from being created unecessarily. The problem persists. Trying to load the index-Page of my application with a browser I have to wait about two minutes before I get an empty page. In the app's log the following Exception appears: java.lang.RuntimeException: The page pool for page 'Index' (in locale de) has been exausted: there are 20 instances currently being used and no more can be created. Try increasing the hard limit (symbol tapestry.page-pool.hard-limit) to allow additional instances to be created, or increasing the soft wait (symbol tapestry.page-pool.soft-wait) to trade away some throughput for more efficient use of page instances. at org.apache.tapestry5.internal.services.PagePoolCache.checkout(PagePoolCache.java:199) at org.apache.tapestry5.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:107) at $PagePool_11c76f8cf9a.checkout($PagePool_11c76f8cf9a.java) at org.apache.tapestry5.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:43) at $RequestPageCache_11c76f8cf99.get($RequestPageCache_11c76f8cf99.java) at $RequestPageCache_11c76f8cf91.get($RequestPageCache_11c76f8cf91.java) ... In development and in production environment I use Java 6 and Tomcat 6. Tapestry is 5.0.14. The strange thing is that I am only seeing this in production environment. Has anyone a suggestion how to track this down? I am pretty stuck with this. Thanks in
Re: Upgrade from T4 to T4.1: Javascript problem
well, if it's easily reproducable add a bug report - otherwise, perhaps attaching the resulting html might help us find the cause On Fri, Sep 19, 2008 at 12:57 PM, Christian Haselbach [EMAIL PROTECTED] wrote: Hi Andreas Andreou wrote: No, this shouldn't be the cause of this... Does this happen on FF? Does firebug show any resources not loading? It happens on Firefox and IE. No, firebug reports nothing suspicious. I think I saw someone reporting a similar problem, but there was no further response. Regards, Christian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Page pool hard limit and page instance usage
Yep, just read through your discussion: http://www.nabble.com/forum/ViewPost.jtp?post=19547763framed=yskin=302 and that would be the intelligent way of doing it :) I'll code symbol provider when I have time. Hopefully these providers can be included in T5 distribution, as these are highly reusable and add only little to none weight to the distribution. - 99 Ulrich Stärk wrote: Why not instantiate a ServletContextSymbolProvider (the ServletContext is available from the ApplicationGlobals service) and contribute it to the SymbolProvider before ApplicationDefaults and FactoryDefaults. That way you can directly override tapestry.page-pool.hard-limit and automatically have all other init parameters as symbols, too. Uli 9902468 schrieb: I always keep nabble open when I'm at work :) These parameters can be transferred to web.xml, so that recompile is not needed when changing these parameters: public static void contributeApplicationDefaults(MappedConfigurationString, String configuration, ApplicationGlobals globals) { configuration.add(tapestry.page-pool.hard-limit, globals.getServletContext().getInitParameter(page_hard_limit)); } and in web.xml web-app display-nameSome Tapestry 5 Application/display-name context-param !-- The only significant configuration for Tapestry 5, this informs Tapestry of where to look for pages, components and mixins. -- param-nametapestry.app-package/param-name param-valuefi.hanken.resbuilder.tapestry5/param-value /context-param context-param param-namepage_hard_limit/param-name param-value60/param-value /context-param This can be used through out every single service and page and component. To access this in a page or component use: @Property @Inject @Value(${page_hard_limit}) private String pageHardLimit; Injection can be used in service constructor also (I think) or by using buildSomeService method instead of the usual binder.bind Of course T5 makes it easy to read these from a file or database or from what not, but I have noticed that many admins accept editing web.xml and restarting the app ok. Hopefully this helps. (And makes it easier to say to admins that just configure the app according to the load they are experiencing.) -99 nille hammer wrote: Man that was a quick answer! Thanks for that. I am aware of this options in the configuration. I had not tuned them before, because load is not my problem. Anyway I have tuned them now and am currently waiting for the admistrator to deploy the newest war. According to acces-logs I was the only user accessing the page. So as far as I understand the mechanism only one instance of index should have been created and not 20. I think it is an issue with configuration in production environment. But I have no idea where to take a closer look (i.e. where to build in log-messages, which of Tomcat's configuration options to check etc.). So suggestions are still more than welcome. Nillehammer 9902468 schrieb: Hi, Eventually we had to add these to appmodule: configuration.add(tapestry.page-pool.hard-limit, 60); configuration.add(tapestry.page-pool.soft-limit, 20); configuration.add(tapestry.page-pool.soft-wait, 20 ms); as instructed here: http://tapestry.apache.org/tapestry5/guide/conf.html This solved our problems, and you can go up as long as your server has memory. Our problems were only in production, as development stress just isn't enough. (This is why one really should do load testing with jmeter or similar tool.) The defaults could be a bit more? Or considerably less, so that the developer would hit these walls during development and understands to load test / tune the parameters. - 99 nille hammer wrote: Hi list, I am also facing the problem that 9902468 had. I have -according to Howard's suggestion- replaced every pageLink with a customPageLink to prevent targeted pages from being created unecessarily. The problem persists. Trying to load the index-Page of my application with a browser I have to wait about two minutes before I get an empty page. In the app's log the following Exception appears: java.lang.RuntimeException: The page pool for page 'Index' (in locale de) has been exausted: there are 20 instances currently being used and no more can be created. Try increasing the hard limit (symbol tapestry.page-pool.hard-limit) to allow additional instances to be created, or increasing the soft wait (symbol tapestry.page-pool.soft-wait) to trade away some throughput for more efficient use of page instances. at org.apache.tapestry5.internal.services.PagePoolCache.checkout(PagePoolCache.java:199) at org.apache.tapestry5.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:107) at $PagePool_11c76f8cf9a.checkout($PagePool_11c76f8cf9a.java) at
Re: Page pool hard limit and page instance usage
You don't have to write your own ServletContextSymbolProvider, it already comes shipped with Tapestry. See here http://tapestry.apache.org/tapestry5/apidocs/index.html?org/apache/tapestry5/ioc/services/SymbolProvider.html You just have to configure it. Uli 9902468 schrieb: Yep, just read through your discussion: http://www.nabble.com/forum/ViewPost.jtp?post=19547763framed=yskin=302 and that would be the intelligent way of doing it :) I'll code symbol provider when I have time. Hopefully these providers can be included in T5 distribution, as these are highly reusable and add only little to none weight to the distribution. - 99 Ulrich Stärk wrote: Why not instantiate a ServletContextSymbolProvider (the ServletContext is available from the ApplicationGlobals service) and contribute it to the SymbolProvider before ApplicationDefaults and FactoryDefaults. That way you can directly override tapestry.page-pool.hard-limit and automatically have all other init parameters as symbols, too. Uli 9902468 schrieb: I always keep nabble open when I'm at work :) These parameters can be transferred to web.xml, so that recompile is not needed when changing these parameters: public static void contributeApplicationDefaults(MappedConfigurationString, String configuration, ApplicationGlobals globals) { configuration.add(tapestry.page-pool.hard-limit, globals.getServletContext().getInitParameter(page_hard_limit)); } and in web.xml web-app display-nameSome Tapestry 5 Application/display-name context-param !-- The only significant configuration for Tapestry 5, this informs Tapestry of where to look for pages, components and mixins. -- param-nametapestry.app-package/param-name param-valuefi.hanken.resbuilder.tapestry5/param-value /context-param context-param param-namepage_hard_limit/param-name param-value60/param-value /context-param This can be used through out every single service and page and component. To access this in a page or component use: @Property @Inject @Value(${page_hard_limit}) private String pageHardLimit; Injection can be used in service constructor also (I think) or by using buildSomeService method instead of the usual binder.bind Of course T5 makes it easy to read these from a file or database or from what not, but I have noticed that many admins accept editing web.xml and restarting the app ok. Hopefully this helps. (And makes it easier to say to admins that just configure the app according to the load they are experiencing.) -99 nille hammer wrote: Man that was a quick answer! Thanks for that. I am aware of this options in the configuration. I had not tuned them before, because load is not my problem. Anyway I have tuned them now and am currently waiting for the admistrator to deploy the newest war. According to acces-logs I was the only user accessing the page. So as far as I understand the mechanism only one instance of index should have been created and not 20. I think it is an issue with configuration in production environment. But I have no idea where to take a closer look (i.e. where to build in log-messages, which of Tomcat's configuration options to check etc.). So suggestions are still more than welcome. Nillehammer 9902468 schrieb: Hi, Eventually we had to add these to appmodule: configuration.add(tapestry.page-pool.hard-limit, 60); configuration.add(tapestry.page-pool.soft-limit, 20); configuration.add(tapestry.page-pool.soft-wait, 20 ms); as instructed here: http://tapestry.apache.org/tapestry5/guide/conf.html This solved our problems, and you can go up as long as your server has memory. Our problems were only in production, as development stress just isn't enough. (This is why one really should do load testing with jmeter or similar tool.) The defaults could be a bit more? Or considerably less, so that the developer would hit these walls during development and understands to load test / tune the parameters. - 99 nille hammer wrote: Hi list, I am also facing the problem that 9902468 had. I have -according to Howard's suggestion- replaced every pageLink with a customPageLink to prevent targeted pages from being created unecessarily. The problem persists. Trying to load the index-Page of my application with a browser I have to wait about two minutes before I get an empty page. In the app's log the following Exception appears: java.lang.RuntimeException: The page pool for page 'Index' (in locale de) has been exausted: there are 20 instances currently being used and no more can be created. Try increasing the hard limit (symbol tapestry.page-pool.hard-limit) to allow additional instances to be created, or increasing the soft wait (symbol tapestry.page-pool.soft-wait) to trade away some throughput for more efficient use of page instances. at org.apache.tapestry5.internal.services.PagePoolCache.checkout(PagePoolCache.java:199) at
Re: Page pool hard limit and page instance usage
Thanks! Obviously I should read more than code :) btw, case insensitive map can be obtained by calling org.apache.tapestry5.ioc.internal.util.CollectionFactory.newCaseInsensitiveMap(); - 99 Ulrich Stärk wrote: You don't have to write your own ServletContextSymbolProvider, it already comes shipped with Tapestry. See here http://tapestry.apache.org/tapestry5/apidocs/index.html?org/apache/tapestry5/ioc/services/SymbolProvider.html You just have to configure it. Uli 9902468 schrieb: Yep, just read through your discussion: http://www.nabble.com/forum/ViewPost.jtp?post=19547763framed=yskin=302 and that would be the intelligent way of doing it :) I'll code symbol provider when I have time. Hopefully these providers can be included in T5 distribution, as these are highly reusable and add only little to none weight to the distribution. - 99 Ulrich Stärk wrote: Why not instantiate a ServletContextSymbolProvider (the ServletContext is available from the ApplicationGlobals service) and contribute it to the SymbolProvider before ApplicationDefaults and FactoryDefaults. That way you can directly override tapestry.page-pool.hard-limit and automatically have all other init parameters as symbols, too. Uli 9902468 schrieb: I always keep nabble open when I'm at work :) These parameters can be transferred to web.xml, so that recompile is not needed when changing these parameters: public static void contributeApplicationDefaults(MappedConfigurationString, String configuration, ApplicationGlobals globals) { configuration.add(tapestry.page-pool.hard-limit, globals.getServletContext().getInitParameter(page_hard_limit)); } and in web.xml web-app display-nameSome Tapestry 5 Application/display-name context-param !-- The only significant configuration for Tapestry 5, this informs Tapestry of where to look for pages, components and mixins. -- param-nametapestry.app-package/param-name param-valuefi.hanken.resbuilder.tapestry5/param-value /context-param context-param param-namepage_hard_limit/param-name param-value60/param-value /context-param This can be used through out every single service and page and component. To access this in a page or component use: @Property @Inject @Value(${page_hard_limit}) private String pageHardLimit; Injection can be used in service constructor also (I think) or by using buildSomeService method instead of the usual binder.bind Of course T5 makes it easy to read these from a file or database or from what not, but I have noticed that many admins accept editing web.xml and restarting the app ok. Hopefully this helps. (And makes it easier to say to admins that just configure the app according to the load they are experiencing.) -99 nille hammer wrote: Man that was a quick answer! Thanks for that. I am aware of this options in the configuration. I had not tuned them before, because load is not my problem. Anyway I have tuned them now and am currently waiting for the admistrator to deploy the newest war. According to acces-logs I was the only user accessing the page. So as far as I understand the mechanism only one instance of index should have been created and not 20. I think it is an issue with configuration in production environment. But I have no idea where to take a closer look (i.e. where to build in log-messages, which of Tomcat's configuration options to check etc.). So suggestions are still more than welcome. Nillehammer 9902468 schrieb: Hi, Eventually we had to add these to appmodule: configuration.add(tapestry.page-pool.hard-limit, 60); configuration.add(tapestry.page-pool.soft-limit, 20); configuration.add(tapestry.page-pool.soft-wait, 20 ms); as instructed here: http://tapestry.apache.org/tapestry5/guide/conf.html This solved our problems, and you can go up as long as your server has memory. Our problems were only in production, as development stress just isn't enough. (This is why one really should do load testing with jmeter or similar tool.) The defaults could be a bit more? Or considerably less, so that the developer would hit these walls during development and understands to load test / tune the parameters. - 99 nille hammer wrote: Hi list, I am also facing the problem that 9902468 had. I have -according to Howard's suggestion- replaced every pageLink with a customPageLink to prevent targeted pages from being created unecessarily. The problem persists. Trying to load the index-Page of my application with a browser I have to wait about two minutes before I get an empty page. In the app's log the following Exception appears: java.lang.RuntimeException: The page pool for page 'Index' (in locale de) has been exausted: there are 20 instances currently being used and no more can be created. Try increasing the hard limit (symbol
Re: Page pool hard limit and page instance usage
Yes it can, but CollectionFactory is internal API (whereas CaseInsensitiveMap is not) and I didn't want to rely on it. Uli 9902468 schrieb: Thanks! Obviously I should read more than code :) btw, case insensitive map can be obtained by calling org.apache.tapestry5.ioc.internal.util.CollectionFactory.newCaseInsensitiveMap(); - 99 Ulrich Stärk wrote: You don't have to write your own ServletContextSymbolProvider, it already comes shipped with Tapestry. See here http://tapestry.apache.org/tapestry5/apidocs/index.html?org/apache/tapestry5/ioc/services/SymbolProvider.html You just have to configure it. Uli 9902468 schrieb: Yep, just read through your discussion: http://www.nabble.com/forum/ViewPost.jtp?post=19547763framed=yskin=302 and that would be the intelligent way of doing it :) I'll code symbol provider when I have time. Hopefully these providers can be included in T5 distribution, as these are highly reusable and add only little to none weight to the distribution. - 99 Ulrich Stärk wrote: Why not instantiate a ServletContextSymbolProvider (the ServletContext is available from the ApplicationGlobals service) and contribute it to the SymbolProvider before ApplicationDefaults and FactoryDefaults. That way you can directly override tapestry.page-pool.hard-limit and automatically have all other init parameters as symbols, too. Uli 9902468 schrieb: I always keep nabble open when I'm at work :) These parameters can be transferred to web.xml, so that recompile is not needed when changing these parameters: public static void contributeApplicationDefaults(MappedConfigurationString, String configuration, ApplicationGlobals globals) { configuration.add(tapestry.page-pool.hard-limit, globals.getServletContext().getInitParameter(page_hard_limit)); } and in web.xml web-app display-nameSome Tapestry 5 Application/display-name context-param !-- The only significant configuration for Tapestry 5, this informs Tapestry of where to look for pages, components and mixins. -- param-nametapestry.app-package/param-name param-valuefi.hanken.resbuilder.tapestry5/param-value /context-param context-param param-namepage_hard_limit/param-name param-value60/param-value /context-param This can be used through out every single service and page and component. To access this in a page or component use: @Property @Inject @Value(${page_hard_limit}) private String pageHardLimit; Injection can be used in service constructor also (I think) or by using buildSomeService method instead of the usual binder.bind Of course T5 makes it easy to read these from a file or database or from what not, but I have noticed that many admins accept editing web.xml and restarting the app ok. Hopefully this helps. (And makes it easier to say to admins that just configure the app according to the load they are experiencing.) -99 nille hammer wrote: Man that was a quick answer! Thanks for that. I am aware of this options in the configuration. I had not tuned them before, because load is not my problem. Anyway I have tuned them now and am currently waiting for the admistrator to deploy the newest war. According to acces-logs I was the only user accessing the page. So as far as I understand the mechanism only one instance of index should have been created and not 20. I think it is an issue with configuration in production environment. But I have no idea where to take a closer look (i.e. where to build in log-messages, which of Tomcat's configuration options to check etc.). So suggestions are still more than welcome. Nillehammer 9902468 schrieb: Hi, Eventually we had to add these to appmodule: configuration.add(tapestry.page-pool.hard-limit, 60); configuration.add(tapestry.page-pool.soft-limit, 20); configuration.add(tapestry.page-pool.soft-wait, 20 ms); as instructed here: http://tapestry.apache.org/tapestry5/guide/conf.html This solved our problems, and you can go up as long as your server has memory. Our problems were only in production, as development stress just isn't enough. (This is why one really should do load testing with jmeter or similar tool.) The defaults could be a bit more? Or considerably less, so that the developer would hit these walls during development and understands to load test / tune the parameters. - 99 nille hammer wrote: Hi list, I am also facing the problem that 9902468 had. I have -according to Howard's suggestion- replaced every pageLink with a customPageLink to prevent targeted pages from being created unecessarily. The problem persists. Trying to load the index-Page of my application with a browser I have to wait about two minutes before I get an empty page. In the app's log the following Exception appears: java.lang.RuntimeException: The page pool for page 'Index' (in locale de) has been exausted: there are 20 instances currently being used and no more can be created. Try increasing the
Re: Page pool hard limit and page instance usage
Good point. Now I'm going to read some documentation ;) -99 Ulrich Stärk wrote: Yes it can, but CollectionFactory is internal API (whereas CaseInsensitiveMap is not) and I didn't want to rely on it. Uli 9902468 schrieb: Thanks! Obviously I should read more than code :) btw, case insensitive map can be obtained by calling org.apache.tapestry5.ioc.internal.util.CollectionFactory.newCaseInsensitiveMap(); - 99 Ulrich Stärk wrote: You don't have to write your own ServletContextSymbolProvider, it already comes shipped with Tapestry. See here http://tapestry.apache.org/tapestry5/apidocs/index.html?org/apache/tapestry5/ioc/services/SymbolProvider.html You just have to configure it. Uli 9902468 schrieb: Yep, just read through your discussion: http://www.nabble.com/forum/ViewPost.jtp?post=19547763framed=yskin=302 and that would be the intelligent way of doing it :) I'll code symbol provider when I have time. Hopefully these providers can be included in T5 distribution, as these are highly reusable and add only little to none weight to the distribution. - 99 Ulrich Stärk wrote: Why not instantiate a ServletContextSymbolProvider (the ServletContext is available from the ApplicationGlobals service) and contribute it to the SymbolProvider before ApplicationDefaults and FactoryDefaults. That way you can directly override tapestry.page-pool.hard-limit and automatically have all other init parameters as symbols, too. Uli 9902468 schrieb: I always keep nabble open when I'm at work :) These parameters can be transferred to web.xml, so that recompile is not needed when changing these parameters: public static void contributeApplicationDefaults(MappedConfigurationString, String configuration, ApplicationGlobals globals) { configuration.add(tapestry.page-pool.hard-limit, globals.getServletContext().getInitParameter(page_hard_limit)); } and in web.xml web-app display-nameSome Tapestry 5 Application/display-name context-param !-- The only significant configuration for Tapestry 5, this informs Tapestry of where to look for pages, components and mixins. -- param-nametapestry.app-package/param-name param-valuefi.hanken.resbuilder.tapestry5/param-value /context-param context-param param-namepage_hard_limit/param-name param-value60/param-value /context-param This can be used through out every single service and page and component. To access this in a page or component use: @Property @Inject @Value(${page_hard_limit}) private String pageHardLimit; Injection can be used in service constructor also (I think) or by using buildSomeService method instead of the usual binder.bind Of course T5 makes it easy to read these from a file or database or from what not, but I have noticed that many admins accept editing web.xml and restarting the app ok. Hopefully this helps. (And makes it easier to say to admins that just configure the app according to the load they are experiencing.) -99 nille hammer wrote: Man that was a quick answer! Thanks for that. I am aware of this options in the configuration. I had not tuned them before, because load is not my problem. Anyway I have tuned them now and am currently waiting for the admistrator to deploy the newest war. According to acces-logs I was the only user accessing the page. So as far as I understand the mechanism only one instance of index should have been created and not 20. I think it is an issue with configuration in production environment. But I have no idea where to take a closer look (i.e. where to build in log-messages, which of Tomcat's configuration options to check etc.). So suggestions are still more than welcome. Nillehammer 9902468 schrieb: Hi, Eventually we had to add these to appmodule: configuration.add(tapestry.page-pool.hard-limit, 60); configuration.add(tapestry.page-pool.soft-limit, 20); configuration.add(tapestry.page-pool.soft-wait, 20 ms); as instructed here: http://tapestry.apache.org/tapestry5/guide/conf.html This solved our problems, and you can go up as long as your server has memory. Our problems were only in production, as development stress just isn't enough. (This is why one really should do load testing with jmeter or similar tool.) The defaults could be a bit more? Or considerably less, so that the developer would hit these walls during development and understands to load test / tune the parameters. - 99 nille hammer wrote: Hi list, I am also facing the problem that 9902468 had. I have -according to Howard's suggestion- replaced every pageLink with a customPageLink to prevent targeted pages from being created unecessarily. The problem persists. Trying to load the index-Page of my application with a browser I have to wait about two minutes before I get an empty page. In the app's
Handling of the browser locale
Hello all, I know this looks like a faq, but to be sure, is T5 supposed to set the current locale (the one we get by calling persistentLocale.get()) on each request, and does it work ? My problem is that I get null when I call persistentLocale.get(), with a locale set when I call request.getLocale(), and corresponding to a declared locale in tapestry.supported-locale. Am I missing something ? Any info would be much appreciated, José - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handling of the browser locale
I'm not 100% firm in this area but I believe that the user's locale gets stored in the ThreadLocale service. This service is responsible for storing the current thread's locale, i.e. the locale for which pages, messages etc. are being generated. The locale in ThreadLocale gets set by a combination of various other services. One of them is the PersistentLocale service. If you call persistentLocale.set(locale) a cookie is sent to the browser storing the desired locale. If you call persistentLocale.get() that value is read and returned. If no cookie has been set, this will be null. You can check that with persistentLocale.isSet(). persistentLocale.set() also overwrites the locale in the ThreadLocale service. If the desired locale is not in supported-locales, Tapestry chooses the nearest matching locale. Thus, querying the ThreadLocale service will give you the locale that Tapestry has chosen to generate pages, messages etc. in, taking into account PersistentLocale's value as well as the Request's locale. So there are 3 ways to get the locale: - request.getLocale() will give you the locale, that the browser sent - persistentLocale.get() will give you the locale stored in a cookie in the user's browser or null, if no cookie is set - threadLocale.getLocale() will give you the locale choosen by Tapestry, taking into account the Request's locale, PersistentLocale's locale (will be chosen over the Request's locale) and supported-locales. HTH. Cheers, Uli José Paumard schrieb: Hello all, I know this looks like a faq, but to be sure, is T5 supposed to set the current locale (the one we get by calling persistentLocale.get()) on each request, and does it work ? My problem is that I get null when I call persistentLocale.get(), with a locale set when I call request.getLocale(), and corresponding to a declared locale in tapestry.supported-locale. Am I missing something ? Any info would be much appreciated, José - 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]
Re: Handling of the browser locale
Ulrich, Many thanks for your very precise answer ! Indeed threadLocale.getLocale() is the way to go. José Ulrich Stärk a écrit : I'm not 100% firm in this area but I believe that the user's locale gets stored in the ThreadLocale service. This service is responsible for storing the current thread's locale, i.e. the locale for which pages, messages etc. are being generated. The locale in ThreadLocale gets set by a combination of various other services. One of them is the PersistentLocale service. If you call persistentLocale.set(locale) a cookie is sent to the browser storing the desired locale. If you call persistentLocale.get() that value is read and returned. If no cookie has been set, this will be null. You can check that with persistentLocale.isSet(). persistentLocale.set() also overwrites the locale in the ThreadLocale service. If the desired locale is not in supported-locales, Tapestry chooses the nearest matching locale. Thus, querying the ThreadLocale service will give you the locale that Tapestry has chosen to generate pages, messages etc. in, taking into account PersistentLocale's value as well as the Request's locale. So there are 3 ways to get the locale: - request.getLocale() will give you the locale, that the browser sent - persistentLocale.get() will give you the locale stored in a cookie in the user's browser or null, if no cookie is set - threadLocale.getLocale() will give you the locale choosen by Tapestry, taking into account the Request's locale, PersistentLocale's locale (will be chosen over the Request's locale) and supported-locales. HTH. Cheers, Uli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handling of the browser locale
Not sure if I'm answering your question, but there's also @Inject private Locale _currentLocale; For an example of it in action try http://localhost:8080/jumpstart/examples/localization/bymessagecatalog . Geoff On 20/09/2008, at 12:19 AM, José Paumard wrote: Ulrich, Many thanks for your very precise answer ! Indeed threadLocale.getLocale() is the way to go. José Ulrich Stärk a écrit : I'm not 100% firm in this area but I believe that the user's locale gets stored in the ThreadLocale service. This service is responsible for storing the current thread's locale, i.e. the locale for which pages, messages etc. are being generated. The locale in ThreadLocale gets set by a combination of various other services. One of them is the PersistentLocale service. If you call persistentLocale.set(locale) a cookie is sent to the browser storing the desired locale. If you call persistentLocale.get() that value is read and returned. If no cookie has been set, this will be null. You can check that with persistentLocale.isSet(). persistentLocale.set() also overwrites the locale in the ThreadLocale service. If the desired locale is not in supported- locales, Tapestry chooses the nearest matching locale. Thus, querying the ThreadLocale service will give you the locale that Tapestry has chosen to generate pages, messages etc. in, taking into account PersistentLocale's value as well as the Request's locale. So there are 3 ways to get the locale: - request.getLocale() will give you the locale, that the browser sent - persistentLocale.get() will give you the locale stored in a cookie in the user's browser or null, if no cookie is set - threadLocale.getLocale() will give you the locale choosen by Tapestry, taking into account the Request's locale, PersistentLocale's locale (will be chosen over the Request's locale) and supported-locales. HTH. Cheers, Uli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
T5Components Inside AjaxResult - delay in loading javascript files
Hi All, When I use any of the T5Components inside the Ajax Result there is a remarkable delay in loading and checking previously loaded .js files. The T5Component, InPlaceCheckbox, is inside someBlock which is the result of an Ajax Call. Find the java and tml code below. Is there any one who can help me to avoid the delay? Thank you, Anteneh -- Java code -Start -- private boolean checked; @Inject private Block someBlock; @Component(parameters = { value=checked, onCompleteCallback=onCompleteFunction }) private InPlaceCheckbox myInPlaceCheckbox; public boolean isChecked() { return checked; } public void setChecked(boolean checked) { this.checked = checked; } @OnEvent(component = myInPlaceCheckbox, value = InPlaceCheckbox.EVENT_NAME) public boolean inPlaceCheckbox(boolean checked) { return checked; } Block onActionFromTheLink() { return someBlock; } public InPlaceCheckbox getMyInPlaceCheckbox() { return myInPlaceCheckbox; } -- Java code -End-- -- tml code -Start -- script type=text/javascript function onCompleteFunction(response) { if (response.evalJSON().value == true) { $('checkboxResult').update(strongchecked/strong); } else { $('checkboxResult').update(strongun-checked/strong); } } /script To display the Inplace checkbox Click here t:zone t:id=updateZone Initial content /t:zone t:block t:id=someBlock Checkbox: input type=checkbox t:id=myInPlaceCheckbox t:type=t5components/InPlaceCheckbox/ hr / br / Checkbox state : state will display here /t:block -- tml code -End-- -- View this message in context: http://www.nabble.com/T5Components-Inside-AjaxResult---delay-in-loading-javascript-files-tp19575134p19575134.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tapestry 5 doesn't like debugger ?
Hi all, I am currently developing with Tapestry 5.0.14, Java 5 and eclipse WTP. I noticed that Tapestry does not like debugger... Putting a break point within a page class often crashes my JVM with insulting error messages :) I am just curious about why this is happening. Why is it working with other frameworks and not Tapestry ? Ideally is there a workaround for that ? Thanks in advance Hugues
Re: Handling of the browser locale
Do you know, what locale gets injected here (ThreadLocale's, Request's or PersistentLocale's)? The docs just say The locale of the component so I'd guess ThreadLocale's, but I'm not sure... Uli Geoff Callender schrieb: Not sure if I'm answering your question, but there's also @Inject private Locale _currentLocale; For an example of it in action try http://localhost:8080/jumpstart/examples/localization/bymessagecatalog . Geoff On 20/09/2008, at 12:19 AM, José Paumard wrote: Ulrich, Many thanks for your very precise answer ! Indeed threadLocale.getLocale() is the way to go. José Ulrich Stärk a écrit : I'm not 100% firm in this area but I believe that the user's locale gets stored in the ThreadLocale service. This service is responsible for storing the current thread's locale, i.e. the locale for which pages, messages etc. are being generated. The locale in ThreadLocale gets set by a combination of various other services. One of them is the PersistentLocale service. If you call persistentLocale.set(locale) a cookie is sent to the browser storing the desired locale. If you call persistentLocale.get() that value is read and returned. If no cookie has been set, this will be null. You can check that with persistentLocale.isSet(). persistentLocale.set() also overwrites the locale in the ThreadLocale service. If the desired locale is not in supported-locales, Tapestry chooses the nearest matching locale. Thus, querying the ThreadLocale service will give you the locale that Tapestry has chosen to generate pages, messages etc. in, taking into account PersistentLocale's value as well as the Request's locale. So there are 3 ways to get the locale: - request.getLocale() will give you the locale, that the browser sent - persistentLocale.get() will give you the locale stored in a cookie in the user's browser or null, if no cookie is set - threadLocale.getLocale() will give you the locale choosen by Tapestry, taking into account the Request's locale, PersistentLocale's locale (will be chosen over the Request's locale) and supported-locales. HTH. Cheers, Uli - 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]
external link component
I want to create an external link ... and using the low level html anchor tag *a href=http://...;X/a* works just fine. Before doing that though, is there a tapestry component I should use instead? I'm not sure what the convention is here. It seems that pageLink is strictly for internal or application specific links and I'm not sure actionLlink would be appropriate either. I didn't come across any other component that looked appropriate in this case so just looking for a suggestion or push in the correct direction. Thanks in advance, -Luther
Re: external link component
Indeed ActionLink and PageLink are for use within your application only. The rest depends on your use case. If you want to link to another web page with a static URL I'd just put that in static html. If you want to compute the URL using some field values or such, try the Any component. For example a t:type=any t:id=someId href=http://foo.bar.org/${someField};foo/a. Cheers, Uli Luther Baker schrieb: I want to create an external link ... and using the low level html anchor tag *a href=http://...;X/a* works just fine. Before doing that though, is there a tapestry component I should use instead? I'm not sure what the convention is here. It seems that pageLink is strictly for internal or application specific links and I'm not sure actionLlink would be appropriate either. I didn't come across any other component that looked appropriate in this case so just looking for a suggestion or push in the correct direction. Thanks in advance, -Luther - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Handling of the browser locale
Oops, I meant http://202.177.217.122:8080/jumpstart/examples/localization/bymessagecatalog . On 20/09/2008, at 1:14 AM, Geoff Callender wrote: Not sure if I'm answering your question, but there's also @Inject private Locale _currentLocale; For an example of it in action try http://localhost:8080/jumpstart/examples/localization/bymessagecatalog . Geoff On 20/09/2008, at 12:19 AM, José Paumard wrote: Ulrich, Many thanks for your very precise answer ! Indeed threadLocale.getLocale() is the way to go. José Ulrich Stärk a écrit : I'm not 100% firm in this area but I believe that the user's locale gets stored in the ThreadLocale service. This service is responsible for storing the current thread's locale, i.e. the locale for which pages, messages etc. are being generated. The locale in ThreadLocale gets set by a combination of various other services. One of them is the PersistentLocale service. If you call persistentLocale.set(locale) a cookie is sent to the browser storing the desired locale. If you call persistentLocale.get() that value is read and returned. If no cookie has been set, this will be null. You can check that with persistentLocale.isSet(). persistentLocale.set() also overwrites the locale in the ThreadLocale service. If the desired locale is not in supported- locales, Tapestry chooses the nearest matching locale. Thus, querying the ThreadLocale service will give you the locale that Tapestry has chosen to generate pages, messages etc. in, taking into account PersistentLocale's value as well as the Request's locale. So there are 3 ways to get the locale: - request.getLocale() will give you the locale, that the browser sent - persistentLocale.get() will give you the locale stored in a cookie in the user's browser or null, if no cookie is set - threadLocale.getLocale() will give you the locale choosen by Tapestry, taking into account the Request's locale, PersistentLocale's locale (will be chosen over the Request's locale) and supported-locales. HTH. Cheers, Uli - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tapestry 5 doesn't like debugger ?
I think this is not really related with Tapestry... Here we can run the debugger and tapestry apps with no problems. I saw (two or three times) some problems with HotSpot Virtual Machine when i run the debugger, and they are really offensive giving no clues and killing the proccess, but they go away as misteriously as they came. Try to upgrade your JVM to the latest one, maybe this helps. On Fri, Sep 19, 2008 at 2:09 PM, Hugues Narjoux [EMAIL PROTECTED]wrote: Hi all, I am currently developing with Tapestry 5.0.14, Java 5 and eclipse WTP. I noticed that Tapestry does not like debugger... Putting a break point within a page class often crashes my JVM with insulting error messages :) I am just curious about why this is happening. Why is it working with other frameworks and not Tapestry ? Ideally is there a workaround for that ? Thanks in advance Hugues -- Atenciosamente, Marcelo Lotif Programador Java e Tapestry FIEC - Federação das Indústrias do Estado do Ceará (85) 3477-5910
IoC Question with Alias
Hi, I have a problem with the contributions to the alias service. The AppModule is ... public static void bind( ServiceBinder binder ) { binder.bind( SiteDispatcher.class ).withId( SiteDispatcher ); binder.bind( SiteServiceImpl.class ).withId( SiteService ); binder.bind( HttpdRequestSecurityManager.class ).withId( HttpdRequestSecurityManager ); binder.bind( SiteBaseURLSource.class ).withId( SiteBaseURLSource ); } @SuppressWarnings( unchecked ) public void contributeAlias( ConfigurationAliasContribution configuration, @InjectService( HttpdRequestSecurityManager ) RequestSecurityManager manager, @InjectService( SiteBaseURLSource ) BaseURLSource baseUrlSource ) { configuration.add( AliasContribution.create( BaseURLSource.class, baseUrlSource ) ); configuration.add( AliasContribution.create( RequestSecurityManager.class, manager ) ); } The constructors of the services are ... public SiteServiceImpl( RequestGlobals globals, ApplicationGlobals application, Session session, Logger logger, CollectionString contributions, SymbolSource symbols ) { ... } public HttpdRequestSecurityManager( Request request, Response response, MetaDataLocator locator, RequestPageCache requestPageCache, @InjectService(SiteBaseURLSource) BaseURLSource baseURLSource, SiteService site ) { ... } public SiteBaseURLSource( SiteService site ) { ... } I get the [ERROR] Alias Construction of service Alias failed: Error invoking service builder method org.apache.tapestry5.services.TapestryModule.build(Logger, String, AliasManager, Collection) (at TapestryModule.java:205) (for service 'Alias'): Error invoking service contribution method com.flexibelinstitut.tapestry5.site.SiteModule.contributeAlias(Configuration, RequestSecurityManager, BaseURLSource): Error building service proxy for service 'HttpdRequestSecurityManager' (at com.flexibelinstitut.tapestry5.site.services.internal.HttpdRequestSecurityManager(Request, Response, MetaDataLocator, RequestPageCache, BaseURLSource, SiteService) (at HttpdRequestSecurityManager.java:26)): Error invoking constructor com.flexibelinstitut.tapestry5.site.services.internal.HttpdRequestSecurityManager(Request, Response, MetaDataLocator, RequestPageCache, BaseURLSource, SiteService) (at HttpdRequestSecurityManager.java:26) (for service 'HttpdRequestSecurityManager'): Exception constructing service 'Alias': Construction of service 'Alias' has failed due to recursion: the service depends on itself in some way. Please check org.apache.tapestry5.services.TapestryModule.build(Logger, String, AliasManager, Collection) (at TapestryModule.java:205) for references to another service that is itself dependent on service 'Alias'. And I don't even have a clue where to look. I tried a lot of different version with @Inject, with @InjectService(..) on the constructors the contributeAlias(..) method. But none of them seems to work. Any ideas? /M - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Ideas on transitioning from earlier version to Tapestry 5
SergeEby wrote: Hi, I started documenting this for the migration from T4 to T5. Please refer to the following project: http://code.google.com/p/tapestry5-appfuse/ The code is updated. However, I haven't had a chance to update the steps recently, but this is on my todo list. /Serge Thanks, I'll take a look. I was surprised that there was no response to this post to now. I would have thought this would be a very common problem for the Tapestry community. Have a way to transition from T3/4 to T5 in a progressive manner must be something many others would be interested in too. Thanks, Matt - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]