2 Replies Latest reply on Feb 19, 2010 3:02 PM by Mathias Peters

    Seam component that extends class cannot be invoked from JSF

    Henki Lubis Newbie

      I have a pojo seam component (Not session bean) let say class A. This class can be invoked from my jsf page. But when i extends an abstract class like shown below
      Note: B is abstract class and dont use @Name annotation or any seam annotation

      public class A extends B{
      my code here

      I cannot invoke any methods of A in my JSF page anymore. can seam component extends an abstract/normal class and be invoked from JSF page ?
      Do i make something wrong with my code? because if i remove the extends, everything works well.


        • 1. Re: Seam component that extends class cannot be invoked from JSF
          mimik789 Newbie

          I also would like to see solution/explanation for that particular case.

          Is it possible to have base class (abstract/concreate) - that share common logic for a further seam component(s) which extends that class. I would like also to use seam annotations like @Logger, to provide common logger for further seam components that extend that base class (without using @Name in that base class).

          is that even possible?
          (I know that I could use @Role annotation to get similar effect, but this question is
          in general about inheritance support in Seam for it's components)

          base class (not meant to be directly created as seam component = no @Name annotation)

          public class Counter {
              final Log log;
              private int count;
              public Counter() {
                  log.debug("counter constructed");

          seam components that share common logic + common logger from preceding base class

          seam comonent1 in application scope

          public class ApplicationCounterAction extends Counter {
              public ApplicationCounterAction() {
                  log.debug("application counter constructed");
              public synchronized void setCount(int count) {

          seam component2 in session scope

          public class SessionCounterAction extends Counter {
              public SessionCounterAction() {
                  log.debug("session counter constructed");
              public void setCount(int count) {

          • 2. Re: Seam component that extends class cannot be invoked from JSF
            Mathias Peters Newbie


            yep, that should work.
            It did in a similar case for me.