Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
Actually, it didn't work. Still getting the Alias recursion error when injecting ServletContextProvider spring bean into my SymbolProvider. Isn't that a bit strange?? Also, server startup success including my SymbolProvider seems pretty random. When I remove references to ServletContext through my Spring bean and use MyClass.class.getResourceAsStream, it seems to work. But I can't be sure, it seems to crash randomly so far... On Fri, Aug 28, 2009 at 2:00 PM, Inge Solvoll inge.tapes...@gmail.comwrote: That actually did the trick. Just create the simple spring bean listed below, and inject it instead of ApplicationGlobals into your SymbolSource. import javax.servlet.ServletContext; import org.springframework.web.context.ServletContextAware; public class ServletContextProvider implements ServletContextAware { private ServletContext servletContext; public ServletContext getServletContext() { return servletContext; } public void setServletContext(ServletContext servletContext) { this.servletContext = servletContext; } } On Fri, Aug 28, 2009 at 1:45 PM, Inge Solvoll inge.tapes...@gmail.comwrote: This last post didn't help in my attempt at trying to use ApplicationGlobals.getServletContext() in my SymbolSource implementation. But could this help? I will try it out http://forum.springsource.org/showthread.php?t=39927 On Tue, Oct 7, 2008 at 4:54 PM, Francois Armand farm...@linagora.comwrote: Ville Virtanen wrote: I have no new info on this, and I think we should add ticket to get this sorted. (If it is something we do wrong - correct the documentation or then it is a bug that needs a fix anyway.) I search forward and find a solution that works for me, I hope it may help you too : http://markmail.org/search/?q=list%3Aorg.apache.tapestry.users+problem+injecting#query:list%3Aorg.apache.tapestry.usersproblem injecting+page:1+mid:lnvawscuxr44aasv+state:results So, basically, the problem is that the Tapestry Request and Response object are saved in RequestGlobal object only in the Terminator of the RequestHandler pipeline. But the ApplicationStateManager, and perhaps other services, tries to access to the (T5) Request thanks to RequestGlobal#getRequest(), which is null : we did not reach the terminator yet. So, I just created a RequestHandler that does the same thing that the terminator (requestGlobals.storeRequestResponse(request, response)) and contribute it before all other RequestHandler. I believe that we may have the same problem with HttpRequestHandler, as the RequestGlobal#storeServletRequestResponse is called in theterminator of HttpRequestHandler pipeline. Hope it will help you. The code (copypaste from the other email (save you a click) : public static RequestFilter buildSetRequestResponse(final RequestGlobals requestGlobals) { return new RequestFilter(){ public boolean service(Request request, Response response, RequestHandler handler) throws IOException { requestGlobals.storeRequestResponse(request, response); return handler.service(request, response); } }; } public static void contributeRequestHandler(OrderedConfigurationRequestFilter configuration, @InjectService(setRequestResponse) RequestFilter setRequestResponse, (other handlers)) { configuration.add(setRequestResponse, setRequestResponse, before:*); ... } -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
This last post didn't help in my attempt at trying to use ApplicationGlobals.getServletContext() in my SymbolSource implementation. But could this help? I will try it out http://forum.springsource.org/showthread.php?t=39927 On Tue, Oct 7, 2008 at 4:54 PM, Francois Armand farm...@linagora.comwrote: Ville Virtanen wrote: I have no new info on this, and I think we should add ticket to get this sorted. (If it is something we do wrong - correct the documentation or then it is a bug that needs a fix anyway.) I search forward and find a solution that works for me, I hope it may help you too : http://markmail.org/search/?q=list%3Aorg.apache.tapestry.users+problem+injecting#query:list%3Aorg.apache.tapestry.usersproblem injecting+page:1+mid:lnvawscuxr44aasv+state:results So, basically, the problem is that the Tapestry Request and Response object are saved in RequestGlobal object only in the Terminator of the RequestHandler pipeline. But the ApplicationStateManager, and perhaps other services, tries to access to the (T5) Request thanks to RequestGlobal#getRequest(), which is null : we did not reach the terminator yet. So, I just created a RequestHandler that does the same thing that the terminator (requestGlobals.storeRequestResponse(request, response)) and contribute it before all other RequestHandler. I believe that we may have the same problem with HttpRequestHandler, as the RequestGlobal#storeServletRequestResponse is called in theterminator of HttpRequestHandler pipeline. Hope it will help you. The code (copypaste from the other email (save you a click) : public static RequestFilter buildSetRequestResponse(final RequestGlobals requestGlobals) { return new RequestFilter(){ public boolean service(Request request, Response response, RequestHandler handler) throws IOException { requestGlobals.storeRequestResponse(request, response); return handler.service(request, response); } }; } public static void contributeRequestHandler(OrderedConfigurationRequestFilter configuration, @InjectService(setRequestResponse) RequestFilter setRequestResponse, (other handlers)) { configuration.add(setRequestResponse, setRequestResponse, before:*); ... } -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
That actually did the trick. Just create the simple spring bean listed below, and inject it instead of ApplicationGlobals into your SymbolSource. import javax.servlet.ServletContext; import org.springframework.web.context.ServletContextAware; public class ServletContextProvider implements ServletContextAware { private ServletContext servletContext; public ServletContext getServletContext() { return servletContext; } public void setServletContext(ServletContext servletContext) { this.servletContext = servletContext; } } On Fri, Aug 28, 2009 at 1:45 PM, Inge Solvoll inge.tapes...@gmail.comwrote: This last post didn't help in my attempt at trying to use ApplicationGlobals.getServletContext() in my SymbolSource implementation. But could this help? I will try it out http://forum.springsource.org/showthread.php?t=39927 On Tue, Oct 7, 2008 at 4:54 PM, Francois Armand farm...@linagora.comwrote: Ville Virtanen wrote: I have no new info on this, and I think we should add ticket to get this sorted. (If it is something we do wrong - correct the documentation or then it is a bug that needs a fix anyway.) I search forward and find a solution that works for me, I hope it may help you too : http://markmail.org/search/?q=list%3Aorg.apache.tapestry.users+problem+injecting#query:list%3Aorg.apache.tapestry.usersproblem injecting+page:1+mid:lnvawscuxr44aasv+state:results So, basically, the problem is that the Tapestry Request and Response object are saved in RequestGlobal object only in the Terminator of the RequestHandler pipeline. But the ApplicationStateManager, and perhaps other services, tries to access to the (T5) Request thanks to RequestGlobal#getRequest(), which is null : we did not reach the terminator yet. So, I just created a RequestHandler that does the same thing that the terminator (requestGlobals.storeRequestResponse(request, response)) and contribute it before all other RequestHandler. I believe that we may have the same problem with HttpRequestHandler, as the RequestGlobal#storeServletRequestResponse is called in theterminator of HttpRequestHandler pipeline. Hope it will help you. The code (copypaste from the other email (save you a click) : public static RequestFilter buildSetRequestResponse(final RequestGlobals requestGlobals) { return new RequestFilter(){ public boolean service(Request request, Response response, RequestHandler handler) throws IOException { requestGlobals.storeRequestResponse(request, response); return handler.service(request, response); } }; } public static void contributeRequestHandler(OrderedConfigurationRequestFilter configuration, @InjectService(setRequestResponse) RequestFilter setRequestResponse, (other handlers)) { configuration.add(setRequestResponse, setRequestResponse, before:*); ... } -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org
Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
Ville Virtanen wrote: I have no new info on this, and I think we should add ticket to get this sorted. (If it is something we do wrong - correct the documentation or then it is a bug that needs a fix anyway.) I search forward and find a solution that works for me, I hope it may help you too : http://markmail.org/search/?q=list%3Aorg.apache.tapestry.users+problem+injecting#query:list%3Aorg.apache.tapestry.users problem injecting+page:1+mid:lnvawscuxr44aasv+state:results So, basically, the problem is that the Tapestry Request and Response object are saved in RequestGlobal object only in the Terminator of the RequestHandler pipeline. But the ApplicationStateManager, and perhaps other services, tries to access to the (T5) Request thanks to RequestGlobal#getRequest(), which is null : we did not reach the terminator yet. So, I just created a RequestHandler that does the same thing that the terminator (requestGlobals.storeRequestResponse(request, response)) and contribute it before all other RequestHandler. I believe that we may have the same problem with HttpRequestHandler, as the RequestGlobal#storeServletRequestResponse is called in theterminator of HttpRequestHandler pipeline. Hope it will help you. The code (copypaste from the other email (save you a click) : public static RequestFilter buildSetRequestResponse(final RequestGlobals requestGlobals) { return new RequestFilter(){ public boolean service(Request request, Response response, RequestHandler handler) throws IOException { requestGlobals.storeRequestResponse(request, response); return handler.service(request, response); } }; } public static void contributeRequestHandler(OrderedConfigurationRequestFilter configuration, @InjectService(setRequestResponse) RequestFilter setRequestResponse, (other handlers)) { configuration.add(setRequestResponse, setRequestResponse, before:*); ... } -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
9902468 wrote: This is starting to look more and more like Jira issue? Any new info on this? Hello guys, I encounter almost the same error when I try to access ApplicationState service from a RequestFilter. Do you have any new on that topic ? Did you open a ticket on the subject ? Thanks, -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
I have no new info on this, and I think we should add ticket to get this sorted. (If it is something we do wrong - correct the documentation or then it is a bug that needs a fix anyway.) Currently I'm just fetching the values from context by hand. The reason behind this however is likely to be the order in which the services are started: it doesn't require much effort to create situation where for an example symbol provider is needed to contribute an alias, but the alias service is needed to create the symbol provider... The end result would be exactly the message we've been receiving, and unfortunately there is no easy way around this afaik. Also it seems that this error comes deep from Tapestry because the services are so fundamental to Tapestry, although the recursive cycle is due to my own services. I'm just happy that I have problems only reading context variables that are very limited in number ;) Don't know if this is the case here though. Francois Armand wrote: 9902468 wrote: This is starting to look more and more like Jira issue? Any new info on this? Hello guys, I encounter almost the same error when I try to access ApplicationState service from a RequestFilter. Do you have any new on that topic ? Did you open a ticket on the subject ? Thanks, -- Francois Armand Etudes Développements J2EE Groupe Linagora - http://www.linagora.com Tél.: +33 (0)1 58 18 68 28 --- InterLDAP - http://interldap.org FederID - http://www.federid.org/ Open Source identities management and federation - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Re%3A-NPE-when-trying-to-contribute-ServletContextSymbolProvider-to---SymbolSource-%28WAS%3A-Re%3A-Page-pool-hard-limit-and-page-instance-usage%29-tp19609348p19835994.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: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
This is starting to look more and more like Jira issue? Any new info on this? -99 Ulrich Stärk wrote: I even removed the RequestFilter, AppligationGlobals.getServletContext() still returns null. Uli Am Di, 23.09.2008, 14:42, schrieb Peter Stavrinides: This seems to be the same bug that existed a while bug, change your RequestFilter to a Dispatcher and see if it works. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 23 September, 2008 2:15:18 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) Yes, I am. Uli Am Di, 23.09.2008, 13:00, schrieb Peter Stavrinides: Ulrich are you using a RequestFilter? - Original Message - From: Peter Stavrinides [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 23 September, 2008 1:45:49 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) I have looked at this a little more and it seems it is indeed a bug, I get a similar problem with code that works in the previous release. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 23 September, 2008 11:22:30 AM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) I'm not sure if we are doing everything right. I hoped to hear something from Howard or someone else who knows the matter before opening an issue on this. Cheers, Uli Am Di, 23.09.2008, 07:47, schrieb 9902468: Should I add Jira about this? After all, it is pretty pointless to have this symbol provider if it can't work. (Perhaps there is some way to overcome this problem?) - 99 Ulrich StÃÆärk wrote: A Filter is passed a FilterConfig object where you can call getServletContext() and get the ServletContext. So the availability shouldn't be a problem. I rather believe that it doesn't get set in ApplicationGlobals until a certain point which is after building the SymbolSource... Uli Am Mo, 22.09.2008, 16:01, schrieb Peter Stavrinides: Just a wild guess, but it sounds like an 'order of things' type problem, Tapestry being a filter and not essentially a servlet, the context might not be available at that point. - Original Message - From: Ulrich StÃÆÃâÃâärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Monday, 22 September, 2008 4:51:23 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) The problem seems to be, that the ServletContext provided by ApplicationGlobals is null when Tapestry tries to contribute the ServletContextSymbolProvider to the SymbolSource service. I don't know why this is the case. Maybe someone else can shed some light on this. Uli Am Mo, 22.09.2008, 08:08, schrieb 9902468: Hi again, I'm hitting my head to wall here with ServletContextSymbolProvider. It is configured like this: public static void contributeSymbolSource(OrderedConfigurationSymbolProvider configuration, @InjectService(ServletContextSymbolProvider) SymbolProvider servletContextSymbolProvider) { configuration.add(ServletContextSymbolProvider , servletContextSymbolProvider, after:SystemProperties, before:ApplicationDefaults); } public static ServletContextSymbolProvider buildServletContextSymbolProvider(ApplicationGlobals globals){ return new ServletContextSymbolProvider(globals.getServletContext()); } And it always ends to this error: java.lang.RuntimeException: Unable to instantiate class org.apache.tapestry5.services.TapestryModule as a module builder: Exception constructing service 'Alias': Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String, AliasManager, Collection) (at TapestryModule.java:217) (for service 'Alias'): Exception constructing service 'SymbolSource': Error invoking constructor o - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Re%3A-NPE-when-trying-to-contribute-ServletContextSymbolProvider-to---SymbolSource-%28WAS%3A-Re%3A-Page-pool-hard-limit-and-page-instance-usage%29-tp19609348p19621689.html Sent from the Tapestry - User mailing list archive at Nabble.com.
Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
I'm not sure if we are doing everything right. I hoped to hear something from Howard or someone else who knows the matter before opening an issue on this. Cheers, Uli Am Di, 23.09.2008, 07:47, schrieb 9902468: Should I add Jira about this? After all, it is pretty pointless to have this symbol provider if it can't work. (Perhaps there is some way to overcome this problem?) - 99 Ulrich Stärk wrote: A Filter is passed a FilterConfig object where you can call getServletContext() and get the ServletContext. So the availability shouldn't be a problem. I rather believe that it doesn't get set in ApplicationGlobals until a certain point which is after building the SymbolSource... Uli Am Mo, 22.09.2008, 16:01, schrieb Peter Stavrinides: Just a wild guess, but it sounds like an 'order of things' type problem, Tapestry being a filter and not essentially a servlet, the context might not be available at that point. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Monday, 22 September, 2008 4:51:23 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) The problem seems to be, that the ServletContext provided by ApplicationGlobals is null when Tapestry tries to contribute the ServletContextSymbolProvider to the SymbolSource service. I don't know why this is the case. Maybe someone else can shed some light on this. Uli Am Mo, 22.09.2008, 08:08, schrieb 9902468: Hi again, I'm hitting my head to wall here with ServletContextSymbolProvider. It is configured like this: public static void contributeSymbolSource(OrderedConfigurationSymbolProvider configuration, @InjectService(ServletContextSymbolProvider) SymbolProvider servletContextSymbolProvider) { configuration.add(ServletContextSymbolProvider , servletContextSymbolProvider, after:SystemProperties, before:ApplicationDefaults); } public static ServletContextSymbolProvider buildServletContextSymbolProvider(ApplicationGlobals globals){ return new ServletContextSymbolProvider(globals.getServletContext()); } And it always ends to this error: java.lang.RuntimeException: Unable to instantiate class org.apache.tapestry5.services.TapestryModule as a module builder: Exception constructing service 'Alias': Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String, AliasManager, Collection) (at TapestryModule.java:217) (for service 'Alias'): Exception constructing service 'SymbolSource': Error invoking constructor o - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Re%3A-NPE-when-trying-to-contribute-ServletContextSymbolProvider-to---SymbolSource-%28WAS%3A-Re%3A-Page-pool-hard-limit-and-page-instance-usage%29-tp19609348p19621689.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: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
I have looked at this a little more and it seems it is indeed a bug, I get a similar problem with code that works in the previous release. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 23 September, 2008 11:22:30 AM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) I'm not sure if we are doing everything right. I hoped to hear something from Howard or someone else who knows the matter before opening an issue on this. Cheers, Uli Am Di, 23.09.2008, 07:47, schrieb 9902468: Should I add Jira about this? After all, it is pretty pointless to have this symbol provider if it can't work. (Perhaps there is some way to overcome this problem?) - 99 Ulrich Stärk wrote: A Filter is passed a FilterConfig object where you can call getServletContext() and get the ServletContext. So the availability shouldn't be a problem. I rather believe that it doesn't get set in ApplicationGlobals until a certain point which is after building the SymbolSource... Uli Am Mo, 22.09.2008, 16:01, schrieb Peter Stavrinides: Just a wild guess, but it sounds like an 'order of things' type problem, Tapestry being a filter and not essentially a servlet, the context might not be available at that point. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Monday, 22 September, 2008 4:51:23 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) The problem seems to be, that the ServletContext provided by ApplicationGlobals is null when Tapestry tries to contribute the ServletContextSymbolProvider to the SymbolSource service. I don't know why this is the case. Maybe someone else can shed some light on this. Uli Am Mo, 22.09.2008, 08:08, schrieb 9902468: Hi again, I'm hitting my head to wall here with ServletContextSymbolProvider. It is configured like this: public static void contributeSymbolSource(OrderedConfigurationSymbolProvider configuration, @InjectService(ServletContextSymbolProvider) SymbolProvider servletContextSymbolProvider) { configuration.add(ServletContextSymbolProvider , servletContextSymbolProvider, after:SystemProperties, before:ApplicationDefaults); } public static ServletContextSymbolProvider buildServletContextSymbolProvider(ApplicationGlobals globals){ return new ServletContextSymbolProvider(globals.getServletContext()); } And it always ends to this error: java.lang.RuntimeException: Unable to instantiate class org.apache.tapestry5.services.TapestryModule as a module builder: Exception constructing service 'Alias': Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String, AliasManager, Collection) (at TapestryModule.java:217) (for service 'Alias'): Exception constructing service 'SymbolSource': Error invoking constructor o - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Re%3A-NPE-when-trying-to-contribute-ServletContextSymbolProvider-to---SymbolSource-%28WAS%3A-Re%3A-Page-pool-hard-limit-and-page-instance-usage%29-tp19609348p19621689.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] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
Ulrich are you using a RequestFilter? - Original Message - From: Peter Stavrinides [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 23 September, 2008 1:45:49 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) I have looked at this a little more and it seems it is indeed a bug, I get a similar problem with code that works in the previous release. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 23 September, 2008 11:22:30 AM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) I'm not sure if we are doing everything right. I hoped to hear something from Howard or someone else who knows the matter before opening an issue on this. Cheers, Uli Am Di, 23.09.2008, 07:47, schrieb 9902468: Should I add Jira about this? After all, it is pretty pointless to have this symbol provider if it can't work. (Perhaps there is some way to overcome this problem?) - 99 Ulrich Stärk wrote: A Filter is passed a FilterConfig object where you can call getServletContext() and get the ServletContext. So the availability shouldn't be a problem. I rather believe that it doesn't get set in ApplicationGlobals until a certain point which is after building the SymbolSource... Uli Am Mo, 22.09.2008, 16:01, schrieb Peter Stavrinides: Just a wild guess, but it sounds like an 'order of things' type problem, Tapestry being a filter and not essentially a servlet, the context might not be available at that point. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Monday, 22 September, 2008 4:51:23 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) The problem seems to be, that the ServletContext provided by ApplicationGlobals is null when Tapestry tries to contribute the ServletContextSymbolProvider to the SymbolSource service. I don't know why this is the case. Maybe someone else can shed some light on this. Uli Am Mo, 22.09.2008, 08:08, schrieb 9902468: Hi again, I'm hitting my head to wall here with ServletContextSymbolProvider. It is configured like this: public static void contributeSymbolSource(OrderedConfigurationSymbolProvider configuration, @InjectService(ServletContextSymbolProvider) SymbolProvider servletContextSymbolProvider) { configuration.add(ServletContextSymbolProvider , servletContextSymbolProvider, after:SystemProperties, before:ApplicationDefaults); } public static ServletContextSymbolProvider buildServletContextSymbolProvider(ApplicationGlobals globals){ return new ServletContextSymbolProvider(globals.getServletContext()); } And it always ends to this error: java.lang.RuntimeException: Unable to instantiate class org.apache.tapestry5.services.TapestryModule as a module builder: Exception constructing service 'Alias': Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String, AliasManager, Collection) (at TapestryModule.java:217) (for service 'Alias'): Exception constructing service 'SymbolSource': Error invoking constructor o - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Re%3A-NPE-when-trying-to-contribute-ServletContextSymbolProvider-to---SymbolSource-%28WAS%3A-Re%3A-Page-pool-hard-limit-and-page-instance-usage%29-tp19609348p19621689.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] - 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: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
Yes, I am. Uli Am Di, 23.09.2008, 13:00, schrieb Peter Stavrinides: Ulrich are you using a RequestFilter? - Original Message - From: Peter Stavrinides [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 23 September, 2008 1:45:49 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) I have looked at this a little more and it seems it is indeed a bug, I get a similar problem with code that works in the previous release. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 23 September, 2008 11:22:30 AM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) I'm not sure if we are doing everything right. I hoped to hear something from Howard or someone else who knows the matter before opening an issue on this. Cheers, Uli Am Di, 23.09.2008, 07:47, schrieb 9902468: Should I add Jira about this? After all, it is pretty pointless to have this symbol provider if it can't work. (Perhaps there is some way to overcome this problem?) - 99 Ulrich Stärk wrote: A Filter is passed a FilterConfig object where you can call getServletContext() and get the ServletContext. So the availability shouldn't be a problem. I rather believe that it doesn't get set in ApplicationGlobals until a certain point which is after building the SymbolSource... Uli Am Mo, 22.09.2008, 16:01, schrieb Peter Stavrinides: Just a wild guess, but it sounds like an 'order of things' type problem, Tapestry being a filter and not essentially a servlet, the context might not be available at that point. - Original Message - From: Ulrich StÃÆärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Monday, 22 September, 2008 4:51:23 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) The problem seems to be, that the ServletContext provided by ApplicationGlobals is null when Tapestry tries to contribute the ServletContextSymbolProvider to the SymbolSource service. I don't know why this is the case. Maybe someone else can shed some light on this. Uli Am Mo, 22.09.2008, 08:08, schrieb 9902468: Hi again, I'm hitting my head to wall here with ServletContextSymbolProvider. It is configured like this: public static void contributeSymbolSource(OrderedConfigurationSymbolProvider configuration, @InjectService(ServletContextSymbolProvider) SymbolProvider servletContextSymbolProvider) { configuration.add(ServletContextSymbolProvider , servletContextSymbolProvider, after:SystemProperties, before:ApplicationDefaults); } public static ServletContextSymbolProvider buildServletContextSymbolProvider(ApplicationGlobals globals){ return new ServletContextSymbolProvider(globals.getServletContext()); } And it always ends to this error: java.lang.RuntimeException: Unable to instantiate class org.apache.tapestry5.services.TapestryModule as a module builder: Exception constructing service 'Alias': Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String, AliasManager, Collection) (at TapestryModule.java:217) (for service 'Alias'): Exception constructing service 'SymbolSource': Error invoking constructor o - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Re%3A-NPE-when-trying-to-contribute-ServletContextSymbolProvider-to---SymbolSource-%28WAS%3A-Re%3A-Page-pool-hard-limit-and-page-instance-usage%29-tp19609348p19621689.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] - 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] - To unsubscribe, e-mail: [EMAIL
Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
This seems to be the same bug that existed a while bug, change your RequestFilter to a Dispatcher and see if it works. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 23 September, 2008 2:15:18 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) Yes, I am. Uli Am Di, 23.09.2008, 13:00, schrieb Peter Stavrinides: Ulrich are you using a RequestFilter? - Original Message - From: Peter Stavrinides [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 23 September, 2008 1:45:49 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) I have looked at this a little more and it seems it is indeed a bug, I get a similar problem with code that works in the previous release. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 23 September, 2008 11:22:30 AM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) I'm not sure if we are doing everything right. I hoped to hear something from Howard or someone else who knows the matter before opening an issue on this. Cheers, Uli Am Di, 23.09.2008, 07:47, schrieb 9902468: Should I add Jira about this? After all, it is pretty pointless to have this symbol provider if it can't work. (Perhaps there is some way to overcome this problem?) - 99 Ulrich Stärk wrote: A Filter is passed a FilterConfig object where you can call getServletContext() and get the ServletContext. So the availability shouldn't be a problem. I rather believe that it doesn't get set in ApplicationGlobals until a certain point which is after building the SymbolSource... Uli Am Mo, 22.09.2008, 16:01, schrieb Peter Stavrinides: Just a wild guess, but it sounds like an 'order of things' type problem, Tapestry being a filter and not essentially a servlet, the context might not be available at that point. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Monday, 22 September, 2008 4:51:23 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) The problem seems to be, that the ServletContext provided by ApplicationGlobals is null when Tapestry tries to contribute the ServletContextSymbolProvider to the SymbolSource service. I don't know why this is the case. Maybe someone else can shed some light on this. Uli Am Mo, 22.09.2008, 08:08, schrieb 9902468: Hi again, I'm hitting my head to wall here with ServletContextSymbolProvider. It is configured like this: public static void contributeSymbolSource(OrderedConfigurationSymbolProvider configuration, @InjectService(ServletContextSymbolProvider) SymbolProvider servletContextSymbolProvider) { configuration.add(ServletContextSymbolProvider , servletContextSymbolProvider, after:SystemProperties, before:ApplicationDefaults); } public static ServletContextSymbolProvider buildServletContextSymbolProvider(ApplicationGlobals globals){ return new ServletContextSymbolProvider(globals.getServletContext()); } And it always ends to this error: java.lang.RuntimeException: Unable to instantiate class org.apache.tapestry5.services.TapestryModule as a module builder: Exception constructing service 'Alias': Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String, AliasManager, Collection) (at TapestryModule.java:217) (for service 'Alias'): Exception constructing service 'SymbolSource': Error invoking constructor o - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Re%3A-NPE-when-trying-to-contribute-ServletContextSymbolProvider-to---SymbolSource-%28WAS%3A-Re%3A-Page-pool-hard-limit-and-page-instance-usage%29-tp19609348p19621689.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,
Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
I even removed the RequestFilter, AppligationGlobals.getServletContext() still returns null. Uli Am Di, 23.09.2008, 14:42, schrieb Peter Stavrinides: This seems to be the same bug that existed a while bug, change your RequestFilter to a Dispatcher and see if it works. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 23 September, 2008 2:15:18 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) Yes, I am. Uli Am Di, 23.09.2008, 13:00, schrieb Peter Stavrinides: Ulrich are you using a RequestFilter? - Original Message - From: Peter Stavrinides [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 23 September, 2008 1:45:49 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) I have looked at this a little more and it seems it is indeed a bug, I get a similar problem with code that works in the previous release. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Tuesday, 23 September, 2008 11:22:30 AM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) I'm not sure if we are doing everything right. I hoped to hear something from Howard or someone else who knows the matter before opening an issue on this. Cheers, Uli Am Di, 23.09.2008, 07:47, schrieb 9902468: Should I add Jira about this? After all, it is pretty pointless to have this symbol provider if it can't work. (Perhaps there is some way to overcome this problem?) - 99 Ulrich StÃÆärk wrote: A Filter is passed a FilterConfig object where you can call getServletContext() and get the ServletContext. So the availability shouldn't be a problem. I rather believe that it doesn't get set in ApplicationGlobals until a certain point which is after building the SymbolSource... Uli Am Mo, 22.09.2008, 16:01, schrieb Peter Stavrinides: Just a wild guess, but it sounds like an 'order of things' type problem, Tapestry being a filter and not essentially a servlet, the context might not be available at that point. - Original Message - From: Ulrich StÃÆÃâÃâärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Monday, 22 September, 2008 4:51:23 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) The problem seems to be, that the ServletContext provided by ApplicationGlobals is null when Tapestry tries to contribute the ServletContextSymbolProvider to the SymbolSource service. I don't know why this is the case. Maybe someone else can shed some light on this. Uli Am Mo, 22.09.2008, 08:08, schrieb 9902468: Hi again, I'm hitting my head to wall here with ServletContextSymbolProvider. It is configured like this: public static void contributeSymbolSource(OrderedConfigurationSymbolProvider configuration, @InjectService(ServletContextSymbolProvider) SymbolProvider servletContextSymbolProvider) { configuration.add(ServletContextSymbolProvider , servletContextSymbolProvider, after:SystemProperties, before:ApplicationDefaults); } public static ServletContextSymbolProvider buildServletContextSymbolProvider(ApplicationGlobals globals){ return new ServletContextSymbolProvider(globals.getServletContext()); } And it always ends to this error: java.lang.RuntimeException: Unable to instantiate class org.apache.tapestry5.services.TapestryModule as a module builder: Exception constructing service 'Alias': Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String, AliasManager, Collection) (at TapestryModule.java:217) (for service 'Alias'): Exception constructing service 'SymbolSource': Error invoking constructor o - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Re%3A-NPE-when-trying-to-contribute-ServletContextSymbolProvider-to---SymbolSource-%28WAS%3A-Re%3A-Page-pool-hard-limit-and-page-instance-usage%29-tp19609348p19621689.html Sent from the Tapestry - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional
Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
Just a wild guess, but it sounds like an 'order of things' type problem, Tapestry being a filter and not essentially a servlet, the context might not be available at that point. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Monday, 22 September, 2008 4:51:23 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) The problem seems to be, that the ServletContext provided by ApplicationGlobals is null when Tapestry tries to contribute the ServletContextSymbolProvider to the SymbolSource service. I don't know why this is the case. Maybe someone else can shed some light on this. Uli Am Mo, 22.09.2008, 08:08, schrieb 9902468: Hi again, I'm hitting my head to wall here with ServletContextSymbolProvider. It is configured like this: public static void contributeSymbolSource(OrderedConfigurationSymbolProvider configuration, @InjectService(ServletContextSymbolProvider) SymbolProvider servletContextSymbolProvider) { configuration.add(ServletContextSymbolProvider , servletContextSymbolProvider, after:SystemProperties, before:ApplicationDefaults); } public static ServletContextSymbolProvider buildServletContextSymbolProvider(ApplicationGlobals globals){ return new ServletContextSymbolProvider(globals.getServletContext()); } And it always ends to this error: java.lang.RuntimeException: Unable to instantiate class org.apache.tapestry5.services.TapestryModule as a module builder: Exception constructing service 'Alias': Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String, AliasManager, Collection) (at TapestryModule.java:217) (for service 'Alias'): Exception constructing service 'SymbolSource': Error invoking constructor org.apache.tapestry5.ioc.internal.services.SymbolSourceImpl(List) (at SymbolSourceImpl.java:198) via org.apache.tapestry5.ioc.services.TapestryIOCModule.bind(ServiceBinder) (at TapestryIOCModule.java:38) (for service 'SymbolSource'): Error invoking service contribution method com.example.tapestry5.services.ExampleModule.contributeSymbolSource(OrderedConfiguration, SymbolProvider): Error building service proxy for service 'ServletContextSymbolProvider' (at com.example.tapestry5.services.ExampleModule.buildServletContextSymbolProvider(ApplicationGlobals) (at ExampleModule.java:215)): Error invoking service builder method com.example.tapestry5.services.ExampleModule.buildServletContextSymbolProvider(ApplicationGlobals) (at ExampleModule.java:215) (for service 'ServletContextSymbolProvider'): 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.buildAlias(Logger, String, AliasManager, Collection) (at TapestryModule.java:217) for references to another service that is itself dependent on service 'Alias'. I can't determine where the recursion is. Is the ApplicationGlobals initiating the construction of Alias service? If this is true then ApplicationGlobsals cannot be used while I'm constructing my alias overrides? Is there anyone out there who has this working? - 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
Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
A Filter is passed a FilterConfig object where you can call getServletContext() and get the ServletContext. So the availability shouldn't be a problem. I rather believe that it doesn't get set in ApplicationGlobals until a certain point which is after building the SymbolSource... Uli Am Mo, 22.09.2008, 16:01, schrieb Peter Stavrinides: Just a wild guess, but it sounds like an 'order of things' type problem, Tapestry being a filter and not essentially a servlet, the context might not be available at that point. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Monday, 22 September, 2008 4:51:23 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) The problem seems to be, that the ServletContext provided by ApplicationGlobals is null when Tapestry tries to contribute the ServletContextSymbolProvider to the SymbolSource service. I don't know why this is the case. Maybe someone else can shed some light on this. Uli Am Mo, 22.09.2008, 08:08, schrieb 9902468: Hi again, I'm hitting my head to wall here with ServletContextSymbolProvider. It is configured like this: public static void contributeSymbolSource(OrderedConfigurationSymbolProvider configuration, @InjectService(ServletContextSymbolProvider) SymbolProvider servletContextSymbolProvider) { configuration.add(ServletContextSymbolProvider , servletContextSymbolProvider, after:SystemProperties, before:ApplicationDefaults); } public static ServletContextSymbolProvider buildServletContextSymbolProvider(ApplicationGlobals globals){ return new ServletContextSymbolProvider(globals.getServletContext()); } And it always ends to this error: java.lang.RuntimeException: Unable to instantiate class org.apache.tapestry5.services.TapestryModule as a module builder: Exception constructing service 'Alias': Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String, AliasManager, Collection) (at TapestryModule.java:217) (for service 'Alias'): Exception constructing service 'SymbolSource': Error invoking constructor o - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage)
Should I add Jira about this? After all, it is pretty pointless to have this symbol provider if it can't work. (Perhaps there is some way to overcome this problem?) - 99 Ulrich Stärk wrote: A Filter is passed a FilterConfig object where you can call getServletContext() and get the ServletContext. So the availability shouldn't be a problem. I rather believe that it doesn't get set in ApplicationGlobals until a certain point which is after building the SymbolSource... Uli Am Mo, 22.09.2008, 16:01, schrieb Peter Stavrinides: Just a wild guess, but it sounds like an 'order of things' type problem, Tapestry being a filter and not essentially a servlet, the context might not be available at that point. - Original Message - From: Ulrich Stärk [EMAIL PROTECTED] To: Tapestry users users@tapestry.apache.org Sent: Monday, 22 September, 2008 4:51:23 PM GMT +02:00 Athens, Beirut, Bucharest, Istanbul Subject: NPE when trying to contribute ServletContextSymbolProvider to SymbolSource (WAS: Re: Page pool hard limit and page instance usage) The problem seems to be, that the ServletContext provided by ApplicationGlobals is null when Tapestry tries to contribute the ServletContextSymbolProvider to the SymbolSource service. I don't know why this is the case. Maybe someone else can shed some light on this. Uli Am Mo, 22.09.2008, 08:08, schrieb 9902468: Hi again, I'm hitting my head to wall here with ServletContextSymbolProvider. It is configured like this: public static void contributeSymbolSource(OrderedConfigurationSymbolProvider configuration, @InjectService(ServletContextSymbolProvider) SymbolProvider servletContextSymbolProvider) { configuration.add(ServletContextSymbolProvider , servletContextSymbolProvider, after:SystemProperties, before:ApplicationDefaults); } public static ServletContextSymbolProvider buildServletContextSymbolProvider(ApplicationGlobals globals){ return new ServletContextSymbolProvider(globals.getServletContext()); } And it always ends to this error: java.lang.RuntimeException: Unable to instantiate class org.apache.tapestry5.services.TapestryModule as a module builder: Exception constructing service 'Alias': Error invoking service builder method org.apache.tapestry5.services.TapestryModule.buildAlias(Logger, String, AliasManager, Collection) (at TapestryModule.java:217) (for service 'Alias'): Exception constructing service 'SymbolSource': Error invoking constructor o - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- View this message in context: http://www.nabble.com/Re%3A-NPE-when-trying-to-contribute-ServletContextSymbolProvider-to---SymbolSource-%28WAS%3A-Re%3A-Page-pool-hard-limit-and-page-instance-usage%29-tp19609348p19621689.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]