Tapestry
  1. Tapestry
  2. TAPESTRY-2500

Using @PageActivationContext on an int field results in a java.lang.Verify error

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 5.0.13
    • Fix Version/s: 5.0.14
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      java.lang.VerifyError: (class: com/formos/blog/pages/Index, method: onPassivate signature: ()Ljava/lang/Object Wrong return type in function
      at $Instantiator_11ae5b4e297.newInstance($Instantiator_11ae5b4e297.java)
      at org.apache.tapestry5.internal.structure.InternalComponentResourcesImpl.<init>(InternalComponentResourcesImpl.java:82)
      at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.<init>(ComponentPageElementImpl.java:571)
      at org.apache.tapestry5.internal.structure.ComponentPageElementImpl.<init>(ComponentPageElementImpl.java:584)
      at org.apache.tapestry5.internal.services.PageElementFactoryImpl.newRootComponentElement(PageElementFactoryImpl.java:261)
      at $PageElementFactory_11ae5b4e284.newRootComponentElement($PageElementFactory_11ae5b4e284.java)
      at org.apache.tapestry5.internal.services.PageLoaderProcessor.loadRootComponent(PageLoaderProcessor.java:413)
      at org.apache.tapestry5.internal.services.PageLoaderProcessor.loadPage(PageLoaderProcessor.java:391)
      at org.apache.tapestry5.internal.services.PageLoaderImpl.loadPage(PageLoaderImpl.java:59)
      at $PageLoader_11ae5b4e282.loadPage($PageLoader_11ae5b4e282.java)
      at org.apache.tapestry5.internal.services.PagePoolCache.checkout(PagePoolCache.java:210)
      at org.apache.tapestry5.internal.services.PagePoolImpl.checkout(PagePoolImpl.java:107)
      at $PagePool_11ae5b4e281.checkout($PagePool_11ae5b4e281.java)
      at org.apache.tapestry5.internal.services.RequestPageCacheImpl.get(RequestPageCacheImpl.java:43)
      at $RequestPageCache_11ae5b4e280.get($RequestPageCache_11ae5b4e280.java)
      at $RequestPageCache_11ae5b4e278.get($RequestPageCache_11ae5b4e278.java)
      at org.apache.tapestry5.internal.services.RequestSecurityManagerImpl.checkForInsecureRequest(RequestSecurityManagerImpl.java:59)
      at $RequestSecurityManager_11ae5b4e277.checkForInsecureRequest($RequestSecurityManager_11ae5b4e277.java)
      at org.apache.tapestry5.services.TapestryModule$28.handle(TapestryModule.java:1653)
      at $PageRenderRequestHandler_11ae5b4e27b.handle($PageRenderRequestHandler_11ae5b4e27b.java)
      at $PageRenderRequestHandler_11ae5b4e26f.handle($PageRenderRequestHandler_11ae5b4e26f.java)
      at org.apache.tapestry5.internal.services.PageRenderDispatcher.process(PageRenderDispatcher.java:97)
      at org.apache.tapestry5.internal.services.PageRenderDispatcher.dispatch(PageRenderDispatcher.java:83)
      at $Dispatcher_11ae5b4e276.dispatch($Dispatcher_11ae5b4e276.java)
      at $Dispatcher_11ae5b4e268.dispatch($Dispatcher_11ae5b4e268.java)
      at org.apache.tapestry5.services.TapestryModule$12.service(TapestryModule.java:940)
      at org.apache.tapestry5.internal.services.LocalizationFilter.service(LocalizationFilter.java:42)
      at $RequestHandler_11ae5b4e269.service($RequestHandler_11ae5b4e269.java)
      at org.apache.tapestry5.services.TapestryModule$2.service(TapestryModule.java:588)
      at $RequestHandler_11ae5b4e269.service($RequestHandler_11ae5b4e269.java)
      at org.apache.tapestry5.internal.services.RequestErrorFilter.service(RequestErrorFilter.java:26)
      at $RequestHandler_11ae5b4e269.service($RequestHandler_11ae5b4e269.java)
      at org.apache.tapestry5.internal.services.StaticFilesFilter.service(StaticFilesFilter.java:79)
      at $RequestHandler_11ae5b4e269.service($RequestHandler_11ae5b4e269.java)
      at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:93)
      at org.apache.tapestry5.internal.services.CheckForUpdatesFilter$2.invoke(CheckForUpdatesFilter.java:84)
      at org.apache.tapestry5.ioc.internal.util.ConcurrentBarrier.withRead(ConcurrentBarrier.java:83)
      at org.apache.tapestry5.internal.services.CheckForUpdatesFilter.service(CheckForUpdatesFilter.java:106)
      at $RequestHandler_11ae5b4e269.service($RequestHandler_11ae5b4e269.java)
      at $RequestHandler_11ae5b4e261.service($RequestHandler_11ae5b4e261.java)
      at org.apache.tapestry5.services.TapestryModule$11.service(TapestryModule.java:920)
      at org.apache.tapestry5.upload.internal.services.MultipartServletRequestFilter.service(MultipartServletRequestFilter.java:44)
      at $HttpServletRequestHandler_11ae5b4e262.service($HttpServletRequestHandler_11ae5b4e262.java)
      at org.apache.tapestry5.internal.services.IgnoredPathsFilter.service(IgnoredPathsFilter.java:62)
      at $HttpServletRequestFilter_11ae5b4e260.service($HttpServletRequestFilter_11ae5b4e260.java)
      at $HttpServletRequestHandler_11ae5b4e262.service($HttpServletRequestHandler_11ae5b4e262.java)
      at com.formos.blog.services.AppModule$1.service(AppModule.java:42)
      at $HttpServletRequestHandler_11ae5b4e25e.service($HttpServletRequestHandler_11ae5b4e25e.java)
      at org.apache.tapestry5.TapestryFilter.doFilter(TapestryFilter.java:168)
      at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1065)
      at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:365)
      at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:185)
      at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
      at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:689)
      at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:391)
      at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:146)
      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:285)
      at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:457)
      at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:751)
      at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:500)
      at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:209)
      at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:357)
      at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:329)
      at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:475)

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        package com.formos.blog.pages;

        import org.apache.tapestry5.annotations.Property;
        import org.apache.tapestry5.annotations.PageActivationContext;

        public class Index
        {
        @PageActivationContext
        @Property
        private int count;

        void onIncrement(int amount)

        { count += amount; }

        }

        [DEBUG] Index Finished class transformation: InternalClassTransformation[
        public com.formos.blog.pages.Index extends java.lang.Object
        implements org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand

        add default method: public void postRenderCleanup()
        <default>

        add default method: public void setupRender(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
        <default>

        add default method: public void beginRender(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
        <default>

        add default method: public void beforeRenderTemplate(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
        <default>

        add default method: public void afterRenderTemplate(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
        <default>

        add default method: public void beforeRenderBody(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
        <default>

        add default method: public void afterRenderBody(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
        <default>

        add default method: public void afterRender(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
        <default>

        add default method: public void cleanupRender(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2)
        <default>

        add default method: public boolean dispatchComponentEvent(org.apache.tapestry5.runtime.ComponentEvent $1)
        <default>

        add default method: public org.apache.tapestry5.ComponentResources getComponentResources()
        <default>

        add default method: public void containingPageDidLoad()
        <default>

        add default method: public void containingPageDidDetach()
        <default>

        add default method: public void containingPageDidAttach()
        <default>

        add field: protected final org.apache.tapestry5.internal.InternalComponentResources _$resources;

        replace method: public final org.apache.tapestry5.ComponentResources getComponentResources()
        return _$resources;

        add transformed method: protected final void onActivate(int $1)
        count = $1;

        add transformed method: protected final java.lang.Object onPassivate()
        return count;

        extend method: public boolean dispatchComponentEvent(org.apache.tapestry5.runtime.ComponentEvent $1)
        {
        if ($1.isAborted()) return $_;
        try
        {
        if ($1.matches("Activate", "", 1))

        { $_ = true; $1.setMethodDescription("com.formos.blog.pages.Index.onActivate(int) (at Index.java:-1)"); onActivate(((java.lang.Integer)$1.coerceContext(0, "java.lang.Integer")).intValue()); }

        if ($1.matches("Increment", "", 1))

        { $_ = true; $1.setMethodDescription("com.formos.blog.pages.Index.onIncrement(int) (at Index.java:14)"); onIncrement(((java.lang.Integer)$1.coerceContext(0, "java.lang.Integer")).intValue()); }

        if ($1.matches("Passivate", "", 0))

        { $_ = true; $1.setMethodDescription("com.formos.blog.pages.Index.onPassivate() (at Index.java:-1)"); if ($1.storeResult(($w) onPassivate())) return true; }

        }
        catch (RuntimeException ex)

        { throw ex; }

        catch (Exception ex)

        { throw new RuntimeException(ex); }


        }

        add default method: public void render(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.RenderQueue $2)
        <default>

        replace method: public void render(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.RenderQueue $2)
        _$resources.queueRender($2);

        extend method: public void postRenderCleanup()
        _$resources.postRenderCleanup();

        add transformed method: public final int getCount()
        return count;

        add transformed method: public final void setCount(int $1)
        count = $1;

        add field: private int _$count_default;

        extend method: public void containingPageDidLoad()
        _$count_default = count;

        extend method: public void containingPageDidDetach()
        count = _$count_default;

        convert default constructor: initializer();

        add constructor: com.formos.blog.pages.Index(org.apache.tapestry5.internal.InternalComponentResources $1)

        { _$resources = $1; initializer(); }
        Show
        Howard M. Lewis Ship added a comment - package com.formos.blog.pages; import org.apache.tapestry5.annotations.Property; import org.apache.tapestry5.annotations.PageActivationContext; public class Index { @PageActivationContext @Property private int count; void onIncrement(int amount) { count += amount; } } [DEBUG] Index Finished class transformation: InternalClassTransformation[ public com.formos.blog.pages.Index extends java.lang.Object implements org.apache.tapestry5.runtime.Component, org.apache.tapestry5.runtime.RenderCommand add default method: public void postRenderCleanup() <default> add default method: public void setupRender(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2) <default> add default method: public void beginRender(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2) <default> add default method: public void beforeRenderTemplate(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2) <default> add default method: public void afterRenderTemplate(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2) <default> add default method: public void beforeRenderBody(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2) <default> add default method: public void afterRenderBody(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2) <default> add default method: public void afterRender(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2) <default> add default method: public void cleanupRender(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.Event $2) <default> add default method: public boolean dispatchComponentEvent(org.apache.tapestry5.runtime.ComponentEvent $1) <default> add default method: public org.apache.tapestry5.ComponentResources getComponentResources() <default> add default method: public void containingPageDidLoad() <default> add default method: public void containingPageDidDetach() <default> add default method: public void containingPageDidAttach() <default> add field: protected final org.apache.tapestry5.internal.InternalComponentResources _$resources; replace method: public final org.apache.tapestry5.ComponentResources getComponentResources() return _$resources; add transformed method: protected final void onActivate(int $1) count = $1; add transformed method: protected final java.lang.Object onPassivate() return count; extend method: public boolean dispatchComponentEvent(org.apache.tapestry5.runtime.ComponentEvent $1) { if ($1.isAborted()) return $_; try { if ($1.matches("Activate", "", 1)) { $_ = true; $1.setMethodDescription("com.formos.blog.pages.Index.onActivate(int) (at Index.java:-1)"); onActivate(((java.lang.Integer)$1.coerceContext(0, "java.lang.Integer")).intValue()); } if ($1.matches("Increment", "", 1)) { $_ = true; $1.setMethodDescription("com.formos.blog.pages.Index.onIncrement(int) (at Index.java:14)"); onIncrement(((java.lang.Integer)$1.coerceContext(0, "java.lang.Integer")).intValue()); } if ($1.matches("Passivate", "", 0)) { $_ = true; $1.setMethodDescription("com.formos.blog.pages.Index.onPassivate() (at Index.java:-1)"); if ($1.storeResult(($w) onPassivate())) return true; } } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new RuntimeException(ex); } } add default method: public void render(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.RenderQueue $2) <default> replace method: public void render(org.apache.tapestry5.MarkupWriter $1, org.apache.tapestry5.runtime.RenderQueue $2) _$resources.queueRender($2); extend method: public void postRenderCleanup() _$resources.postRenderCleanup(); add transformed method: public final int getCount() return count; add transformed method: public final void setCount(int $1) count = $1; add field: private int _$count_default; extend method: public void containingPageDidLoad() _$count_default = count; extend method: public void containingPageDidDetach() count = _$count_default; convert default constructor: initializer(); add constructor: com.formos.blog.pages.Index(org.apache.tapestry5.internal.InternalComponentResources $1) { _$resources = $1; initializer(); }
        Hide
        Howard M. Lewis Ship added a comment -

        I think this is the problem:

        add transformed method: protected final java.lang.Object onPassivate()
        return count;

        That should probably be: return ($w)count ... i.e., wrap the object if it is a primitive.

        Strange that Javassist does not catch this, however.

        Show
        Howard M. Lewis Ship added a comment - I think this is the problem: add transformed method: protected final java.lang.Object onPassivate() return count; That should probably be: return ($w)count ... i.e., wrap the object if it is a primitive. Strange that Javassist does not catch this, however.

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Howard M. Lewis Ship
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development