You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Henrik Vendelbo (JIRA)" <ta...@jakarta.apache.org> on 2005/11/16 12:46:27 UTC

[jira] Created: (TAPESTRY-755) injection: Beware of where you declare the abstract method

injection: Beware of where you declare the abstract method
----------------------------------------------------------

         Key: TAPESTRY-755
         URL: http://issues.apache.org/jira/browse/TAPESTRY-755
     Project: Tapestry
        Type: Bug
  Components: Framework  
    Versions: 4.0    
 Environment: Tested on Tomcat 5.5.9 / JDK 1.5 / FC2
    Reporter: Henrik Vendelbo
    Priority: Minor


Take the following class hierachy: BasePage -> MarketPage -> FeaturePage

If you inject into FeaturePage using an <inject> tag in the page file, but the abstract method is declared in MarketPage, the enhanced version of FeaturePage will _not_ have an implementation of the accessor method.

If you try to declare the abstract method in FeaturePage as well, it will _not_ have an implementation of the accessor method.

If you instead do an @InjectObject in MarketPage(and remember to remove the inject tag), the enhanced FeaturePage class will have an implementation of the accessor method.

I other words the current functionality requires that you inject into the class that first declares the abstract method, and not a sub class.

-- 
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


[jira] Updated: (TAPESTRY-755) injection: Beware of where you declare the abstract method

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

Jesse Kuhnert updated TAPESTRY-755:
-----------------------------------

    Fix Version/s:     (was: 4.1.2)
                   4.1.3

> injection: Beware of where you declare the abstract method
> ----------------------------------------------------------
>
>                 Key: TAPESTRY-755
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-755
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.0
>         Environment: Tested on Tomcat 5.5.9 / JDK 1.5 / FC2
>            Reporter: Henrik Vendelbo
>            Priority: Minor
>             Fix For: 4.1.3
>
>         Attachments: InjectInheritance.html, InjectInheritance.java, InjectInheritance.page, SandboxPage.java
>
>
> Take the following class hierachy: BasePage -> MarketPage -> FeaturePage
> If you inject into FeaturePage using an <inject> tag in the page file, but the abstract method is declared in MarketPage, the enhanced version of FeaturePage will _not_ have an implementation of the accessor method.
> If you try to declare the abstract method in FeaturePage as well, it will _not_ have an implementation of the accessor method.
> If you instead do an @InjectObject in MarketPage(and remember to remove the inject tag), the enhanced FeaturePage class will have an implementation of the accessor method.
> I other words the current functionality requires that you inject into the class that first declares the abstract method, and not a sub class.

-- 
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-755) injection: Beware of where you declare the abstract method

Posted by "Jesse Kuhnert (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-755?page=all ]

Jesse Kuhnert updated TAPESTRY-755:
-----------------------------------

    Fix Version/s: 4.1.2

> injection: Beware of where you declare the abstract method
> ----------------------------------------------------------
>
>                 Key: TAPESTRY-755
>                 URL: http://issues.apache.org/jira/browse/TAPESTRY-755
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.0
>         Environment: Tested on Tomcat 5.5.9 / JDK 1.5 / FC2
>            Reporter: Henrik Vendelbo
>            Priority: Minor
>             Fix For: 4.1.2
>
>         Attachments: InjectInheritance.html, InjectInheritance.java, InjectInheritance.page, SandboxPage.java
>
>
> Take the following class hierachy: BasePage -> MarketPage -> FeaturePage
> If you inject into FeaturePage using an <inject> tag in the page file, but the abstract method is declared in MarketPage, the enhanced version of FeaturePage will _not_ have an implementation of the accessor method.
> If you try to declare the abstract method in FeaturePage as well, it will _not_ have an implementation of the accessor method.
> If you instead do an @InjectObject in MarketPage(and remember to remove the inject tag), the enhanced FeaturePage class will have an implementation of the accessor method.
> I other words the current functionality requires that you inject into the class that first declares the abstract method, and not a sub class.

-- 
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: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


[jira] Updated: (TAPESTRY-755) injection: Beware of where you declare the abstract method

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-755?page=all ]

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

    Attachment: SandboxPage.java
                InjectInheritance.java
                InjectInheritance.page

Ok, so what we have here is an HTML template, a page specification, a base class, and a page class.  Seems to fit your descritpion as accurately as I can, and it works just fine.

Are you seeing exceptions, or anything in the log?

Also, try the following.  Modify log4j.properties and add

log4j.category.tapestry.enhance.ComponentConstructorFactory=debug

When you run the app, you should see quite a bit of activity as page and component classes are enhanced to form concrete subclasses.  In my example:

ComponentConstructorFactory [DEBUG] Creating class:

ClassFab[
public class $InjectInheritance_0 extends pages.InjectInheritance

private org.apache.tapestry.services.ComponentMessagesSource _$componentMessagesSource;

private org.apache.hivemind.Messages _$messages;

private org.apache.tapestry.spec.IComponentSpecification _$specification;

private org.apache.tapestry.web.WebRequest _$webRequest;

public $InjectInheritance_0(org.apache.tapestry.services.ComponentMessagesSource $1, org.apache.tapestry.spec.IComponentSpecification $2, org.apache.tapestry.web.WebRequest $3)
{
  _$componentMessagesSource = $1;
  _$specification = $2;
  _$webRequest = $3;
}


public org.apache.tapestry.spec.IComponentSpecification getSpecification()
return _$specification;

public org.apache.hivemind.Messages getMessages()
{
  if (_$messages == null)
    _$messages = _$componentMessagesSource.getMessages(this);
  return _$messages;
}


public org.apache.tapestry.web.WebRequest getWebRequest()
return _$webRequest;

]



> injection: Beware of where you declare the abstract method
> ----------------------------------------------------------
>
>          Key: TAPESTRY-755
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-755
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Tested on Tomcat 5.5.9 / JDK 1.5 / FC2
>     Reporter: Henrik Vendelbo
>     Priority: Minor
>  Attachments: InjectInheritance.html, InjectInheritance.java, InjectInheritance.page, SandboxPage.java
>
> Take the following class hierachy: BasePage -> MarketPage -> FeaturePage
> If you inject into FeaturePage using an <inject> tag in the page file, but the abstract method is declared in MarketPage, the enhanced version of FeaturePage will _not_ have an implementation of the accessor method.
> If you try to declare the abstract method in FeaturePage as well, it will _not_ have an implementation of the accessor method.
> If you instead do an @InjectObject in MarketPage(and remember to remove the inject tag), the enhanced FeaturePage class will have an implementation of the accessor method.
> I other words the current functionality requires that you inject into the class that first declares the abstract method, and not a sub class.

-- 
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


[jira] Updated: (TAPESTRY-755) injection: Beware of where you declare the abstract method

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

Marcus Schulte updated TAPESTRY-755:
------------------------------------

    Fix Version/s:     (was: 4.1.6)
                   4.1.7

> injection: Beware of where you declare the abstract method
> ----------------------------------------------------------
>
>                 Key: TAPESTRY-755
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-755
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.0
>         Environment: Tested on Tomcat 5.5.9 / JDK 1.5 / FC2
>            Reporter: Henrik Vendelbo
>            Priority: Minor
>             Fix For: 4.1.7
>
>         Attachments: InjectInheritance.html, InjectInheritance.java, InjectInheritance.page, SandboxPage.java
>
>
> Take the following class hierachy: BasePage -> MarketPage -> FeaturePage
> If you inject into FeaturePage using an <inject> tag in the page file, but the abstract method is declared in MarketPage, the enhanced version of FeaturePage will _not_ have an implementation of the accessor method.
> If you try to declare the abstract method in FeaturePage as well, it will _not_ have an implementation of the accessor method.
> If you instead do an @InjectObject in MarketPage(and remember to remove the inject tag), the enhanced FeaturePage class will have an implementation of the accessor method.
> I other words the current functionality requires that you inject into the class that first declares the abstract method, and not a sub class.

-- 
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-755) injection: Beware of where you declare the abstract method

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

Jesse Kuhnert updated TAPESTRY-755:
-----------------------------------

    Fix Version/s:     (was: 4.1.3)
                   4.1.4

> injection: Beware of where you declare the abstract method
> ----------------------------------------------------------
>
>                 Key: TAPESTRY-755
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-755
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.0
>         Environment: Tested on Tomcat 5.5.9 / JDK 1.5 / FC2
>            Reporter: Henrik Vendelbo
>            Priority: Minor
>             Fix For: 4.1.4
>
>         Attachments: InjectInheritance.html, InjectInheritance.java, InjectInheritance.page, SandboxPage.java
>
>
> Take the following class hierachy: BasePage -> MarketPage -> FeaturePage
> If you inject into FeaturePage using an <inject> tag in the page file, but the abstract method is declared in MarketPage, the enhanced version of FeaturePage will _not_ have an implementation of the accessor method.
> If you try to declare the abstract method in FeaturePage as well, it will _not_ have an implementation of the accessor method.
> If you instead do an @InjectObject in MarketPage(and remember to remove the inject tag), the enhanced FeaturePage class will have an implementation of the accessor method.
> I other words the current functionality requires that you inject into the class that first declares the abstract method, and not a sub class.

-- 
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-755) injection: Beware of where you declare the abstract method

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
    [ http://issues.apache.org/jira/browse/TAPESTRY-755?page=comments#action_12357812 ] 

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

I'll be somewhat surprised if this is the case, especially for a Sun JDK.  I'll be building a test case in my sandbox shortly.  Are you absolutely sure about the property names, method names, and that everything is public and abstract?

> injection: Beware of where you declare the abstract method
> ----------------------------------------------------------
>
>          Key: TAPESTRY-755
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-755
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Tested on Tomcat 5.5.9 / JDK 1.5 / FC2
>     Reporter: Henrik Vendelbo
>     Priority: Minor

>
> Take the following class hierachy: BasePage -> MarketPage -> FeaturePage
> If you inject into FeaturePage using an <inject> tag in the page file, but the abstract method is declared in MarketPage, the enhanced version of FeaturePage will _not_ have an implementation of the accessor method.
> If you try to declare the abstract method in FeaturePage as well, it will _not_ have an implementation of the accessor method.
> If you instead do an @InjectObject in MarketPage(and remember to remove the inject tag), the enhanced FeaturePage class will have an implementation of the accessor method.
> I other words the current functionality requires that you inject into the class that first declares the abstract method, and not a sub class.

-- 
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


[jira] Updated: (TAPESTRY-755) injection: Beware of where you declare the abstract method

Posted by "Howard M. Lewis Ship (JIRA)" <ta...@jakarta.apache.org>.
     [ http://issues.apache.org/jira/browse/TAPESTRY-755?page=all ]

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

    Attachment: InjectInheritance.html

> injection: Beware of where you declare the abstract method
> ----------------------------------------------------------
>
>          Key: TAPESTRY-755
>          URL: http://issues.apache.org/jira/browse/TAPESTRY-755
>      Project: Tapestry
>         Type: Bug
>   Components: Framework
>     Versions: 4.0
>  Environment: Tested on Tomcat 5.5.9 / JDK 1.5 / FC2
>     Reporter: Henrik Vendelbo
>     Priority: Minor
>  Attachments: InjectInheritance.html
>
> Take the following class hierachy: BasePage -> MarketPage -> FeaturePage
> If you inject into FeaturePage using an <inject> tag in the page file, but the abstract method is declared in MarketPage, the enhanced version of FeaturePage will _not_ have an implementation of the accessor method.
> If you try to declare the abstract method in FeaturePage as well, it will _not_ have an implementation of the accessor method.
> If you instead do an @InjectObject in MarketPage(and remember to remove the inject tag), the enhanced FeaturePage class will have an implementation of the accessor method.
> I other words the current functionality requires that you inject into the class that first declares the abstract method, and not a sub class.

-- 
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


[jira] Updated: (TAPESTRY-755) injection: Beware of where you declare the abstract method

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

Jesse Kuhnert updated TAPESTRY-755:
-----------------------------------

    Fix Version/s:     (was: 4.1.5)
                   4.1.6

> injection: Beware of where you declare the abstract method
> ----------------------------------------------------------
>
>                 Key: TAPESTRY-755
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-755
>             Project: Tapestry
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.0
>         Environment: Tested on Tomcat 5.5.9 / JDK 1.5 / FC2
>            Reporter: Henrik Vendelbo
>            Priority: Minor
>             Fix For: 4.1.6
>
>         Attachments: InjectInheritance.html, InjectInheritance.java, InjectInheritance.page, SandboxPage.java
>
>
> Take the following class hierachy: BasePage -> MarketPage -> FeaturePage
> If you inject into FeaturePage using an <inject> tag in the page file, but the abstract method is declared in MarketPage, the enhanced version of FeaturePage will _not_ have an implementation of the accessor method.
> If you try to declare the abstract method in FeaturePage as well, it will _not_ have an implementation of the accessor method.
> If you instead do an @InjectObject in MarketPage(and remember to remove the inject tag), the enhanced FeaturePage class will have an implementation of the accessor method.
> I other words the current functionality requires that you inject into the class that first declares the abstract method, and not a sub class.

-- 
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