You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Thomas Pasch (JIRA)" <ta...@jakarta.apache.org> on 2005/07/26 10:31:22 UTC

[jira] Commented: (TAPESTRY-441) Unable to redefine method 'inherited' from Interface

    [ http://issues.apache.org/jira/browse/TAPESTRY-441?page=comments#action_12316728 ] 

Thomas Pasch commented on TAPESTRY-441:
---------------------------------------

It even does not work for abstract classes. 

If I remove IHiddenStatePage and use an AHiddenStatePage like this:

public abstract class AHiddenStatePage 
    extends BasePage 
    implements PageRenderListener 
{
...
    public abstract void setPageBean(IPageBean bean);    
    public abstract IPageBean getPageBean();
}

I get the following error:

Error at classpath:/WEB-INF/Calculate.page, line 7, column 60: Error adding property pageBean to class de.atron.b2xsale.web.Calculate: Unable to add method de.atron.b2xsale.web.util.IPageBean getPageBean() to class $Calculate_8: duplicate method: getPageBean
  location:
classpath:/WEB-INF/Calculate.page, line 7, column 60
2  <!DOCTYPE page-specification
  3   PUBLIC "-//Apache Software Foundation//Tapestry Specification 4.0//EN"
  4   "http://jakarta.apache.org/tapestry/dtd/Tapestry_4_0.dtd">
  5  <!-- generated by Spindle, http://spindle.sourceforge.net -->
  6
  7  <page-specification class="de.atron.b2xsale.web.Calculate">
  8
  9   <description>Calculate</description>
  10
  11   <property name="PageBean" 
  12   persist="session" initial-value="new de.atron.b2xsale.web.beans.CalculateBean()"/>
org.apache.hivemind.ApplicationRuntimeException
  Unable to add method de.atron.b2xsale.web.util.IPageBean getPageBean() to class $Calculate_8: duplicate method: getPageBean     
  javassist.CannotCompileException
  duplicate method: getPageBean
  Stack Trace:
  javassist.bytecode.ClassFile.testExistingMethod(ClassFile.java:488) 
javassist.bytecode.ClassFile.addMethod(ClassFile.java:472) 
javassist.CtClassType.addMethod(CtClassType.java:907) 
org.apache.hivemind.service.impl.ClassFabImpl.addMethod(ClassFabImpl.java:291) 
org.apache.tapestry.enhance.EnhancementOperationImpl.addMethod(EnhancementOperationImpl.java:337) 
org.apache.tapestry.enhance.EnhanceUtils.createSimpleAccessor(EnhanceUtils.java:71) 
org.apache.tapestry.enhance.AbstractPropertyWorker.createProperty(AbstractPropertyWorker.java:69) 
org.apache.tapestry.enhance.AbstractPropertyWorker.performEnhancement(AbstractPropertyWorker.java:45) 
$EnhancementWorker_1055241a53a.performEnhancement($EnhancementWorker_1055241a53a.java) 
$EnhancementWorker_1055241a53c.performEnhancement($EnhancementWorker_1055241a53c.java) 
$EnhancementWorker_1055241a51e.performEnhancement($EnhancementWorker_1055241a51e.java) 
org.apache.tapestry.services.impl.ComponentConstructorFactoryImpl.getComponentConstructor(ComponentConstructorFactoryImpl.java:76) 
$ComponentConstructorFactory_1055241a507.getComponentConstructor($ComponentConstructorFactory_1055241a507.java) 
org.apache.tapestry.pageload.PageLoader.instantiatePage(PageLoader.java:611) 
org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:639) 
$IPageLoader_1055241a503.loadPage($IPageLoader_1055241a503.java) 
$IPageLoader_1055241a504.loadPage($IPageLoader_1055241a504.java) 
org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:118) 
$IPageSource_1055241a470.getPage($IPageSource_1055241a470.java) 
org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:252) 
org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:235) 
de.atron.b2xsale.web.Border.formGotoCalculate(Border.java:98)


> Unable to redefine method 'inherited' from Interface
> ----------------------------------------------------
>
>          Key: TAPESTRY-441
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-441
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: jboss-4.0.2 with tomcat 5.5.9 on linux
>     Reporter: Thomas Pasch

>
> On a (abstract) Page that implements an interface it is impossible to inject a property that
> is defined by an interface.
> This behaviour is a bug because 'Attempt to redefine method de.atron.b2xsale.web.util.IPageBean getPageBean() '
> is not really true as IPageBean is an interface and the redefined method is (still) abstract
> in my Caculate Page.
> The expected behaviour is to allow the 'redefinition' of the method without any warning.
> Details:
> This page definition (still 3.0 style but this is a bug against 4.0-beta2; it has work with 3.0.3):
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE page-specification
>       PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
>       "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
> <page-specification class="de.atron.b2xsale.web.Calculate">
>     <description>Calculate</description>
>     <property-specification name="PageBean" type="de.atron.b2xsale.web.util.IPageBean" 
>     	persistent="yes" initial-value="new de.atron.b2xsale.web.beans.CalculateBean()"/>
> ...
> </page-specification>
> leeds to the following Error:
> Error at classpath:/WEB-INF/Calculate.page, line 7, column 60: Error adding property pageBean to class de.atron.b2xsale.web.Calculate: Attempt to redefine method de.atron.b2xsale.web.util.IPageBean getPageBean() of class $Calculate_25.
>   location:
> classpath:/WEB-INF/Calculate.page, line 7, column 60
> 2  <!DOCTYPE page-specification
>   3   PUBLIC "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
>   4   "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">
>   5  <!-- generated by Spindle, http://spindle.sourceforge.net -->
>   6
>   7  <page-specification class="de.atron.b2xsale.web.Calculate">
>   8
>   9   <description>Calculate</description>
>   10
>   11   <property-specification name="PageBean" type="de.atron.b2xsale.web.util.IPageBean" 
>   12   persistent="yes" initial-value="new de.atron.b2xsale.web.beans.CalculateBean()"/>
> org.apache.hivemind.ApplicationRuntimeException
>   Attempt to redefine method de.atron.b2xsale.web.util.IPageBean getPageBean() of class $Calculate_25.
>   Stack Trace:
>   org.apache.hivemind.service.impl.ClassFabImpl.addMethod(ClassFabImpl.java:276) 
> org.apache.tapestry.enhance.EnhancementOperationImpl.addMethod(EnhancementOperationImpl.java:337) 
> org.apache.tapestry.enhance.EnhanceUtils.createSimpleAccessor(EnhanceUtils.java:71) 
> org.apache.tapestry.enhance.AbstractPropertyWorker.createProperty(AbstractPropertyWorker.java:69) 
> org.apache.tapestry.enhance.AbstractPropertyWorker.performEnhancement(AbstractPropertyWorker.java:45) 
> $EnhancementWorker_10551fa4f1f.performEnhancement($EnhancementWorker_10551fa4f1f.java) 
> $EnhancementWorker_10551fa4f21.performEnhancement($EnhancementWorker_10551fa4f21.java) 
> $EnhancementWorker_10551fa4f03.performEnhancement($EnhancementWorker_10551fa4f03.java) 
> org.apache.tapestry.services.impl.ComponentConstructorFactoryImpl.getComponentConstructor(ComponentConstructorFactoryImpl.java:76) 
> $ComponentConstructorFactory_10551fa4eec.getComponentConstructor($ComponentConstructorFactory_10551fa4eec.java) 
> org.apache.tapestry.pageload.PageLoader.instantiatePage(PageLoader.java:611) 
> org.apache.tapestry.pageload.PageLoader.loadPage(PageLoader.java:639) 
> $IPageLoader_10551fa4ee8.loadPage($IPageLoader_10551fa4ee8.java) 
> $IPageLoader_10551fa4ee9.loadPage($IPageLoader_10551fa4ee9.java) 
> org.apache.tapestry.pageload.PageSource.getPage(PageSource.java:118) 
> $IPageSource_10551fa4e58.getPage($IPageSource_10551fa4e58.java) 
> org.apache.tapestry.engine.RequestCycle.loadPage(RequestCycle.java:252) 
> org.apache.tapestry.engine.RequestCycle.getPage(RequestCycle.java:235) 
> de.atron.b2xsale.web.Border.formGotoCalculate(Border.java:98)
> on the Page Caculate
> public abstract class Calculate extends AHiddenStatePage 
> { ... }
> with AHiddenStatePage with
> public abstract class AHiddenStatePage 
>     extends BasePage 
>     implements IHiddenStatePage, PageRenderListener 
> { ... }
> with the interface IHiddenStagePage
> public interface IHiddenStatePage extends IPage {
>     void setPageBean(IPageBean bean);
>     IPageBean getPageBean();  
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


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