You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Ezra Epstein (JIRA)" <de...@tapestry.apache.org> on 2007/11/09 20:00:54 UTC

[jira] Created: (TAPESTRY-1898) Leaky Framework: cannot implement a method named 'getServlerContext()' on a Page component

Leaky Framework: cannot implement a method named 'getServlerContext()' on a Page component
------------------------------------------------------------------------------------------

                 Key: TAPESTRY-1898
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1898
             Project: Tapestry
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions: 5.0.6
         Environment: JDK 1.6
Windows XP
            Reporter: Ezra Epstein


Leaky Framework: cannot implement a method named 'getServlerContext()' on a Page component.

I've got a page that's working fine.  Was getting the ServletContext via an injected ApplicationGlobals and using the ApplicationGlobals within methods that needed the ServletContext.  Started to be a few methods needed it so I created a simple convenience method:

	@Inject
	@Service("ApplicationGlobals")
	private ApplicationGlobals applicationGlobals;

	protected ServletContext getServletContextObj() {
		return (applicationGlobals == null ? null : applicationGlobals.getServletContext());
	}

And:

org.apache.tapestry.internal.services.TransformationException
 
StackMapTable format error: bad class index
transformation 
InternalClassTransformation[
public com.bar.baf.pages.UploadClip extends java.lang.Object
  implements org.apache.tapestry.runtime.Component, org.apache.tapestry.runtime.RenderCommand

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

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

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

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

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

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

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

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

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

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

add default method: public org.apache.tapestry.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.tapestry.internal.InternalComponentResources _$resources;

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

...


Turns out that getServletContext() is "reserved" by Tapestry.  I tried 

protected abstract ServletContext getServletContext();

But no dice. 

Work-around:  changed the name of the method.  That worked.  Downside: the getServletContext() method name is the obvious /desirable one.

Suggestion:  Prefer to have Tapestry not take over method names.  If it must, prefer to give them scoped names that aren't likely to be used by regular apps.  E.g.,  get/setTap5Foo (in general) and  getTap5ServletContext() (in particular).

Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-1898) Strange error for component classes under JDK 1.6

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1898?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAPESTRY-1898:
-------------------------------------------

    Assignee: Howard M. Lewis Ship
     Summary: Strange error for component classes under JDK 1.6  (was: Leaky Framework: cannot implement a method named 'getServlerContext()' on a Page component)

I would like to resolve this bug as a duplicate of TAPESTRY-1897 if you are no longer seeing the odd error.

> Strange error for component classes under JDK 1.6
> -------------------------------------------------
>
>                 Key: TAPESTRY-1898
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1898
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>         Environment: JDK 1.6
> Windows XP
>            Reporter: Ezra Epstein
>            Assignee: Howard M. Lewis Ship
>
> Leaky Framework: cannot implement a method named 'getServlerContext()' on a Page component.
> I've got a page that's working fine.  Was getting the ServletContext via an injected ApplicationGlobals and using the ApplicationGlobals within methods that needed the ServletContext.  Started to be a few methods needed it so I created a simple convenience method:
> 	@Inject
> 	@Service("ApplicationGlobals")
> 	private ApplicationGlobals applicationGlobals;
> 	protected ServletContext getServletContextObj() {
> 		return (applicationGlobals == null ? null : applicationGlobals.getServletContext());
> 	}
> And:
> org.apache.tapestry.internal.services.TransformationException
>  
> StackMapTable format error: bad class index
> transformation 
> InternalClassTransformation[
> public com.bar.baf.pages.UploadClip extends java.lang.Object
>   implements org.apache.tapestry.runtime.Component, org.apache.tapestry.runtime.RenderCommand
> add default method: public void postRenderCleanup()
> <default>
> add default method: public void setupRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void beginRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void beforeRenderTemplate(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void afterRenderTemplate(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void beforeRenderBody(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void afterRenderBody(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void afterRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void cleanupRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public boolean handleComponentEvent(org.apache.tapestry.runtime.ComponentEvent $1)
> <default>
> add default method: public org.apache.tapestry.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.tapestry.internal.InternalComponentResources _$resources;
> replace method: public final org.apache.tapestry.ComponentResources getComponentResources()
> return _$resources
> ...
> Turns out that getServletContext() is "reserved" by Tapestry.  I tried 
> protected abstract ServletContext getServletContext();
> But no dice. 
> Work-around:  changed the name of the method.  That worked.  Downside: the getServletContext() method name is the obvious /desirable one.
> Suggestion:  Prefer to have Tapestry not take over method names.  If it must, prefer to give them scoped names that aren't likely to be used by regular apps.  E.g.,  get/setTap5Foo (in general) and  getTap5ServletContext() (in particular).
> Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1898) Leaky Framework: cannot implement a method named 'getServlerContext()' on a Page component

Posted by "Ezra Epstein (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541477 ] 

Ezra Epstein commented on TAPESTRY-1898:
----------------------------------------

Hey Howard,

Thank much for correcting my attempt to guess what's under the covers.  And thanks for the fix.  I'll try it...

OK, that was easy and, yup, it worked.



> Leaky Framework: cannot implement a method named 'getServlerContext()' on a Page component
> ------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1898
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1898
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>         Environment: JDK 1.6
> Windows XP
>            Reporter: Ezra Epstein
>
> Leaky Framework: cannot implement a method named 'getServlerContext()' on a Page component.
> I've got a page that's working fine.  Was getting the ServletContext via an injected ApplicationGlobals and using the ApplicationGlobals within methods that needed the ServletContext.  Started to be a few methods needed it so I created a simple convenience method:
> 	@Inject
> 	@Service("ApplicationGlobals")
> 	private ApplicationGlobals applicationGlobals;
> 	protected ServletContext getServletContextObj() {
> 		return (applicationGlobals == null ? null : applicationGlobals.getServletContext());
> 	}
> And:
> org.apache.tapestry.internal.services.TransformationException
>  
> StackMapTable format error: bad class index
> transformation 
> InternalClassTransformation[
> public com.bar.baf.pages.UploadClip extends java.lang.Object
>   implements org.apache.tapestry.runtime.Component, org.apache.tapestry.runtime.RenderCommand
> add default method: public void postRenderCleanup()
> <default>
> add default method: public void setupRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void beginRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void beforeRenderTemplate(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void afterRenderTemplate(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void beforeRenderBody(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void afterRenderBody(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void afterRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void cleanupRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public boolean handleComponentEvent(org.apache.tapestry.runtime.ComponentEvent $1)
> <default>
> add default method: public org.apache.tapestry.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.tapestry.internal.InternalComponentResources _$resources;
> replace method: public final org.apache.tapestry.ComponentResources getComponentResources()
> return _$resources
> ...
> Turns out that getServletContext() is "reserved" by Tapestry.  I tried 
> protected abstract ServletContext getServletContext();
> But no dice. 
> Work-around:  changed the name of the method.  That worked.  Downside: the getServletContext() method name is the obvious /desirable one.
> Suggestion:  Prefer to have Tapestry not take over method names.  If it must, prefer to give them scoped names that aren't likely to be used by regular apps.  E.g.,  get/setTap5Foo (in general) and  getTap5ServletContext() (in particular).
> Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Closed: (TAPESTRY-1898) Strange error for component classes under JDK 1.6

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1898?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAPESTRY-1898.
------------------------------------------

    Resolution: Invalid

Please re-open this bug if the problem continues, even with the new version of Javassist.

> Strange error for component classes under JDK 1.6
> -------------------------------------------------
>
>                 Key: TAPESTRY-1898
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1898
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>         Environment: JDK 1.6
> Windows XP
>            Reporter: Ezra Epstein
>            Assignee: Howard M. Lewis Ship
>
> Leaky Framework: cannot implement a method named 'getServlerContext()' on a Page component.
> I've got a page that's working fine.  Was getting the ServletContext via an injected ApplicationGlobals and using the ApplicationGlobals within methods that needed the ServletContext.  Started to be a few methods needed it so I created a simple convenience method:
> 	@Inject
> 	@Service("ApplicationGlobals")
> 	private ApplicationGlobals applicationGlobals;
> 	protected ServletContext getServletContextObj() {
> 		return (applicationGlobals == null ? null : applicationGlobals.getServletContext());
> 	}
> And:
> org.apache.tapestry.internal.services.TransformationException
>  
> StackMapTable format error: bad class index
> transformation 
> InternalClassTransformation[
> public com.bar.baf.pages.UploadClip extends java.lang.Object
>   implements org.apache.tapestry.runtime.Component, org.apache.tapestry.runtime.RenderCommand
> add default method: public void postRenderCleanup()
> <default>
> add default method: public void setupRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void beginRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void beforeRenderTemplate(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void afterRenderTemplate(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void beforeRenderBody(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void afterRenderBody(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void afterRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void cleanupRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public boolean handleComponentEvent(org.apache.tapestry.runtime.ComponentEvent $1)
> <default>
> add default method: public org.apache.tapestry.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.tapestry.internal.InternalComponentResources _$resources;
> replace method: public final org.apache.tapestry.ComponentResources getComponentResources()
> return _$resources
> ...
> Turns out that getServletContext() is "reserved" by Tapestry.  I tried 
> protected abstract ServletContext getServletContext();
> But no dice. 
> Work-around:  changed the name of the method.  That worked.  Downside: the getServletContext() method name is the obvious /desirable one.
> Suggestion:  Prefer to have Tapestry not take over method names.  If it must, prefer to give them scoped names that aren't likely to be used by regular apps.  E.g.,  get/setTap5Foo (in general) and  getTap5ServletContext() (in particular).
> Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Commented: (TAPESTRY-1898) Leaky Framework: cannot implement a method named 'getServlerContext()' on a Page component

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541420 ] 

Howard M. Lewis Ship commented on TAPESTRY-1898:
------------------------------------------------

You're making some innacurate guesses about what's going on  Tapestry should not care about the method names.  Trust me, if it was a case of a reserved name, you would get a much better exception message!

The exception you are seeing appears to be related to JDK 1.6 bytecode generation, which the currently used version of Javassist does not seem to handle correctly.

We'll be upgrading to the latest stable version of Javassist shortly, it should be more capable of handling this code.

In the meantime, change your compiler to generate 1.5 bytecode and retry with the original name, it should work.

> Leaky Framework: cannot implement a method named 'getServlerContext()' on a Page component
> ------------------------------------------------------------------------------------------
>
>                 Key: TAPESTRY-1898
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1898
>             Project: Tapestry
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.0.6
>         Environment: JDK 1.6
> Windows XP
>            Reporter: Ezra Epstein
>
> Leaky Framework: cannot implement a method named 'getServlerContext()' on a Page component.
> I've got a page that's working fine.  Was getting the ServletContext via an injected ApplicationGlobals and using the ApplicationGlobals within methods that needed the ServletContext.  Started to be a few methods needed it so I created a simple convenience method:
> 	@Inject
> 	@Service("ApplicationGlobals")
> 	private ApplicationGlobals applicationGlobals;
> 	protected ServletContext getServletContextObj() {
> 		return (applicationGlobals == null ? null : applicationGlobals.getServletContext());
> 	}
> And:
> org.apache.tapestry.internal.services.TransformationException
>  
> StackMapTable format error: bad class index
> transformation 
> InternalClassTransformation[
> public com.bar.baf.pages.UploadClip extends java.lang.Object
>   implements org.apache.tapestry.runtime.Component, org.apache.tapestry.runtime.RenderCommand
> add default method: public void postRenderCleanup()
> <default>
> add default method: public void setupRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void beginRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void beforeRenderTemplate(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void afterRenderTemplate(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void beforeRenderBody(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void afterRenderBody(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void afterRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public void cleanupRender(org.apache.tapestry.MarkupWriter $1, org.apache.tapestry.runtime.Event $2)
> <default>
> add default method: public boolean handleComponentEvent(org.apache.tapestry.runtime.ComponentEvent $1)
> <default>
> add default method: public org.apache.tapestry.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.tapestry.internal.InternalComponentResources _$resources;
> replace method: public final org.apache.tapestry.ComponentResources getComponentResources()
> return _$resources
> ...
> Turns out that getServletContext() is "reserved" by Tapestry.  I tried 
> protected abstract ServletContext getServletContext();
> But no dice. 
> Work-around:  changed the name of the method.  That worked.  Downside: the getServletContext() method name is the obvious /desirable one.
> Suggestion:  Prefer to have Tapestry not take over method names.  If it must, prefer to give them scoped names that aren't likely to be used by regular apps.  E.g.,  get/setTap5Foo (in general) and  getTap5ServletContext() (in particular).
> Thanks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org