Okay, here are the page classes:

com.fsadev.kamino.pages.news.NewsIndex
com.fsadev.kamino.pages.news.NewsRead
com.fsadev.kamino.pages.forum.ForumIndex

NewsIndex has an onActivate(int) method and NewsRead has an onActivate() and onActivate(String) method. ForumIndex doesn't have any onActivate methods at all.

When viewing /news/1, mapped to NewsIndex at the URL http://localhost:8080/kaminoweb/news/1, I attempt to log in through a form that submits to http://localhost:8080/kaminoweb/news/index.layout.quicklogin. This fails with the aforementioned NumberFormatException. Now, if I go to another page, say, /forum mapped to ForumIndex at the URL http://localhost:8080/kaminoweb/forum I can log in fine through http://localhost:8080/kaminoweb/forum/index.layout.quicklogin. However, I can't log out from this page via http://localhost:8080/kaminoweb/forum/index.layout.logout. This fails with no exception or anything.

Now that I'm logged in I can go to /news/read mapped to NewsRead at the URL http://localhost:8080/kaminoweb/news/read/test-1. This shows the news item with the id 1. When attempting to submit a comment via http://localhost:8080/kaminoweb/news/read.comment.add I get another NumberFormatException.

So, it appears that what should really be a component event URL is interpreted as activation context for the pages in question...

-Filip

Howard Lewis Ship skrev:
It would be useful to know about your various class names.  The more
the merrier.    Also the exact URLs that are failing.



On Wed, Feb 27, 2008 at 3:51 PM, Filip S. Adamsen <[EMAIL PROTECTED]> wrote:
Hi,

 I'm seeing weird NumberFormatExceptions on component actions from pages
 in folders with index pages. It looks like Tapestry tries to pass the
 page and nested component id of the component event to the index page if
 it accepts an activation context.

 Scenario: I have a news folder in com.fsadev.kamino.pages. It contains a
 NewsIndex and a NewsRead page. NewsIndex accepts an optional pageNumber:

 public class NewsIndex {
   ...
   Object onActivate(int pageNumber) {
     ...
   }
   ...
 }

 NewsRead has a form that submits a comment. When the comment is
 submitted the following exception occurs:

 [ERROR] RequestExceptionHandler Processing of request failed with
 uncaught exception: Exception in method
 com.fsadev.kamino.pages.news.NewsIndex.onActivate(int) (at
 NewsIndex.java:58), parameter #1: Coercion of read.comment.add to type
 java.lang.Integer (via String --> Long, Long --> Integer) failed: For
 input string: "read.comment.add"
 org.apache.tapestry.runtime.ComponentEventException: Exception in method
 com.fsadev.kamino.pages.news.NewsIndex.onActivate(int) (at
 NewsIndex.java:58), parameter #1: Coercion of read.comment.add to type
 java.lang.Integer (via String --> Long, Long --> Integer) failed: For
 input string: "read.comment.add"
        at
 
org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1021)
        at
 
org.apache.tapestry.internal.services.PageRenderRequestHandlerImpl.handle(PageRenderRequestHandlerImpl.java:52)
        at
 
com.fsadev.kamino.services.auth.AccessRequestFilter.handle(AccessRequestFilter.java:55)
        at
 
$PageRenderRequestHandler_1185d36d0cc.handle($PageRenderRequestHandler_1185d36d0cc.java)
        at
 
com.fsadev.tapestry.hibernate.services.TransactionRequestFilter.handle(TransactionRequestFilter.java:45)
        at
 
$PageRenderRequestHandler_1185d36d0cc.handle($PageRenderRequestHandler_1185d36d0cc.java)
        at
 org.apache.tapestry.services.TapestryModule$29.handle(TapestryModule.java:1594)
        at
 
$PageRenderRequestHandler_1185d36d0cc.handle($PageRenderRequestHandler_1185d36d0cc.java)
        at
 
$PageRenderRequestHandler_1185d36d0c1.handle($PageRenderRequestHandler_1185d36d0c1.java)
        at
 
org.apache.tapestry.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:85)
        at $Dispatcher_1185d36d0c4.dispatch($Dispatcher_1185d36d0c4.java)
        at $Dispatcher_1185d36d0b7.dispatch($Dispatcher_1185d36d0b7.java)
        at
 org.apache.tapestry.services.TapestryModule$13.service(TapestryModule.java:918)
        at
 
org.apache.tapestry.internal.services.LocalizationFilter.service(LocalizationFilter.java:43)
        at $RequestHandler_1185d36d0b8.service($RequestHandler_1185d36d0b8.java)
        at
 org.apache.tapestry.services.TapestryModule$3.service(TapestryModule.java:534)
        at $RequestHandler_1185d36d0b8.service($RequestHandler_1185d36d0b8.java)
        at
 org.apache.tapestry.services.TapestryModule$2.service(TapestryModule.java:509)
        at $RequestHandler_1185d36d0b8.service($RequestHandler_1185d36d0b8.java)
        at
 
org.apache.tapestry.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79)
        at $RequestHandler_1185d36d0b8.service($RequestHandler_1185d36d0b8.java)
        at
 
com.fsadev.tapestry.utilities.services.TapestryUtilitiesModule$1.service(TapestryUtilitiesModule.java:56)
        at $RequestHandler_1185d36d0b8.service($RequestHandler_1185d36d0b8.java)
        at
 
org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93)
        at
 
org.apache.tapestry.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84)
        at
 
org.apache.tapestry.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:77)
        at
 
org.apache.tapestry.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106)
        at $RequestHandler_1185d36d0b8.service($RequestHandler_1185d36d0b8.java)
        at $RequestHandler_1185d36d0b2.service($RequestHandler_1185d36d0b2.java)
        at
 org.apache.tapestry.services.TapestryModule$12.service(TapestryModule.java:898)
        at
 
org.apache.tapestry.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:43)
        at
 
$HttpServletRequestHandler_1185d36d0b3.service($HttpServletRequestHandler_1185d36d0b3.java)
        at
 
org.apache.tapestry.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
        at
 
$HttpServletRequestFilter_1185d36d0b1.service($HttpServletRequestFilter_1185d36d0b1.java)
        at
 
$HttpServletRequestHandler_1185d36d0b3.service($HttpServletRequestHandler_1185d36d0b3.java)
        at
 
$HttpServletRequestHandler_1185d36d0af.service($HttpServletRequestHandler_1185d36d0af.java)
        at org.apache.tapestry.TapestryFilter.doFilter(TapestryFilter.java:164)
        at
 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at
 
com.fsadev.tapestry.utilities.StripUrlSessionIdFilter.doFilter(StripUrlSessionIdFilter.java:38)
        at
 
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
        at 
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
        at
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
        at 
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
        at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
        at
 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)
        at
 org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
        at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
        at org.mortbay.jetty.Server.handle(Server.java:313)
        at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
        at
 
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:844)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:644)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
        at
 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396)
        at
 org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
 Caused by: java.lang.IllegalArgumentException: Exception in method
 com.fsadev.kamino.pages.news.NewsIndex.onActivate(int) (at
 NewsIndex.java:58), parameter #1: Coercion of read.comment.add to type
 java.lang.Integer (via String --> Long, Long --> Integer) failed: For
 input string: "read.comment.add"
        at
 
org.apache.tapestry.internal.services.ComponentEventImpl.coerceContext(ComponentEventImpl.java:72)
        at
 com.fsadev.kamino.pages.news.NewsIndex.dispatchComponentEvent(NewsIndex.java)
        at
 
org.apache.tapestry.internal.structure.ComponentPageElementImpl.dispatchEvent(ComponentPageElementImpl.java:843)
        at
 
org.apache.tapestry.internal.structure.ComponentPageElementImpl.triggerContextEvent(ComponentPageElementImpl.java:1004)
        ... 55 more
 Caused by: java.lang.RuntimeException: Coercion of read.comment.add to
 type java.lang.Integer (via String --> Long, Long --> Integer) failed:
 For input string: "read.comment.add"
        at
 
org.apache.tapestry.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:130)
        at $TypeCoercer_1185d36d08b.coerce($TypeCoercer_1185d36d08b.java)
        at
 
org.apache.tapestry.internal.services.TypeCoercedValueEncoderFactory$1.toValue(TypeCoercedValueEncoderFactory.java:45)
        at
 
org.apache.tapestry.internal.services.ContextValueEncoderImpl.toValue(ContextValueEncoderImpl.java:47)
        at
 $ContextValueEncoder_1185d36d0c3.toValue($ContextValueEncoder_1185d36d0c3.java)
        at
 org.apache.tapestry.internal.URLEventContext.get(URLEventContext.java:44)
        at
 
org.apache.tapestry.internal.services.ComponentEventImpl.coerceContext(ComponentEventImpl.java:67)
        ... 58 more
 Caused by: java.lang.NumberFormatException: For input string:
 "read.comment.add"
        at
 java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
        at java.lang.Long.parseLong(Long.java:403)
        at java.lang.Long.<init>(Long.java:671)
        at
 
org.apache.tapestry.ioc.services.TapestryIOCModule$7.coerce(TapestryIOCModule.java:159)
        at
 
org.apache.tapestry.ioc.services.TapestryIOCModule$7.coerce(TapestryIOCModule.java:157)
        at
 
org.apache.tapestry.ioc.services.CoercionTuple$CoercionWrapper.coerce(CoercionTuple.java:54)
        at
 
org.apache.tapestry.ioc.internal.services.CompoundCoercion.coerce(CompoundCoercion.java:46)
        at
 
org.apache.tapestry.ioc.internal.services.TypeCoercerImpl.coerce(TypeCoercerImpl.java:126)
        ... 64 more

 Something similar happens on index pages that do not accept any
 activation context. In this case the component event isn't even triggered...

 Am I doing something wrong here or have I found a bug?

 -Filip

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






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

Reply via email to