You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by chan Alfred <al...@gmail.com> on 2007/05/05 03:16:34 UTC

[Tapestry 5] CookieSink Implementation

Hi All,

I am trying to use org.apache.tapestry.services.PersistentLocale to
explicitly set the locale of the page regardless of the Client browser
locale.

But, I found that Null Pointer exception was thrown when I call

PersistentLocale.set(Locale.ENGLISH);

Aftert looking the source code, it seems that the CookieSink has not been
implemented in org.apache.tapestry.services.TapestryModule.
Am I correct?

Regards,
Alfred


P.S. The following is the exception thrown from Tapestry 5.

[ERROR] DefaultRequestExceptionHandler Processing of request failed with
uncaught exception: java.lang.NullPointerException
java.lang.NullPointerException
at $Request_112552cd0c6.getContextPath($Request_112552cd0c6.java)
at $Request_112552cd097.getContextPath($Request_112552cd097.java)
at $ContextPathSource_112552cd0c2.getContextPath($ContextPathSource_112552cd0c2.java)

at org.apache.tapestry.internal.services.CookiesImpl.writeCookieValue(
CookiesImpl.java:67)
at org.apache.tapestry.internal.services.CookiesImpl.writeCookieValue(
CookiesImpl.java:61)
at $Cookies_112552cd0c1.writeCookieValue($Cookies_112552cd0c1.java)
at org.example.hilo.services.AppModule$2.service(AppModule.java:88)
at $RequestFilter_112552cd0bd.service($RequestFilter_112552cd0bd.java)
at $RequestHandler_112552cd0bf.service($RequestHandler_112552cd0bf.java)
at org.apache.tapestry.internal.services.LocalizationFilter.service(
LocalizationFilter.java:43)
at $RequestHandler_112552cd0bf.service($RequestHandler_112552cd0bf.java)
at org.apache.tapestry.services.TapestryModule$3.service (
TapestryModule.java:736)
at $RequestHandler_112552cd0bf.service($RequestHandler_112552cd0bf.java)
at org.apache.tapestry.internal.services.StaticFilesFilter.service(
StaticFilesFilter.java:63)
at $RequestHandler_112552cd0bf.service($RequestHandler_112552cd0bf.java)
at org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(
CheckForUpdatesFilter.java:91)
at org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(
CheckForUpdatesFilter.java:82)
at org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead (
ConcurrentBarrier.java:77)
at org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(
CheckForUpdatesFilter.java:104)
at $RequestHandler_112552cd0bf.service($RequestHandler_112552cd0bf.java)
at $RequestHandler_112552cd0b9.service($RequestHandler_112552cd0b9.java)
at org.apache.tapestry.services.TapestryModule$11.service(
TapestryModule.java:1179)
at $HttpServletRequestHandler_112552cd0b8.service($HttpServl
etRequestHandler_112552cd0b8.java)
at org.apache.tapestry.TapestryFilter.doFilter (TapestryFilter.java:115)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(
ServletHandler.java:1040)
at org.mortbay.jetty.servlet.ServletHandler.handle (ServletHandler.java:352)
at org.mortbay.jetty.servlet.SessionHandler.handle (SessionHandler.java:230)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:627)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle (
ContextHandlerCollection.java:149)
at org.mortbay.jetty.handler.HandlerCollection.handle (
HandlerCollection.java:123)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:141)
at org.mortbay.jetty.Server.handle (Server.java:286)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java :444)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(
HttpConnection.java:701)
at org.mortbay.jetty.HttpParser.parseNext (HttpParser.java:500)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java :203)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:340)
at org.mortbay.jetty.nio.HttpChannelEndPoint.run(HttpChannelEndPoint.java:270)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(
BoundedThreadPool.java :475)
[ERROR] ExceptionReport Render queue error in BeginRender[
org.apache.tapestry.corelib.pages.ExceptionReport:renderobject_0]:
java.lang.NullPointerException
java.lang.NullPointerException
at $Request_112552cd0c6.getContextPath($Request_112552cd0c6.java)
at $Request_112552cd097.getContextPath($Request_112552cd097.java)
at org.apache.tapestry.internal.services.RequestRenderer.render (
RequestRenderer.java:34)
at org.apache.tapestry.internal.services.RequestRenderer.render (
RequestRenderer.java:24)
at $ObjectRenderer_112552cd0ee.render($ObjectRenderer_112552cd0ee.java)
at $ObjectRenderer_112552cd094.render($ObjectRenderer_112552cd094.java)
at org.apache.tapestry.corelib.components.RenderObject.beginRender (
RenderObject.java:37)
at org.apache.tapestry.corelib.components.RenderObject.beginRender(
RenderObject.java)
at org.apache.tapestry.internal.structure.ComponentPageElementImpl$10$1.run
(ComponentPageElementImpl.java :345)
at org.apache.tapestry.internal.structure.ComponentPageElementImpl.invoke(
ComponentPageElementImpl.java:932)
at org.apache.tapestry.internal.structure.ComponentPageElement
Impl.access$100 (ComponentPageElementImpl.java :69)
at org.apache.tapestry.internal.structure.ComponentPageElement
Impl$10.render(ComponentPageElementImpl.java:349)
at org.apache.tapestry.internal.services.RenderQueueImpl.run(
RenderQueueImpl.java :57)
at org.apache.tapestry.internal.services.PageMarkupRendererImp
l.renderPageMarkup (PageMarkupRendererImpl.java:40)
at $PageMarkupRenderer_112552cd0e7.renderPageMarkup($PageMarkupRe
nderer_112552cd0e7.java)
at org.apache.tapestry.internal.services.PageResponseRendererI
mpl.renderPageResponse(PageResponseRendererImpl.java :45)
at $PageResponseRenderer_112552cd0ab.renderPageResponse($PageResp
onseRenderer_112552cd0ab.java)
at org.apache.tapestry.internal.services.DefaultRequestExcepti
onHandler.handleRequestException(DefaultRequestExceptionHandler.java :60)
at $RequestExceptionHandler_112552cd09f.handleRequestExcep
tion($RequestExceptionHandler_112552cd09f.java)
at org.apache.tapestry.services.TapestryModule$3.service(TapestryModule.java
:745)
at $RequestHandler_112552cd0bf.service($RequestHandler_112552cd0bf.java)
at org.apache.tapestry.internal.services.StaticFilesFilter.service (
StaticFilesFilter.java:63)
at $RequestHandler_112552cd0bf.service($RequestHandler_112552cd0bf.java)
at org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke (
CheckForUpdatesFilter.java:91)
at org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke (
CheckForUpdatesFilter.java:82)
at org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(
ConcurrentBarrier.java :77)
at org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(
CheckForUpdatesFilter.java :104)
at $RequestHandler_112552cd0bf.service($RequestHandler_112552cd0bf.java)
at $RequestHandler_112552cd0b9.service($RequestHandler_112552cd0b9.java)
at org.apache.tapestry.services.TapestryModule$11.service (
TapestryModule.java:1179)
at $HttpServletRequestHandler_112552cd0b8.service($HttpServl
etRequestHandler_112552cd0b8.java)
at org.apache.tapestry.TapestryFilter.doFilter (TapestryFilter.java:115)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter (
ServletHandler.java:1040)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:352)
at org.mortbay.jetty.servlet.SessionHandler.handle (SessionHandler.java:230)
at org.mortbay.jetty.handler.ContextHandler.handle (ContextHandler.java:627)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(
ContextHandlerCollection.java:149)
at org.mortbay.jetty.handler.HandlerCollection.handle (
HandlerCollection.java:123)
at org.mortbay.jetty.handler.HandlerWrapper.handle (HandlerWrapper.java:141)
at org.mortbay.jetty.Server.handle(Server.java:286)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java :444)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete (
HttpConnection.java:701)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java :203)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java :340)
at org.mortbay.jetty.nio.HttpChannelEndPoint.run(HttpChannelEndPoint.java
:270)
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(
BoundedThreadPool.java :475)